CVS commit: src/external/bsd/libfido2

2023-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 11 23:02:08 UTC 2023

Modified Files:
src/external/bsd/libfido2/dist/src: assert.c cred.c hid_netbsd.c
src/external/bsd/libfido2/dist/tools: util.c
src/external/bsd/libfido2/lib: Makefile
Removed Files:
src/external/bsd/libfido2/dist/openbsd-compat: hkdf.c hkdf.h

Log Message:
Merge conflicts between libfido2-1.8.0 and libfido2-1.13.0


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libfido2/dist/openbsd-compat/hkdf.c \
src/external/bsd/libfido2/dist/openbsd-compat/hkdf.h
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/dist/src/assert.c \
src/external/bsd/libfido2/dist/src/cred.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libfido2/dist/src/hid_netbsd.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libfido2/dist/tools/util.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/libfido2/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/libfido2

2023-08-11 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Aug 11 23:02:08 UTC 2023

Modified Files:
src/external/bsd/libfido2/dist/src: assert.c cred.c hid_netbsd.c
src/external/bsd/libfido2/dist/tools: util.c
src/external/bsd/libfido2/lib: Makefile
Removed Files:
src/external/bsd/libfido2/dist/openbsd-compat: hkdf.c hkdf.h

Log Message:
Merge conflicts between libfido2-1.8.0 and libfido2-1.13.0


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.1 -r0 \
src/external/bsd/libfido2/dist/openbsd-compat/hkdf.c \
src/external/bsd/libfido2/dist/openbsd-compat/hkdf.h
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/dist/src/assert.c \
src/external/bsd/libfido2/dist/src/cred.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libfido2/dist/src/hid_netbsd.c
cvs rdiff -u -r1.3 -r1.4 src/external/bsd/libfido2/dist/tools/util.c
cvs rdiff -u -r1.10 -r1.11 src/external/bsd/libfido2/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libfido2/dist/src/assert.c
diff -u src/external/bsd/libfido2/dist/src/assert.c:1.2 src/external/bsd/libfido2/dist/src/assert.c:1.3
--- src/external/bsd/libfido2/dist/src/assert.c:1.2	Mon May  8 19:45:52 2023
+++ src/external/bsd/libfido2/dist/src/assert.c	Fri Aug 11 19:02:08 2023
@@ -1,10 +1,10 @@
 /*
- * Copyright (c) 2018-2021 Yubico AB. All rights reserved.
+ * Copyright (c) 2018-2022 Yubico AB. All rights reserved.
  * Use of this source code is governed by a BSD-style
  * license that can be found in the LICENSE file.
+ * SPDX-License-Identifier: BSD-2-Clause
  */
 
-#include 
 #include 
 
 #include "fido.h"
