Skip to content

Commit ad9cd61

Browse files
committed
Fix EncryptPIN
1 parent be03065 commit ad9cd61

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pin.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ import (
2323
)
2424

2525
func EncryptPIN(ctx context.Context, pin, pinToken, sessionId, privateKey string, iterator uint64) (string, error) {
26+
_, err := base64.RawURLEncoding.DecodeString(privateKey)
27+
if err == nil {
28+
return EncryptEd25519PIN(ctx, pin, pinToken, sessionId, privateKey, iterator)
29+
}
2630
privBlock, _ := pem.Decode([]byte(privateKey))
2731
if privBlock == nil {
2832
return "", errors.New("invalid pem private key")

0 commit comments

Comments
 (0)