commit: 3fe24c73976047fe76b74b32fca2e6c1d35eac4c
parent d9a2250d8127ced472be68b7817957b92caaa1fd
Author: Michael Forney <mforney@mforney.org>
Date: Tue, 14 Apr 2020 20:10:46 -0700
libfido2: Fix some includes in patches
Diffstat:
5 files changed, 52 insertions(+), 32 deletions(-)
diff --git a/pkg/libfido2/patch/0001-hid_linux-Use-sysfs-instead-of-libudev.patch b/pkg/libfido2/patch/0001-hid_linux-Use-sysfs-instead-of-libudev.patch
@@ -1,27 +1,42 @@
-From 3a6643cacac89dd0c2b6587bb0508b627954c62a Mon Sep 17 00:00:00 2001
+From e1f35c6377491e56e2c93391e9e68f2bd180fd8f Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Fri, 1 Nov 2019 19:39:45 -0700
Subject: [PATCH] hid_linux: Use sysfs instead of libudev
---
- src/hid_linux.c | 102 ++++++++++++++++++------------------------------
- 1 file changed, 38 insertions(+), 64 deletions(-)
+ CMakeLists.txt | 2 -
+ src/hid_linux.c | 103 ++++++++++++++++++------------------------------
+ 2 files changed, 39 insertions(+), 66 deletions(-)
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9481c46..402220e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -91,8 +91,6 @@ else()
+ endif()
+
+ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
+- pkg_search_module(UDEV libudev REQUIRED)
+- set(UDEV_NAME "udev")
+ # Define be32toh().
+ add_definitions(-D_GNU_SOURCE)
+ elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
diff --git a/src/hid_linux.c b/src/hid_linux.c
-index c7cabc9..4a57e1c 100644
+index c7cabc9..db8cbc4 100644
--- a/src/hid_linux.c
+++ b/src/hid_linux.c
-@@ -9,8 +9,8 @@
+@@ -9,8 +9,9 @@
#include <sys/ioctl.h>
#include <linux/hidraw.h>
+#include <dirent.h>
#include <fcntl.h>
-#include <libudev.h>
++#include <stdio.h>
#include <string.h>
#include <unistd.h>
-@@ -147,23 +147,20 @@ is_fido(const char *path)
+@@ -147,23 +148,20 @@ is_fido(const char *path)
}
static int
@@ -52,7 +67,7 @@ index c7cabc9..4a57e1c 100644
if (strncmp(p, "HID_ID=", 7) == 0) {
if (sscanf(p + 7, "%*x:%hx:%hx", &x, &y) == 2) {
*vendor_id = (int16_t)x;
-@@ -174,50 +171,34 @@ parse_uevent(struct udev_device *dev, int16_t *vendor_id, int16_t *product_id)
+@@ -174,50 +172,34 @@ parse_uevent(struct udev_device *dev, int16_t *vendor_id, int16_t *product_id)
}
}
@@ -117,7 +132,7 @@ index c7cabc9..4a57e1c 100644
if (di->path == NULL ||
di->manufacturer == NULL ||
-@@ -226,9 +207,6 @@ copy_info(fido_dev_info_t *di, struct udev *udev,
+@@ -226,9 +208,6 @@ copy_info(fido_dev_info_t *di, struct udev *udev,
ok = 0;
fail:
@@ -127,7 +142,7 @@ index c7cabc9..4a57e1c 100644
if (ok < 0) {
free(di->path);
free(di->manufacturer);
-@@ -239,14 +217,17 @@ fail:
+@@ -239,14 +218,17 @@ fail:
return (ok);
}
@@ -150,7 +165,7 @@ index c7cabc9..4a57e1c 100644
*olen = 0;
-@@ -256,29 +237,22 @@ fido_dev_info_manifest(fido_dev_info_t *devlist, size_t ilen, size_t *olen)
+@@ -256,29 +238,22 @@ fido_dev_info_manifest(fido_dev_info_t *devlist, size_t ilen, size_t *olen)
if (devlist == NULL)
return (FIDO_ERR_INVALID_ARGUMENT);
@@ -189,5 +204,5 @@ index c7cabc9..4a57e1c 100644
}
--
-2.24.0
+2.26.0
diff --git a/pkg/libfido2/patch/0002-u2f-Use-nanosleep-instead-of-obsolete-usleep.patch b/pkg/libfido2/patch/0002-u2f-Use-nanosleep-instead-of-obsolete-usleep.patch
@@ -1,4 +1,4 @@
-From 676714b7c421195115b87b51dfa24d3522703da3 Mon Sep 17 00:00:00 2001
+From 15ed617dd5a1773e318d88dce692767571275d59 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 26 Nov 2019 13:06:58 -0800
Subject: [PATCH] u2f: Use nanosleep instead of obsolete usleep
@@ -6,14 +6,19 @@ Subject: [PATCH] u2f: Use nanosleep instead of obsolete usleep
usleep was declared obsolete in POSIX.1-2001 and removed in
POSIX.1-2008.
---
- src/u2f.c | 27 +++++++++++++++++----------
- 1 file changed, 17 insertions(+), 10 deletions(-)
+ src/u2f.c | 28 ++++++++++++++++++----------
+ 1 file changed, 18 insertions(+), 10 deletions(-)
diff --git a/src/u2f.c b/src/u2f.c
-index 3f2d9aa..22c6ac9 100644
+index 82b289f..80fd14d 100644
--- a/src/u2f.c
+++ b/src/u2f.c
-@@ -15,15 +15,22 @@
+@@ -11,19 +11,27 @@
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
+ #endif
++#include <time.h>
+
#include "fido.h"
#include "fido/es256.h"
@@ -40,7 +45,7 @@ index 3f2d9aa..22c6ac9 100644
static int
sig_get(fido_blob_t *sig, const unsigned char **buf, size_t *len)
-@@ -161,8 +168,8 @@ send_dummy_register(fido_dev_t *dev, int ms)
+@@ -161,8 +169,8 @@ send_dummy_register(fido_dev_t *dev, int ms)
r = FIDO_ERR_RX;
goto fail;
}
@@ -51,7 +56,7 @@ index 3f2d9aa..22c6ac9 100644
r = FIDO_ERR_RX;
goto fail;
}
-@@ -338,8 +345,8 @@ do_auth(fido_dev_t *dev, const fido_blob_t *cdh, const char *rp_id,
+@@ -338,8 +346,8 @@ do_auth(fido_dev_t *dev, const fido_blob_t *cdh, const char *rp_id,
r = FIDO_ERR_RX;
goto fail;
}
@@ -62,7 +67,7 @@ index 3f2d9aa..22c6ac9 100644
r = FIDO_ERR_RX;
goto fail;
}
-@@ -646,8 +653,8 @@ u2f_register(fido_dev_t *dev, fido_cred_t *cred, int ms)
+@@ -646,8 +654,8 @@ u2f_register(fido_dev_t *dev, fido_cred_t *cred, int ms)
r = FIDO_ERR_RX;
goto fail;
}
@@ -74,5 +79,5 @@ index 3f2d9aa..22c6ac9 100644
goto fail;
}
--
-2.24.0
+2.26.0
diff --git a/pkg/libfido2/patch/0004-iso7816-avoid-use-of-packed-struct.patch b/pkg/libfido2/patch/0004-iso7816-avoid-use-of-packed-struct.patch
@@ -1,4 +1,4 @@
-From 690f731a76b027e1bd4009620524e4c4810b3a28 Mon Sep 17 00:00:00 2001
+From 3af0f6e34e9fb4ac1f630b1b198fa57bfad19528 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Tue, 26 Nov 2019 18:58:05 -0800
Subject: [PATCH] iso7816: avoid use of packed struct
@@ -9,7 +9,7 @@ Subject: [PATCH] iso7816: avoid use of packed struct
2 files changed, 33 insertions(+), 39 deletions(-)
diff --git a/src/iso7816.c b/src/iso7816.c
-index a3fd280..dac5733 100644
+index a3fd280..4792443 100644
--- a/src/iso7816.c
+++ b/src/iso7816.c
@@ -7,24 +7,40 @@
@@ -41,7 +41,7 @@ index a3fd280..dac5733 100644
+ size_t max_len;
- alloc_len = sizeof(iso7816_apdu_t) + payload_len + 2; /* le1 le2 */
-+ max_len = DATA + payload_len + 2; /* le1 le2 */;
++ max_len = DATA + payload_len + 2; /* le1 le2 */
- if ((apdu = calloc(1, alloc_len)) == NULL)
+ if ((apdu = calloc(1, sizeof(*apdu) + max_len)) == NULL)
@@ -137,5 +137,5 @@ index 426cd97..fecfecc 100644
const unsigned char *iso7816_ptr(const iso7816_apdu_t *);
int iso7816_add(iso7816_apdu_t *, const void *, size_t);
--
-2.25.1
+2.26.0
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
@@ -1,4 +1,4 @@
-From fa78eaaf9629f94fbe26bc9cc1ad49d3a4afb6c8 Mon Sep 17 00:00:00 2001
+From 93cf0396ef7619635d2de1ae40a6382b2317f66f 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
@@ -78,10 +78,10 @@ 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 1512986..6db32c5 100644
+index 80fd14d..e02b611 100644
--- a/src/u2f.c
+++ b/src/u2f.c
-@@ -15,6 +15,29 @@
+@@ -16,6 +16,29 @@
#include "fido.h"
#include "fido/es256.h"
@@ -111,7 +111,7 @@ index 1512986..6db32c5 100644
static int
sleep_msec(unsigned int msec)
{
-@@ -95,23 +118,24 @@ static int
+@@ -96,23 +119,24 @@ static int
authdata_fake(const char *rp_id, uint8_t flags, uint32_t sigcount,
fido_blob_t *fake_cbor_ad)
{
@@ -143,7 +143,7 @@ index 1512986..6db32c5 100644
fido_log_debug("%s: cbor_build_bytestring", __func__);
return (-1);
}
-@@ -411,18 +435,18 @@ static int
+@@ -412,18 +436,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 +172,7 @@ index 1512986..6db32c5 100644
memset(&authdata_blob, 0, sizeof(authdata_blob));
memset(out, 0, sizeof(*out));
-@@ -436,17 +460,19 @@ encode_cred_authdata(const char *rp_id, const uint8_t *kh, uint8_t kh_len,
+@@ -437,17 +461,19 @@ encode_cred_authdata(const char *rp_id, const uint8_t *kh, uint8_t kh_len,
goto fail;
}
@@ -198,5 +198,5 @@ index 1512986..6db32c5 100644
len = authdata_blob.len = sizeof(authdata) + sizeof(attcred_raw) +
kh_len + pk_blob.len;
--
-2.25.1
+2.26.0
diff --git a/pkg/libfido2/ver b/pkg/libfido2/ver
@@ -1 +1 @@
-1.3.1 r0
+1.3.1 r1