@@ -79,7 +79,7 @@ parse_assert_reply(const cbor_item_t *ke
 
 static int
 fido_dev_get_assert_tx(fido_dev_t *dev, fido_assert_t *assert,
-const es256_pk_t *pk, const fido_blob_t *ecdh, const char *pin)
+const es256_pk_t *pk, const fido_blob_t *ecdh, const char *pin, int *ms)
 {
 	fido_blob_t	 f;
 	fido_opt_t	 uv = assert->uv;
@@ -127,7 +127,7 @@ fido_dev_get_assert_tx(fido_dev_t *dev, 
 	if (pin != NULL || (uv == FIDO_OPT_TRUE &&
 	fido_dev_supports_permissions(dev))) {
 		if ((r = cbor_add_uv_params(dev, cmd, &assert->cdh, pk, ecdh,
-		pin, assert->rp_id, &argv[5], &argv[6])) != FIDO_OK) {
+		pin, assert->rp_id, &argv[5], &argv[6], ms)) != FIDO_OK) {
 			fido_log_debug("%s: cbor_add_uv_params", __func__);
 			goto fail;
 		}
@@ -144,7 +144,7 @@ fido_dev_get_assert_tx(fido_dev_t *dev, 
 
 	/* frame and transmit */
 	if (cbor_build_frame(cmd, argv, nitems(argv), &f) < 0 ||
-	fido_tx(dev, CTAP_CMD_CBOR, f.ptr, f.len) < 0) {
+	fido_tx(dev, CTAP_CMD_CBOR, f.ptr, f.len, ms) < 0) {
 		fido_log_debug("%s: fido_tx", __func__);
 		r = FIDO_ERR_TX;
 		goto fail;
@@ -159,52 +159,61 @@ fail:
 }
 
 static int
-fido_dev_get_assert_rx(fido_dev_t *dev, fido_assert_t *assert, int ms)
+fido_dev_get_assert_rx(fido_dev_t *dev, fido_assert_t *assert, int *ms)
 {
-	unsigned char	reply[FIDO_MAXMSG];
-	int		reply_len;
-	int		r;
+	unsigned char	*msg;
+	int		 msglen;
+	int		 r;
 
 	fido_assert_reset_rx(assert);
 
-	if ((reply_len = fido_rx(dev, CTAP_CMD_CBOR, &reply, sizeof(reply),
-	ms)) < 0) {
+	if ((msg = malloc(FIDO_MAXMSG)) == NULL) {
+		r = FIDO_ERR_INTERNAL;
+		goto out;
+	}
+
+	if ((msglen = fido_rx(dev, CTAP_CMD_CBOR, msg, FIDO_MAXMSG, ms)) < 0) {
 		fido_log_debug("%s: fido_rx", __func__);
-		return (FIDO_ERR_RX);
+		r = FIDO_ERR_RX;
+		goto out;
 	}
 
 	/* start with room for a single assertion */
-	if ((assert->stmt = calloc(1, sizeof(fido_assert_stmt))) == NULL)
-		return (FIDO_ERR_INTERNAL);
-
+	if ((assert->stmt = calloc(1, sizeof(fido_assert_stmt))) == NULL) {
+		r = FIDO_ERR_INTERNAL;
+		goto out;
+	}
 	assert->stmt_len = 0;
 	assert->stmt_cnt = 1;
 
 	/* adjust as needed */
-	if ((r = cbor_parse_reply(reply, (size_t)reply_len, assert,
+	if ((r = cbor_parse_reply(msg, (size_t)msglen, assert,
 	adjust_assert_count)) != FIDO_OK) {
 		fido_log_debug("%s: adjust_assert_count", __func__);
-		return (r);
+		goto out;
 	}
 
 	/* parse the first assertion */
-	if ((r = cbor_parse_reply(reply, (size_t)reply_len,
-	&assert->stmt[assert->stmt_len], parse_assert_reply)) != FIDO_OK) {
+	if ((r = cbor_parse_reply(msg, (size_t)msglen, &assert->stmt[0],
+	parse_assert_reply)) != FIDO_OK) {
 		fido_log_debug("%s: parse_assert_reply", __func__);
-		return (r);
+		goto out;
 	}
+	assert->stmt_len = 1;
 
-	assert->stmt_len++;
+	r = FIDO_OK;
+out:
+	freezero(msg, FIDO_MAXMSG);
 
-	return (FIDO_OK);
+	return (r);
 }
 
 static int
-fido_get_next_assert_tx(fido_dev_t *dev)
+fido_get_next_assert_tx(fido_dev_t *dev, int *ms)
 {
 	const unsigned char cbor[] = { CTAP_CBOR_NEXT_ASSERT };
 
-	if (fido_tx(dev, CTAP_CMD_CBOR, cbor, sizeof(cbor)) < 0) {
+	if (fido_tx(dev, CTAP_CMD_CBOR, cbor, sizeof(cbor), ms) < 0) {
 		fido_log_debug("%s: fido_tx", __func__);
 		return (FIDO_ERR_TX);
 	}
@@ -213,46 +222,57 @@ fido_ge

CVS commit: src/external/bsd/libfido2/lib

2023-05-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 13 13:04:04 UTC 2023

Modified Files:
src/external/bsd/libfido2/lib: Makefile

Log Message:
libfido2: Needs -Wno-error=pointer-sign on arm.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/libfido2/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libfido2/lib/Makefile
diff -u src/external/bsd/libfido2/lib/Makefile:1.9 src/external/bsd/libfido2/lib/Makefile:1.10
--- src/external/bsd/libfido2/lib/Makefile:1.9	Mon May  8 23:45:52 2023
+++ src/external/bsd/libfido2/lib/Makefile	Sat May 13 13:04:03 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.9 2023/05/08 23:45:52 christos Exp $
+# $NetBSD: Makefile,v 1.10 2023/05/13 13:04:03 riastradh Exp $
 
 NOLINT=
 .include 
@@ -116,6 +116,7 @@ COPTS.assert.c+=-Wno-error=deprecated-de
 COPTS.cbor.c+=-Wno-error=deprecated-declarations
 COPTS.cred.c+=-Wno-error=deprecated-declarations
 COPTS.ecdh.c+=-Wno-error=deprecated-declarations
+COPTS.ecdh.c+=-Wno-error=pointer-sign
 COPTS.es256.c+=-Wno-error=deprecated-declarations
 COPTS.rs256.c+=-Wno-error=deprecated-declarations
 



CVS commit: src/external/bsd/libfido2/lib

2023-05-13 Thread Taylor R Campbell
Module Name:src
Committed By:   riastradh
Date:   Sat May 13 13:04:04 UTC 2023

Modified Files:
src/external/bsd/libfido2/lib: Makefile

Log Message:
libfido2: Needs -Wno-error=pointer-sign on arm.


To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/external/bsd/libfido2/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/libfido2

2023-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May  8 23:45:52 UTC 2023

Modified Files:
src/external/bsd/libfido2/bin/fido2-assert: Makefile
src/external/bsd/libfido2/bin/fido2-cred: Makefile
src/external/bsd/libfido2/bin/fido2-token: Makefile
src/external/bsd/libfido2/dist/src: assert.c cred.c
src/external/bsd/libfido2/lib: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/bin/fido2-assert/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/bin/fido2-cred/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/bin/fido2-token/Makefile
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/libfido2/dist/src/assert.c \
src/external/bsd/libfido2/dist/src/cred.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/libfido2/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libfido2/bin/fido2-assert/Makefile
diff -u src/external/bsd/libfido2/bin/fido2-assert/Makefile:1.2 src/external/bsd/libfido2/bin/fido2-assert/Makefile:1.3
--- src/external/bsd/libfido2/bin/fido2-assert/Makefile:1.2	Wed Jun 16 21:15:44 2021
+++ src/external/bsd/libfido2/bin/fido2-assert/Makefile	Mon May  8 19:45:52 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2021/06/17 01:15:44 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2023/05/08 23:45:52 christos Exp $
 
 .include 
 
@@ -24,4 +24,7 @@ freezero.c \
 readpassphrase.c \
 recallocarray.c
 
+COPTS.assert_verify.c+=-Wno-error=deprecated-declarations
+COPTS.util.c+=-Wno-error=deprecated-declarations
+
 .include 

Index: src/external/bsd/libfido2/bin/fido2-cred/Makefile
diff -u src/external/bsd/libfido2/bin/fido2-cred/Makefile:1.2 src/external/bsd/libfido2/bin/fido2-cred/Makefile:1.3
--- src/external/bsd/libfido2/bin/fido2-cred/Makefile:1.2	Wed Jun 16 21:15:44 2021
+++ src/external/bsd/libfido2/bin/fido2-cred/Makefile	Mon May  8 19:45:52 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2021/06/17 01:15:44 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2023/05/08 23:45:52 christos Exp $
 
 .include 
 
@@ -24,4 +24,6 @@ freezero.c \
 readpassphrase.c \
 recallocarray.c
 
+COPTS.util.c+=-Wno-error=deprecated-declarations
+
 .include 

Index: src/external/bsd/libfido2/bin/fido2-token/Makefile
diff -u src/external/bsd/libfido2/bin/fido2-token/Makefile:1.2 src/external/bsd/libfido2/bin/fido2-token/Makefile:1.3
--- src/external/bsd/libfido2/bin/fido2-token/Makefile:1.2	Wed Jun 16 21:15:44 2021
+++ src/external/bsd/libfido2/bin/fido2-token/Makefile	Mon May  8 19:45:52 2023
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.2 2021/06/17 01:15:44 christos Exp $
+#	$NetBSD: Makefile,v 1.3 2023/05/08 23:45:52 christos Exp $
 
 .include 
 
@@ -22,4 +22,6 @@ freezero.c \
 readpassphrase.c \
 recallocarray.c
 
+COPTS.util.c+=-Wno-error=deprecated-declarations
+
 .include 

Index: src/external/bsd/libfido2/dist/src/assert.c
diff -u src/external/bsd/libfido2/dist/src/assert.c:1.1.1.4 src/external/bsd/libfido2/dist/src/assert.c:1.2
--- src/external/bsd/libfido2/dist/src/assert.c:1.1.1.4	Fri Sep 24 08:43:29 2021
+++ src/external/bsd/libfido2/dist/src/assert.c	Mon May  8 19:45:52 2023
@@ -430,7 +430,7 @@ fido_verify_sig_es256(const fido_blob_t 
 	}
 
 	if ((pkey = es256_pk_to_EVP_PKEY(pk)) == NULL ||
-	(ec = EVP_PKEY_get0_EC_KEY(pkey)) == NULL) {
+	(ec = __UNCONST(EVP_PKEY_get0_EC_KEY(pkey))) == NULL) {
 		fido_log_debug("%s: pk -> ec", __func__);
 		goto fail;
 	}
@@ -465,7 +465,7 @@ fido_verify_sig_rs256(const fido_blob_t 
 	}
 
 	if ((pkey = rs256_pk_to_EVP_PKEY(pk)) == NULL ||
-	(rsa = EVP_PKEY_get0_RSA(pkey)) == NULL) {
+	(rsa = __UNCONST(EVP_PKEY_get0_RSA(pkey))) == NULL) {
 		fido_log_debug("%s: pk -> ec", __func__);
 		goto fail;
 	}
Index: src/external/bsd/libfido2/dist/src/cred.c
diff -u src/external/bsd/libfido2/dist/src/cred.c:1.1.1.4 src/external/bsd/libfido2/dist/src/cred.c:1.2
--- src/external/bsd/libfido2/dist/src/cred.c:1.1.1.4	Fri Sep 24 08:43:29 2021
+++ src/external/bsd/libfido2/dist/src/cred.c	Mon May  8 19:45:52 2023
@@ -266,7 +266,7 @@ verify_sig(const fido_blob_t *dgst, cons
 	if ((rawcert = BIO_new_mem_buf(x5c->ptr, (int)x5c->len)) == NULL ||
 	(cert = d2i_X509_bio(rawcert, NULL)) == NULL ||
 	(pkey = X509_get_pubkey(cert)) == NULL ||
-	(ec = EVP_PKEY_get0_EC_KEY(pkey)) == NULL) {
+	(ec = __UNCONST(EVP_PKEY_get0_EC_KEY(pkey))) == NULL) {
 		fido_log_debug("%s: x509 key", __func__);
 		goto fail;
 	}

Index: src/external/bsd/libfido2/lib/Makefile
diff -u src/external/bsd/libfido2/lib/Makefile:1.8 src/external/bsd/libfido2/lib/Makefile:1.9
--- src/external/bsd/libfido2/lib/Makefile:1.8	Fri Sep 24 09:07:34 2021
+++ src/external/bsd/libfido2/lib/Makefile	Mon May  8 19:45:52 2023
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.8 2021/09/24 13:07:34 christos Exp $
+# $NetBSD: Makefile,v 1.9 2023/05/08 23:45:52 christos Exp $
 
 NOLINT=
 .in

CVS commit: src/external/bsd/libfido2

2023-05-08 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Mon May  8 23:45:52 UTC 2023

Modified Files:
src/external/bsd/libfido2/bin/fido2-assert: Makefile
src/external/bsd/libfido2/bin/fido2-cred: Makefile
src/external/bsd/libfido2/bin/fido2-token: Makefile
src/external/bsd/libfido2/dist/src: assert.c cred.c
src/external/bsd/libfido2/lib: Makefile

Log Message:
Handle OpenSSL-3.x


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/bin/fido2-assert/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/bin/fido2-cred/Makefile
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/bin/fido2-token/Makefile
cvs rdiff -u -r1.1.1.4 -r1.2 src/external/bsd/libfido2/dist/src/assert.c \
src/external/bsd/libfido2/dist/src/cred.c
cvs rdiff -u -r1.8 -r1.9 src/external/bsd/libfido2/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/external/bsd/libfido2

2021-09-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 24 13:07:34 UTC 2021

Modified Files:
src/external/bsd/libfido2/dist/tools: util.c
src/external/bsd/libfido2/lib: Makefile

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/dist/tools/util.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/libfido2/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/libfido2/dist/tools/util.c
diff -u src/external/bsd/libfido2/dist/tools/util.c:1.2 src/external/bsd/libfido2/dist/tools/util.c:1.3
--- src/external/bsd/libfido2/dist/tools/util.c:1.2	Wed Jun 16 21:15:46 2021
+++ src/external/bsd/libfido2/dist/tools/util.c	Fri Sep 24 09:07:34 2021
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Yubico AB. All rights reserved.
+ * Copyright (c) 2018-2021 Yubico AB. All rights reserved.
  * Use of this source code is governed by a BSD-style
  * license that can be found in the LICENSE file.
  */
@@ -576,6 +576,17 @@ plural(size_t x)
 int
 should_retry_with_pin(const fido_dev_t *dev, int r)
 {
-	return fido_dev_has_pin(dev) && (r == FIDO_ERR_PIN_REQUIRED ||
-	r == FIDO_ERR_UV_INVALID || r == FIDO_ERR_UNAUTHORIZED_PERM);
+	if (fido_dev_has_pin(dev) == false) {
+		return 0;
+	}
+
+	switch (r) {
+	case FIDO_ERR_PIN_REQUIRED:
+	case FIDO_ERR_UNAUTHORIZED_PERM:
+	case FIDO_ERR_UV_BLOCKED:
+	case FIDO_ERR_UV_INVALID:
+		return 1;
+	}
+
+	return 0;
 }

Index: src/external/bsd/libfido2/lib/Makefile
diff -u src/external/bsd/libfido2/lib/Makefile:1.7 src/external/bsd/libfido2/lib/Makefile:1.8
--- src/external/bsd/libfido2/lib/Makefile:1.7	Fri Jun 18 09:57:52 2021
+++ src/external/bsd/libfido2/lib/Makefile	Fri Sep 24 09:07:34 2021
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.7 2021/06/18 13:57:52 christos Exp $
+# $NetBSD: Makefile,v 1.8 2021/09/24 13:07:34 christos Exp $
 
 NOLINT=
 .include 
@@ -96,7 +96,7 @@ fido_init.3 \
 fido_strerr.3 \
 rs256_pk_new.3
 
-SHLIB_MAJOR=3
+SHLIB_MAJOR=4
 SHLIB_MINOR=0
 
 .SUFFIXES: .in



CVS commit: src/external/bsd/libfido2

2021-09-24 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep 24 13:07:34 UTC 2021

Modified Files:
src/external/bsd/libfido2/dist/tools: util.c
src/external/bsd/libfido2/lib: Makefile

Log Message:
merge conflicts


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/libfido2/dist/tools/util.c
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/libfido2/lib/Makefile

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.