summaryrefslogtreecommitdiff
path: root/src/pin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pin.c')
-rw-r--r--src/pin.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/pin.c b/src/pin.c
index 36acbe4..8b23ae3 100644
--- a/src/pin.c
+++ b/src/pin.c
@@ -53,7 +53,7 @@ fido_dev_get_pin_token_tx(fido_dev_t *dev, const char *pin,
53 53
54 if ((argv[0] = cbor_build_uint8(1)) == NULL || 54 if ((argv[0] = cbor_build_uint8(1)) == NULL ||
55 (argv[1] = cbor_build_uint8(5)) == NULL || 55 (argv[1] = cbor_build_uint8(5)) == NULL ||
56 (argv[2] = es256_pk_encode(pk, 0)) == NULL || 56 (argv[2] = es256_pk_encode(pk, 1)) == NULL ||
57 (argv[5] = cbor_encode_pin_hash_enc(ecdh, p)) == NULL) { 57 (argv[5] = cbor_encode_pin_hash_enc(ecdh, p)) == NULL) {
58 fido_log_debug("%s: cbor encode", __func__); 58 fido_log_debug("%s: cbor encode", __func__);
59 r = FIDO_ERR_INTERNAL; 59 r = FIDO_ERR_INTERNAL;
@@ -89,7 +89,7 @@ fido_dev_get_uv_token_tx(fido_dev_t *dev, const es256_pk_t *pk)
89 89
90 if ((argv[0] = cbor_build_uint8(1)) == NULL || 90 if ((argv[0] = cbor_build_uint8(1)) == NULL ||
91 (argv[1] = cbor_build_uint8(6)) == NULL || 91 (argv[1] = cbor_build_uint8(6)) == NULL ||
92 (argv[2] = es256_pk_encode(pk, 0)) == NULL) { 92 (argv[2] = es256_pk_encode(pk, 1)) == NULL) {
93 fido_log_debug("%s: cbor encode", __func__); 93 fido_log_debug("%s: cbor encode", __func__);
94 r = FIDO_ERR_INTERNAL; 94 r = FIDO_ERR_INTERNAL;
95 goto fail; 95 goto fail;
@@ -240,7 +240,7 @@ pad64(const char *pin, fido_blob_t **ppin)
240 if ((*ppin = fido_blob_new()) == NULL) 240 if ((*ppin = fido_blob_new()) == NULL)
241 return (FIDO_ERR_INTERNAL); 241 return (FIDO_ERR_INTERNAL);
242 242
243 ppin_len = (pin_len + 63) & ~63; 243 ppin_len = (pin_len + 63U) & ~63U;
244 if (ppin_len < pin_len || ((*ppin)->ptr = calloc(1, ppin_len)) == NULL) { 244 if (ppin_len < pin_len || ((*ppin)->ptr = calloc(1, ppin_len)) == NULL) {
245 fido_blob_free(ppin); 245 fido_blob_free(ppin);
246 return (FIDO_ERR_INTERNAL); 246 return (FIDO_ERR_INTERNAL);
@@ -285,7 +285,7 @@ fido_dev_change_pin_tx(fido_dev_t *dev, const char *pin, const char *oldpin)
285 285
286 if ((argv[0] = cbor_build_uint8(1)) == NULL || 286 if ((argv[0] = cbor_build_uint8(1)) == NULL ||
287 (argv[1] = cbor_build_uint8(4)) == NULL || 287 (argv[1] = cbor_build_uint8(4)) == NULL ||
288 (argv[2] = es256_pk_encode(pk, 0)) == NULL || 288 (argv[2] = es256_pk_encode(pk, 1)) == NULL ||
289 (argv[3] = cbor_encode_change_pin_auth(ecdh, ppin, opin)) == NULL || 289 (argv[3] = cbor_encode_change_pin_auth(ecdh, ppin, opin)) == NULL ||
290 (argv[4] = cbor_encode_pin_enc(ecdh, ppin)) == NULL || 290 (argv[4] = cbor_encode_pin_enc(ecdh, ppin)) == NULL ||
291 (argv[5] = cbor_encode_pin_hash_enc(ecdh, opin)) == NULL) { 291 (argv[5] = cbor_encode_pin_hash_enc(ecdh, opin)) == NULL) {
@@ -339,7 +339,7 @@ fido_dev_set_pin_tx(fido_dev_t *dev, const char *pin)
339 339
340 if ((argv[0] = cbor_build_uint8(1)) == NULL || 340 if ((argv[0] = cbor_build_uint8(1)) == NULL ||
341 (argv[1] = cbor_build_uint8(3)) == NULL || 341 (argv[1] = cbor_build_uint8(3)) == NULL ||
342 (argv[2] = es256_pk_encode(pk, 0)) == NULL || 342 (argv[2] = es256_pk_encode(pk, 1)) == NULL ||
343 (argv[3] = cbor_encode_set_pin_auth(ecdh, ppin)) == NULL || 343 (argv[3] = cbor_encode_set_pin_auth(ecdh, ppin)) == NULL ||
344 (argv[4] = cbor_encode_pin_enc(ecdh, ppin)) == NULL) { 344 (argv[4] = cbor_encode_pin_enc(ecdh, ppin)) == NULL) {
345 fido_log_debug("%s: cbor encode", __func__); 345 fido_log_debug("%s: cbor encode", __func__);