3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-22 18:52:41 +01:00

tweaks for consistency

This commit is contained in:
Shivaram Lingamneni 2019-12-18 20:33:50 -05:00
parent 98e83b0a82
commit 6033d9f569
3 changed files with 17 additions and 17 deletions

View File

@ -211,7 +211,7 @@ type OperConfig struct {
Vhost string Vhost string
WhoisLine string `yaml:"whois-line"` WhoisLine string `yaml:"whois-line"`
Password string Password string
Certfp string Fingerprint string
Modes string Modes string
} }
@ -460,7 +460,7 @@ type Oper struct {
WhoisLine string WhoisLine string
Vhost string Vhost string
Pass []byte Pass []byte
Certfp string Fingerprint string
Modes []modes.ModeChange Modes []modes.ModeChange
} }
@ -481,7 +481,7 @@ func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error
if err != nil { if err != nil {
return nil, err return nil, err
} }
oper.Certfp = opConf.Certfp oper.Fingerprint = opConf.Fingerprint
oper.Vhost = opConf.Vhost oper.Vhost = opConf.Vhost
class, exists := oc[opConf.Class] class, exists := oc[opConf.Class]

View File

@ -2180,7 +2180,7 @@ func operHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
authorized := false authorized := false
oper := server.GetOperator(msg.Params[0]) oper := server.GetOperator(msg.Params[0])
if oper != nil { if oper != nil {
if utils.CertfpsMatch(oper.Certfp, client.certfp) { if utils.CertfpsMatch(oper.Fingerprint, client.certfp) {
authorized = true authorized = true
} else if 1 < len(msg.Params) { } else if 1 < len(msg.Params) {
password := []byte(msg.Params[1]) password := []byte(msg.Params[1])
@ -2645,7 +2645,7 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
if 0 < len(info.Password) && bcrypt.CompareHashAndPassword(info.Password, givenPassword) != nil { if 0 < len(info.Password) && bcrypt.CompareHashAndPassword(info.Password, givenPassword) != nil {
continue continue
} }
if 0 < len(info.Fingerprint) && client.certfp != info.Fingerprint { if 0 < len(info.Fingerprint) && !utils.CertfpsMatch(info.Fingerprint, client.certfp) {
continue continue
} }

View File

@ -452,7 +452,7 @@ opers:
# if you're logged in using the client cert with this SHA-256 fingerprint, # if you're logged in using the client cert with this SHA-256 fingerprint,
# you'll be able to /OPER without a password # you'll be able to /OPER without a password
certfp: "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789" fingerprint: "abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123456789"
# logging, takes inspiration from Insp # logging, takes inspiration from Insp
logging: logging: