Skip to content

Commit 972fde4

Browse files
committed
Check access key length for #94
1 parent 938dc39 commit 972fde4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

iamlivecore/logger.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,10 @@ func getAccountFromAccessKey(accessKeyId string) (string, error) {
846846
base10 := "0123456789"
847847
base32AwsFlavour := "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"
848848

849+
if len(accessKeyId) < 14 {
850+
return "", fmt.Errorf("access key ID too short")
851+
}
852+
849853
offsetStr, err := baseconv.Convert("QAAAAAAA", base32AwsFlavour, base10)
850854
if err != nil {
851855
return "", err

0 commit comments

Comments
 (0)