Przeglądaj źródła

tweaks for consistency

tags/v2.0.0-rc1
Shivaram Lingamneni 4 lat temu
rodzic
commit
6033d9f569
3 zmienionych plików z 17 dodań i 17 usunięć
  1. 14
    14
      irc/config.go
  2. 2
    2
      irc/handlers.go
  3. 1
    1
      oragono.yaml

+ 14
- 14
irc/config.go Wyświetl plik

@@ -207,12 +207,12 @@ type OperClassConfig struct {
207 207
 
208 208
 // OperConfig defines a specific operator's configuration.
209 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 218
 // LineLenConfig controls line lengths.
@@ -455,13 +455,13 @@ func (conf *Config) OperatorClasses() (map[string]*OperClass, error) {
455 455
 
456 456
 // Oper represents a single assembled operator's config.
457 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 467
 // Operators returns a map of operator configs from the given OperClass and config.
@@ -481,7 +481,7 @@ func (conf *Config) Operators(oc map[string]*OperClass) (map[string]*Oper, error
481 481
 		if err != nil {
482 482
 			return nil, err
483 483
 		}
484
-		oper.Certfp = opConf.Certfp
484
+		oper.Fingerprint = opConf.Fingerprint
485 485
 
486 486
 		oper.Vhost = opConf.Vhost
487 487
 		class, exists := oc[opConf.Class]

+ 2
- 2
irc/handlers.go Wyświetl plik

@@ -2180,7 +2180,7 @@ func operHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Resp
2180 2180
 	authorized := false
2181 2181
 	oper := server.GetOperator(msg.Params[0])
2182 2182
 	if oper != nil {
2183
-		if utils.CertfpsMatch(oper.Certfp, client.certfp) {
2183
+		if utils.CertfpsMatch(oper.Fingerprint, client.certfp) {
2184 2184
 			authorized = true
2185 2185
 		} else if 1 < len(msg.Params) {
2186 2186
 			password := []byte(msg.Params[1])
@@ -2645,7 +2645,7 @@ func webircHandler(server *Server, client *Client, msg ircmsg.IrcMessage, rb *Re
2645 2645
 			if 0 < len(info.Password) && bcrypt.CompareHashAndPassword(info.Password, givenPassword) != nil {
2646 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 2649
 				continue
2650 2650
 			}
2651 2651
 

+ 1
- 1
oragono.yaml Wyświetl plik

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

Ładowanie…
Anuluj
Zapisz