Browse Source

tweaks for consistency

tags/v2.0.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
6033d9f569
3 changed files with 17 additions and 17 deletions
  1. 14
    14
      irc/config.go
  2. 2
    2
      irc/handlers.go
  3. 1
    1
      oragono.yaml

+ 14
- 14
irc/config.go View File

207
 
207
 
208
 // OperConfig defines a specific operator's configuration.
208
 // OperConfig defines a specific operator's configuration.
209
 type OperConfig struct {
209
 type OperConfig struct {
210
-	Class     string
211
-	Vhost     string
212
-	WhoisLine string `yaml:"whois-line"`
213
-	Password  string
214
-	Certfp    string
215
-	Modes     string
210
+	Class       string
211
+	Vhost       string
212
+	WhoisLine   string `yaml:"whois-line"`
213
+	Password    string
214
+	Fingerprint string
215
+	Modes       string
216
 }
216
 }
217
 
217
 
218
 // LineLenConfig controls line lengths.
218
 // LineLenConfig controls line lengths.
455
 
455
 
456
 // Oper represents a single assembled operator's config.
456
 // Oper represents a single assembled operator's config.
457
 type Oper struct {
457
 type Oper struct {
458
-	Name      string
459
-	Class     *OperClass
460
-	WhoisLine string
461
-	Vhost     string
462
-	Pass      []byte
463
-	Certfp    string
464
-	Modes     []modes.ModeChange
458
+	Name        string
459
+	Class       *OperClass
460
+	WhoisLine   string
461
+	Vhost       string
462
+	Pass        []byte
463
+	Fingerprint string
464
+	Modes       []modes.ModeChange
465
 }
465
 }
466
 
466
 
467
 // Operators returns a map of operator configs from the given OperClass and config.
467
 // Operators returns a map of operator configs from the given OperClass and config.
481
 		if err != nil {
481
 		if err != nil {
482
 			return nil, err
482
 			return nil, err
483
 		}
483
 		}
484
-		oper.Certfp = opConf.Certfp
484
+		oper.Fingerprint = opConf.Fingerprint
485
 
485
 
486
 		oper.Vhost = opConf.Vhost
486
 		oper.Vhost = opConf.Vhost
487
 		class, exists := oc[opConf.Class]
487
 		class, exists := oc[opConf.Class]

+ 2
- 2
irc/handlers.go View File

2180
 	authorized := false
2180
 	authorized := false
2181
 	oper := server.GetOperator(msg.Params[0])
2181
 	oper := server.GetOperator(msg.Params[0])
2182
 	if oper != nil {
2182
 	if oper != nil {
2183
-		if utils.CertfpsMatch(oper.Certfp, client.certfp) {
2183
+		if utils.CertfpsMatch(oper.Fingerprint, client.certfp) {
2184
 			authorized = true
2184
 			authorized = true
2185
 		} else if 1 < len(msg.Params) {
2185
 		} else if 1 < len(msg.Params) {
2186
 			password := []byte(msg.Params[1])
2186
 			password := []byte(msg.Params[1])
2645
 			if 0 < len(info.Password) && bcrypt.CompareHashAndPassword(info.Password, givenPassword) != nil {
2645
 			if 0 < len(info.Password) && bcrypt.CompareHashAndPassword(info.Password, givenPassword) != nil {
2646
 				continue
2646
 				continue
2647
 			}
2647
 			}
2648
-			if 0 < len(info.Fingerprint) && client.certfp != info.Fingerprint {
2648
+			if 0 < len(info.Fingerprint) && !utils.CertfpsMatch(info.Fingerprint, client.certfp) {
2649
 				continue
2649
 				continue
2650
 			}
2650
 			}
2651
 
2651
 

+ 1
- 1
oragono.yaml View File

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

Loading…
Cancel
Save