aboutsummaryrefslogtreecommitdiff
path: root/ssha.go
diff options
context:
space:
mode:
Diffstat (limited to 'ssha.go')
-rw-r--r--ssha.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/ssha.go b/ssha.go
index 134c058..0443dd0 100644
--- a/ssha.go
+++ b/ssha.go
@@ -1,12 +1,13 @@
package main
import (
- "log"
"bytes"
+ "crypto/rand"
"crypto/sha1"
"encoding/base64"
"fmt"
- "crypto/rand"
+ "log"
+ "strings"
)
// Encode encodes the []byte of raw password
@@ -18,7 +19,7 @@ func SSHAEncode(rawPassPhrase []byte) string {
// Matches matches the encoded password and the raw password
func SSHAMatches(encodedPassPhrase string, rawPassPhrase []byte) bool {
- if encodedPassPhrase[:6] != "{ssha}" {
+ if !strings.EqualFold(encodedPassPhrase[:6], "{ssha}") {
return false
}