summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2021-12-23 18:04:41 +0000
committertb <>2021-12-23 18:04:41 +0000
commitab870b7b7e53ba5032a9c09b428c4e5db8e132f2 (patch)
treed96db256933af6b6f96fe9db83a19e015e4c4621
parent43709257576d39a639820e0d72bd5acbe0c01027 (diff)
downloadopenbsd-ab870b7b7e53ba5032a9c09b428c4e5db8e132f2.tar.gz
openbsd-ab870b7b7e53ba5032a9c09b428c4e5db8e132f2.tar.bz2
openbsd-ab870b7b7e53ba5032a9c09b428c4e5db8e132f2.zip
Route templated implementations of {d2i,i2d}_ASN1_BOOLEAN() through
ASN1_item_ex_{d2i,i2d}() instead of ASN1_item_{d2i,i2d}(). Fixes test failure on sparc64, and hopefully all other architectures. reported by tobhe with/ok jsing
-rw-r--r--src/lib/libcrypto/asn1/tasn_typ.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libcrypto/asn1/tasn_typ.c b/src/lib/libcrypto/asn1/tasn_typ.c
index 060ea27fb9..7a2b90f390 100644
--- a/src/lib/libcrypto/asn1/tasn_typ.c
+++ b/src/lib/libcrypto/asn1/tasn_typ.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tasn_typ.c,v 1.14 2021/12/13 17:56:15 jsing Exp $ */ 1/* $OpenBSD: tasn_typ.c,v 1.15 2021/12/23 18:04:41 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -715,7 +715,8 @@ const ASN1_ITEM ASN1_BOOLEAN_it = {
715int 715int
716i2d_ASN1_BOOLEAN(int a, unsigned char **out) 716i2d_ASN1_BOOLEAN(int a, unsigned char **out)
717{ 717{
718 return ASN1_item_i2d((ASN1_VALUE *)(long)(a), out, &ASN1_BOOLEAN_it); 718 return ASN1_item_ex_i2d((ASN1_VALUE **)(long *)(&a), out,
719 &ASN1_BOOLEAN_it, -1, 0);
719} 720}
720 721
721int 722int
@@ -723,7 +724,8 @@ d2i_ASN1_BOOLEAN(int *a, const unsigned char **in, long len)
723{ 724{
724 ASN1_BOOLEAN abool; 725 ASN1_BOOLEAN abool;
725 726
726 if (ASN1_item_d2i((ASN1_VALUE **)&abool, in, len, &ASN1_BOOLEAN_it) == NULL) 727 if (ASN1_item_ex_d2i((ASN1_VALUE **)&abool, in, len, &ASN1_BOOLEAN_it,
728 -1, 0, 0, NULL) <= 0)
727 return -1; 729 return -1;
728 730
729 if (a != NULL) 731 if (a != NULL)