diff options
| author | Michael Forney <mforney@mforney.org> | 2020-04-15 15:48:58 -0700 |
|---|---|---|
| committer | Michael Forney <mforney@mforney.org> | 2020-04-15 19:07:19 -0700 |
| commit | 73f62cd40a9db1f012d2e95b8f7a77d95845f80e (patch) | |
| tree | 397dad316397dbdd4094901e75b43ae904be5886 /pkg/libfido2/patch/0006-cbor-u2f-avoid-use-of-packed-struct.patch | |
| parent | 60636d3b1a15c00a6488ed2287499a0ffc0b0c16 (diff) | |
libfido2: Update to 1.4.0
Diffstat (limited to 'pkg/libfido2/patch/0006-cbor-u2f-avoid-use-of-packed-struct.patch')
| -rw-r--r-- | pkg/libfido2/patch/0006-cbor-u2f-avoid-use-of-packed-struct.patch | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/pkg/libfido2/patch/0006-cbor-u2f-avoid-use-of-packed-struct.patch b/pkg/libfido2/patch/0006-cbor-u2f-avoid-use-of-packed-struct.patch index e1ec2962..c44e7866 100644 --- a/pkg/libfido2/patch/0006-cbor-u2f-avoid-use-of-packed-struct.patch +++ b/pkg/libfido2/patch/0006-cbor-u2f-avoid-use-of-packed-struct.patch @@ -1,21 +1,21 @@ -From 93cf0396ef7619635d2de1ae40a6382b2317f66f Mon Sep 17 00:00:00 2001 +From 1cb2420a26924ea4b4a5b525a78cdd06e4f9e4fa Mon Sep 17 00:00:00 2001 From: Michael Forney <mforney@mforney.org> Date: Tue, 26 Nov 2019 19:30:10 -0800 Subject: [PATCH] cbor, u2f: avoid use of packed struct --- - src/cbor.c | 14 +++++++++-- - src/types.h | 14 ++--------- - src/u2f.c | 70 ++++++++++++++++++++++++++++++++++++----------------- - 3 files changed, 62 insertions(+), 36 deletions(-) + src/cbor.c | 14 ++++++++-- + src/fido/types.h | 13 ++------- + src/u2f.c | 70 +++++++++++++++++++++++++++++++++--------------- + 3 files changed, 62 insertions(+), 35 deletions(-) diff --git a/src/cbor.c b/src/cbor.c -index 3e03592..e60e5e3 100644 +index 3928325..2b3c150 100644 --- a/src/cbor.c +++ b/src/cbor.c -@@ -1228,7 +1228,12 @@ cbor_decode_cred_authdata(const cbor_item_t *item, int cose_alg, - +@@ -1278,7 +1278,12 @@ cbor_decode_cred_authdata(const cbor_item_t *item, int cose_alg, fido_log_debug("%s: buf=%p, len=%zu", __func__, (const void *)buf, len); + fido_log_xxd(buf, len); - if (fido_buf_read(&buf, &len, authdata, sizeof(*authdata)) < 0) { + if (fido_buf_read(&buf, &len, authdata->rp_id_hash, @@ -27,7 +27,7 @@ index 3e03592..e60e5e3 100644 fido_log_debug("%s: fido_buf_read", __func__); return (-1); } -@@ -1278,7 +1283,12 @@ cbor_decode_assert_authdata(const cbor_item_t *item, fido_blob_t *authdata_cbor, +@@ -1328,7 +1333,12 @@ cbor_decode_assert_authdata(const cbor_item_t *item, fido_blob_t *authdata_cbor, fido_log_debug("%s: buf=%p, len=%zu", __func__, (const void *)buf, len); @@ -41,20 +41,19 @@ index 3e03592..e60e5e3 100644 fido_log_debug("%s: fido_buf_read", __func__); return (-1); } -diff --git a/src/types.h b/src/types.h -index af72710..af1874a 100644 ---- a/src/types.h -+++ b/src/types.h -@@ -7,8 +7,6 @@ - #ifndef _TYPES_H - #define _TYPES_H - +diff --git a/src/fido/types.h b/src/fido/types.h +index a8ce2ec..814f22c 100644 +--- a/src/fido/types.h ++++ b/src/fido/types.h +@@ -44,7 +44,6 @@ typedef enum { + typedef void fido_log_handler_t(const char *); + + #ifdef _FIDO_INTERNAL -#include "packed.h" -- + #include "blob.h" + /* COSE ES256 (ECDSA over P-256 with SHA-256) public key */ - typedef struct es256_pk { - unsigned char x[32]; -@@ -31,20 +29,12 @@ typedef struct eddsa_pk { +@@ -69,20 +68,12 @@ typedef struct eddsa_pk { unsigned char x[32]; } eddsa_pk_t; @@ -78,7 +77,7 @@ index af72710..af1874a 100644 typedef struct fido_attcred { unsigned char aaguid[16]; /* credential's aaguid */ diff --git a/src/u2f.c b/src/u2f.c -index 80fd14d..e02b611 100644 +index 3b01f61..848d2fb 100644 --- a/src/u2f.c +++ b/src/u2f.c @@ -16,6 +16,29 @@ @@ -143,7 +142,7 @@ index 80fd14d..e02b611 100644 fido_log_debug("%s: cbor_build_bytestring", __func__); return (-1); } -@@ -412,18 +436,18 @@ static int +@@ -410,18 +434,18 @@ static int encode_cred_authdata(const char *rp_id, const uint8_t *kh, uint8_t kh_len, const uint8_t *pubkey, size_t pubkey_len, fido_blob_t *out) { @@ -172,7 +171,7 @@ index 80fd14d..e02b611 100644 memset(&authdata_blob, 0, sizeof(authdata_blob)); memset(out, 0, sizeof(*out)); -@@ -437,17 +461,19 @@ encode_cred_authdata(const char *rp_id, const uint8_t *kh, uint8_t kh_len, +@@ -435,17 +459,19 @@ encode_cred_authdata(const char *rp_id, const uint8_t *kh, uint8_t kh_len, goto fail; } @@ -198,5 +197,5 @@ index 80fd14d..e02b611 100644 len = authdata_blob.len = sizeof(authdata) + sizeof(attcred_raw) + kh_len + pk_blob.len; -- -2.26.0 +2.26.1 |
