summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/crypto/stack/safestack.h
diff options
context:
space:
mode:
authormiod <miod@openbsd.org>2014-04-18 17:32:31 +0000
committermiod <miod@openbsd.org>2014-04-18 17:32:31 +0000
commit01f177b5714f48f00a61bd29d12356943dab1858 (patch)
treeace71e42269115a66c8b43cd92ab6c27fb98ba8b /lib/libssl/src/crypto/stack/safestack.h
parentRAND_xxx considered harmful. use arc4random_buf instead of nasty stuff. (diff)
downloadwireguard-openbsd-01f177b5714f48f00a61bd29d12356943dab1858.tar.xz
wireguard-openbsd-01f177b5714f48f00a61bd29d12356943dab1858.zip
Put back i2d_ASN1_SET() and d2i_ASN1_SET() from the NO_ASN1_OLD prune, as there
are still some 3rd-party code using it, and fixing them is not trivial. As an excuse gift, the memory leaks on failure in resurrected a_set.c have been fixed.
Diffstat (limited to 'lib/libssl/src/crypto/stack/safestack.h')
-rw-r--r--lib/libssl/src/crypto/stack/safestack.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/libssl/src/crypto/stack/safestack.h b/lib/libssl/src/crypto/stack/safestack.h
index 56978a2b012..f2a36fd64b8 100644
--- a/lib/libssl/src/crypto/stack/safestack.h
+++ b/lib/libssl/src/crypto/stack/safestack.h
@@ -178,6 +178,19 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
#define SKM_sk_is_sorted(type, st) \
sk_is_sorted(CHECKED_STACK_OF(type, st))
+#define SKM_ASN1_SET_OF_d2i(type, st, pp, length, d2i_func, free_func, ex_tag, ex_class) \
+ (STACK_OF(type) *)d2i_ASN1_SET( \
+ (STACK_OF(OPENSSL_BLOCK) **)CHECKED_PTR_OF(STACK_OF(type)*, st), \
+ pp, length, \
+ CHECKED_D2I_OF(type, d2i_func), \
+ CHECKED_SK_FREE_FUNC(type, free_func), \
+ ex_tag, ex_class)
+
+#define SKM_ASN1_SET_OF_i2d(type, st, pp, i2d_func, ex_tag, ex_class, is_set) \
+ i2d_ASN1_SET((STACK_OF(OPENSSL_BLOCK) *)CHECKED_STACK_OF(type, st), pp, \
+ CHECKED_I2D_OF(type, i2d_func), \
+ ex_tag, ex_class, is_set)
+
#define SKM_PKCS12_decrypt_d2i(type, algor, d2i_func, free_func, pass, passlen, oct, seq) \
(STACK_OF(type) *)PKCS12_decrypt_d2i(algor, \
CHECKED_D2I_OF(type, d2i_func), \