summaryrefslogtreecommitdiffstats
path: root/models/login_source.go
diff options
context:
space:
mode:
authorSandro Santilli <strk@kbt.io>2016-11-07 17:38:43 +0100
committerSandro Santilli <strk@kbt.io>2016-11-07 17:38:43 +0100
commit05fd9d3f096e53bcf80b73345d6fa567fbf017e6 (patch)
treef8626767c0759491625a9c8eb215cef3d2855163 /models/login_source.go
parent7612b5ec40955a5a0b4d281645e33a86d1632f70 (diff)
downloadgitea-05fd9d3f096e53bcf80b73345d6fa567fbf017e6.tar.gz
gitea-05fd9d3f096e53bcf80b73345d6fa567fbf017e6.zip
Security protocols
Diffstat (limited to 'models/login_source.go')
-rw-r--r--models/login_source.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/models/login_source.go b/models/login_source.go
index 3140d35c54..f3d4b2b96f 100644
--- a/models/login_source.go
+++ b/models/login_source.go
@@ -44,9 +44,9 @@ var LoginNames = map[LoginType]string{
}
var SecurityProtocolNames = map[ldap.SecurityProtocol]string{
- ldap.SECURITY_PROTOCOL_UNENCRYPTED: "Unencrypted",
- ldap.SECURITY_PROTOCOL_LDAPS: "LDAPS",
- ldap.SECURITY_PROTOCOL_START_TLS: "StartTLS",
+ ldap.SecurityProtocolUnencrypted: "Unencrypted",
+ ldap.SecurityProtocolLdaps: "LDAPS",
+ ldap.SecurityProtocolStartTls: "StartTLS",
}
// Ensure structs implemented interface.
@@ -182,14 +182,14 @@ func (source *LoginSource) IsPAM() bool {
func (source *LoginSource) HasTLS() bool {
return ((source.IsLDAP() || source.IsDLDAP()) &&
- source.LDAP().SecurityProtocol > ldap.SECURITY_PROTOCOL_UNENCRYPTED) ||
+ source.LDAP().SecurityProtocol > ldap.SecurityProtocolUnencrypted) ||
source.IsSMTP()
}
func (source *LoginSource) UseTLS() bool {
switch source.Type {
case LoginLdap, LoginDldap:
- return source.LDAP().SecurityProtocol != ldap.SECURITY_PROTOCOL_UNENCRYPTED
+ return source.LDAP().SecurityProtocol != ldap.SecurityProtocolUnencrypted
case LoginSmtp:
return source.SMTP().TLS
}