Const cleanup

This commit is contained in:
Peter D. Gray 2020-01-24 08:34:33 -05:00
parent 1e9038a8ba
commit 2eef24b7dc
No known key found for this signature in database
GPG Key ID: F0E6CC6AFC16CF7B
2 changed files with 5 additions and 4 deletions

View File

@ -863,7 +863,7 @@ be shown on the Coldcard screen.
if not secret and not show_qr:
# ask the Coldcard to show the QR (for password or TOTP shared secret)
mode |= 0x80
mode |= USER_AUTH_SHOW_QR
new_secret = dev.send_recv(CCProtocolPacker.create_user(username, mode, secret))

View File

@ -25,9 +25,10 @@ MAX_UPLOAD_LEN = const(2*MAX_TXN_LEN)
MSG_SIGNING_MAX_LENGTH = const(240)
# Types of user auth we support
USER_AUTH_TOTP = const(1) # RFC6238
USER_AUTH_HOTP = const(2) # RFC4226
USER_AUTH_HMAC = const(3) # PBKDF2('hmac-sha256', secret, sha256(psbt), PBKDF2_ITER_COUNT)
USER_AUTH_TOTP = const(1) # RFC6238
USER_AUTH_HOTP = const(2) # RFC4226
USER_AUTH_HMAC = const(3) # PBKDF2('hmac-sha256', secret, sha256(psbt), PBKDF2_ITER_COUNT)
USER_AUTH_SHOW_QR = const(0x80) # show secret on Coldcard screen (best for TOTP enroll)
MAX_USERNAME_LEN = 16
PBKDF2_ITER_COUNT = 2500