From 850d74aaf22e3da17aaf016d44c7e064e69b1fa2 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 25 Jul 2015 17:07:17 +0000 Subject: Manually expand ASN.1 template macros - only change in generated assembly is due to line numbering. --- src/lib/libcrypto/asn1/tasn_utl.c | 4 ++-- src/lib/libcrypto/asn1/x_bignum.c | 26 +++++++++++++++++++------- src/lib/libcrypto/asn1/x_long.c | 26 +++++++++++++++++++------- src/lib/libssl/src/crypto/asn1/tasn_utl.c | 4 ++-- src/lib/libssl/src/crypto/asn1/x_bignum.c | 26 +++++++++++++++++++------- src/lib/libssl/src/crypto/asn1/x_long.c | 26 +++++++++++++++++++------- 6 files changed, 80 insertions(+), 32 deletions(-) diff --git a/src/lib/libcrypto/asn1/tasn_utl.c b/src/lib/libcrypto/asn1/tasn_utl.c index 8e242e8810..529aaf6116 100644 --- a/src/lib/libcrypto/asn1/tasn_utl.c +++ b/src/lib/libcrypto/asn1/tasn_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_utl.c,v 1.10 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: tasn_utl.c,v 1.11 2015/07/25 17:07:17 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -232,7 +232,7 @@ asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr) return tt; /* Else ANY DEFINED BY ... get the table */ - adb = ASN1_ADB_ptr(tt->item); + adb = (const ASN1_ADB *)tt->item; /* Get the selector field */ sfld = offset2ptr(*pval, adb->offset); diff --git a/src/lib/libcrypto/asn1/x_bignum.c b/src/lib/libcrypto/asn1/x_bignum.c index dafe9b3016..73f0f73c1c 100644 --- a/src/lib/libcrypto/asn1/x_bignum.c +++ b/src/lib/libcrypto/asn1/x_bignum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_bignum.c,v 1.7 2014/07/12 16:42:47 miod Exp $ */ +/* $OpenBSD: x_bignum.c,v 1.8 2015/07/25 17:07:17 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -86,13 +86,25 @@ static ASN1_PRIMITIVE_FUNCS bignum_pf = { bn_i2c }; -ASN1_ITEM_start(BIGNUM) -ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM" -ASN1_ITEM_end(BIGNUM) +const ASN1_ITEM BIGNUM_it = { + .itype = ASN1_ITYPE_PRIMITIVE, + .utype = V_ASN1_INTEGER, + .templates = NULL, + .tcount = 0, + .funcs = &bignum_pf, + .size = 0, + .sname = "BIGNUM", +}; -ASN1_ITEM_start(CBIGNUM) -ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM" -ASN1_ITEM_end(CBIGNUM) +const ASN1_ITEM CBIGNUM_it = { + .itype = ASN1_ITYPE_PRIMITIVE, + .utype = V_ASN1_INTEGER, + .templates = NULL, + .tcount = 0, + .funcs = &bignum_pf, + .size = 0, + .sname = "BIGNUM", +}; static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it) diff --git a/src/lib/libcrypto/asn1/x_long.c b/src/lib/libcrypto/asn1/x_long.c index 1add387453..90a41129bc 100644 --- a/src/lib/libcrypto/asn1/x_long.c +++ b/src/lib/libcrypto/asn1/x_long.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_long.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: x_long.c,v 1.10 2015/07/25 17:07:17 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -85,13 +85,25 @@ static ASN1_PRIMITIVE_FUNCS long_pf = { long_print }; -ASN1_ITEM_start(LONG) -ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, ASN1_LONG_UNDEF, "LONG" -ASN1_ITEM_end(LONG) +const ASN1_ITEM LONG_it = { + .itype = ASN1_ITYPE_PRIMITIVE, + .utype = V_ASN1_INTEGER, + .templates = NULL, + .tcount = 0, + .funcs = &long_pf, + .size = ASN1_LONG_UNDEF, + .sname = "LONG", +}; -ASN1_ITEM_start(ZLONG) -ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, 0, "ZLONG" -ASN1_ITEM_end(ZLONG) +const ASN1_ITEM ZLONG_it = { + .itype = ASN1_ITYPE_PRIMITIVE, + .utype = V_ASN1_INTEGER, + .templates = NULL, + .tcount = 0, + .funcs = &long_pf, + .size = 0, + .sname = "ZLONG", +}; static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it) diff --git a/src/lib/libssl/src/crypto/asn1/tasn_utl.c b/src/lib/libssl/src/crypto/asn1/tasn_utl.c index 8e242e8810..529aaf6116 100644 --- a/src/lib/libssl/src/crypto/asn1/tasn_utl.c +++ b/src/lib/libssl/src/crypto/asn1/tasn_utl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_utl.c,v 1.10 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: tasn_utl.c,v 1.11 2015/07/25 17:07:17 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -232,7 +232,7 @@ asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, int nullerr) return tt; /* Else ANY DEFINED BY ... get the table */ - adb = ASN1_ADB_ptr(tt->item); + adb = (const ASN1_ADB *)tt->item; /* Get the selector field */ sfld = offset2ptr(*pval, adb->offset); diff --git a/src/lib/libssl/src/crypto/asn1/x_bignum.c b/src/lib/libssl/src/crypto/asn1/x_bignum.c index dafe9b3016..73f0f73c1c 100644 --- a/src/lib/libssl/src/crypto/asn1/x_bignum.c +++ b/src/lib/libssl/src/crypto/asn1/x_bignum.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_bignum.c,v 1.7 2014/07/12 16:42:47 miod Exp $ */ +/* $OpenBSD: x_bignum.c,v 1.8 2015/07/25 17:07:17 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -86,13 +86,25 @@ static ASN1_PRIMITIVE_FUNCS bignum_pf = { bn_i2c }; -ASN1_ITEM_start(BIGNUM) -ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM" -ASN1_ITEM_end(BIGNUM) +const ASN1_ITEM BIGNUM_it = { + .itype = ASN1_ITYPE_PRIMITIVE, + .utype = V_ASN1_INTEGER, + .templates = NULL, + .tcount = 0, + .funcs = &bignum_pf, + .size = 0, + .sname = "BIGNUM", +}; -ASN1_ITEM_start(CBIGNUM) -ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &bignum_pf, 0, "BIGNUM" -ASN1_ITEM_end(CBIGNUM) +const ASN1_ITEM CBIGNUM_it = { + .itype = ASN1_ITYPE_PRIMITIVE, + .utype = V_ASN1_INTEGER, + .templates = NULL, + .tcount = 0, + .funcs = &bignum_pf, + .size = 0, + .sname = "BIGNUM", +}; static int bn_new(ASN1_VALUE **pval, const ASN1_ITEM *it) diff --git a/src/lib/libssl/src/crypto/asn1/x_long.c b/src/lib/libssl/src/crypto/asn1/x_long.c index 1add387453..90a41129bc 100644 --- a/src/lib/libssl/src/crypto/asn1/x_long.c +++ b/src/lib/libssl/src/crypto/asn1/x_long.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_long.c,v 1.9 2014/07/11 08:44:47 jsing Exp $ */ +/* $OpenBSD: x_long.c,v 1.10 2015/07/25 17:07:17 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -85,13 +85,25 @@ static ASN1_PRIMITIVE_FUNCS long_pf = { long_print }; -ASN1_ITEM_start(LONG) -ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, ASN1_LONG_UNDEF, "LONG" -ASN1_ITEM_end(LONG) +const ASN1_ITEM LONG_it = { + .itype = ASN1_ITYPE_PRIMITIVE, + .utype = V_ASN1_INTEGER, + .templates = NULL, + .tcount = 0, + .funcs = &long_pf, + .size = ASN1_LONG_UNDEF, + .sname = "LONG", +}; -ASN1_ITEM_start(ZLONG) -ASN1_ITYPE_PRIMITIVE, V_ASN1_INTEGER, NULL, 0, &long_pf, 0, "ZLONG" -ASN1_ITEM_end(ZLONG) +const ASN1_ITEM ZLONG_it = { + .itype = ASN1_ITYPE_PRIMITIVE, + .utype = V_ASN1_INTEGER, + .templates = NULL, + .tcount = 0, + .funcs = &long_pf, + .size = 0, + .sname = "ZLONG", +}; static int long_new(ASN1_VALUE **pval, const ASN1_ITEM *it) -- cgit v1.2.3-55-g6feb