summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-02-10 05:43:10 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-02-10 05:43:10 +0000
commit1311dcaf2254c18057fce1330c5b927f63282a82 (patch)
tree765b7b192ae9a81b9abb1bac9e899d85a0f1882b /lib
parent22e21cf760ba5bc3c9090a896b1828464943c11b (diff)
Expand the IMPLEMENT_ASN1_ALLOC_FUNCTIONS macro so that the code is visible
and functions can be readily located. Change has been scripted and the generated assembly only differs by changes to line numbers. Discussed with beck@ miod@ tedu@
Diffstat (limited to 'lib')
-rw-r--r--lib/libssl/src/crypto/ec/ec_asn1.c41
-rw-r--r--lib/libssl/src/crypto/x509v3/v3_ncons.c28
-rw-r--r--lib/libssl/src/crypto/x509v3/v3_pcons.c15
-rw-r--r--lib/libssl/src/crypto/x509v3/v3_pmaps.c15
4 files changed, 88 insertions, 11 deletions
diff --git a/lib/libssl/src/crypto/ec/ec_asn1.c b/lib/libssl/src/crypto/ec/ec_asn1.c
index 11d924d30ff..c0ef6f40e41 100644
--- a/lib/libssl/src/crypto/ec/ec_asn1.c
+++ b/lib/libssl/src/crypto/ec/ec_asn1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_asn1.c,v 1.11 2015/02/10 04:01:26 jsing Exp $ */
+/* $OpenBSD: ec_asn1.c,v 1.12 2015/02/10 05:43:09 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
@@ -205,7 +205,18 @@ ASN1_SEQUENCE(X9_62_PENTANOMIAL) = {
} ASN1_SEQUENCE_END(X9_62_PENTANOMIAL)
DECLARE_ASN1_ALLOC_FUNCTIONS(X9_62_PENTANOMIAL)
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(X9_62_PENTANOMIAL)
+
+X9_62_PENTANOMIAL *
+X9_62_PENTANOMIAL_new(void)
+{
+ return (X9_62_PENTANOMIAL*)ASN1_item_new(&X9_62_PENTANOMIAL_it);
+}
+
+void
+X9_62_PENTANOMIAL_free(X9_62_PENTANOMIAL *a)
+{
+ ASN1_item_free((ASN1_VALUE *)a, &X9_62_PENTANOMIAL_it);
+}
ASN1_ADB_TEMPLATE(char_two_def) = ASN1_SIMPLE(X9_62_CHARACTERISTIC_TWO, p.other, ASN1_ANY);
@@ -221,7 +232,18 @@ ASN1_SEQUENCE(X9_62_CHARACTERISTIC_TWO) = {
ASN1_ADB_OBJECT(X9_62_CHARACTERISTIC_TWO)
} ASN1_SEQUENCE_END(X9_62_CHARACTERISTIC_TWO)
DECLARE_ASN1_ALLOC_FUNCTIONS(X9_62_CHARACTERISTIC_TWO)
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(X9_62_CHARACTERISTIC_TWO)
+
+X9_62_CHARACTERISTIC_TWO *
+X9_62_CHARACTERISTIC_TWO_new(void)
+{
+ return (X9_62_CHARACTERISTIC_TWO*)ASN1_item_new(&X9_62_CHARACTERISTIC_TWO_it);
+}
+
+void
+X9_62_CHARACTERISTIC_TWO_free(X9_62_CHARACTERISTIC_TWO *a)
+{
+ ASN1_item_free((ASN1_VALUE *)a, &X9_62_CHARACTERISTIC_TWO_it);
+}
ASN1_ADB_TEMPLATE(fieldID_def) = ASN1_SIMPLE(X9_62_FIELDID, p.other, ASN1_ANY);
ASN1_ADB(X9_62_FIELDID) = {
@@ -249,7 +271,18 @@ ASN1_SEQUENCE(ECPARAMETERS) = {
ASN1_OPT(ECPARAMETERS, cofactor, ASN1_INTEGER)
} ASN1_SEQUENCE_END(ECPARAMETERS)
DECLARE_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS)
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(ECPARAMETERS)
+
+ECPARAMETERS *
+ECPARAMETERS_new(void)
+{
+ return (ECPARAMETERS*)ASN1_item_new(&ECPARAMETERS_it);
+}
+
+void
+ECPARAMETERS_free(ECPARAMETERS *a)
+{
+ ASN1_item_free((ASN1_VALUE *)a, &ECPARAMETERS_it);
+}
ASN1_CHOICE(ECPKPARAMETERS) = {
ASN1_SIMPLE(ECPKPARAMETERS, value.named_curve, ASN1_OBJECT),
diff --git a/lib/libssl/src/crypto/x509v3/v3_ncons.c b/lib/libssl/src/crypto/x509v3/v3_ncons.c
index 7768dabb1f8..7cb272a58f1 100644
--- a/lib/libssl/src/crypto/x509v3/v3_ncons.c
+++ b/lib/libssl/src/crypto/x509v3/v3_ncons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v3_ncons.c,v 1.5 2014/07/11 08:44:49 jsing Exp $ */
+/* $OpenBSD: v3_ncons.c,v 1.6 2015/02/10 05:43:09 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
@@ -103,8 +103,30 @@ ASN1_SEQUENCE(NAME_CONSTRAINTS) = {
} ASN1_SEQUENCE_END(NAME_CONSTRAINTS)
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(GENERAL_SUBTREE)
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(NAME_CONSTRAINTS)
+
+GENERAL_SUBTREE *
+GENERAL_SUBTREE_new(void)
+{
+ return (GENERAL_SUBTREE*)ASN1_item_new(&GENERAL_SUBTREE_it);
+}
+
+void
+GENERAL_SUBTREE_free(GENERAL_SUBTREE *a)
+{
+ ASN1_item_free((ASN1_VALUE *)a, &GENERAL_SUBTREE_it);
+}
+
+NAME_CONSTRAINTS *
+NAME_CONSTRAINTS_new(void)
+{
+ return (NAME_CONSTRAINTS*)ASN1_item_new(&NAME_CONSTRAINTS_it);
+}
+
+void
+NAME_CONSTRAINTS_free(NAME_CONSTRAINTS *a)
+{
+ ASN1_item_free((ASN1_VALUE *)a, &NAME_CONSTRAINTS_it);
+}
static void *
v2i_NAME_CONSTRAINTS(const X509V3_EXT_METHOD *method, X509V3_CTX *ctx,
diff --git a/lib/libssl/src/crypto/x509v3/v3_pcons.c b/lib/libssl/src/crypto/x509v3/v3_pcons.c
index 64e1f44b211..075efd88510 100644
--- a/lib/libssl/src/crypto/x509v3/v3_pcons.c
+++ b/lib/libssl/src/crypto/x509v3/v3_pcons.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v3_pcons.c,v 1.5 2014/07/11 08:44:49 jsing Exp $ */
+/* $OpenBSD: v3_pcons.c,v 1.6 2015/02/10 05:43:09 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
@@ -88,7 +88,18 @@ ASN1_SEQUENCE(POLICY_CONSTRAINTS) = {
ASN1_IMP_OPT(POLICY_CONSTRAINTS, inhibitPolicyMapping, ASN1_INTEGER, 1)
} ASN1_SEQUENCE_END(POLICY_CONSTRAINTS)
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(POLICY_CONSTRAINTS)
+
+POLICY_CONSTRAINTS *
+POLICY_CONSTRAINTS_new(void)
+{
+ return (POLICY_CONSTRAINTS*)ASN1_item_new(&POLICY_CONSTRAINTS_it);
+}
+
+void
+POLICY_CONSTRAINTS_free(POLICY_CONSTRAINTS *a)
+{
+ ASN1_item_free((ASN1_VALUE *)a, &POLICY_CONSTRAINTS_it);
+}
static STACK_OF(CONF_VALUE) *
i2v_POLICY_CONSTRAINTS(const X509V3_EXT_METHOD *method, void *a,
diff --git a/lib/libssl/src/crypto/x509v3/v3_pmaps.c b/lib/libssl/src/crypto/x509v3/v3_pmaps.c
index 073d03973c1..84c105892d0 100644
--- a/lib/libssl/src/crypto/x509v3/v3_pmaps.c
+++ b/lib/libssl/src/crypto/x509v3/v3_pmaps.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: v3_pmaps.c,v 1.5 2014/10/05 18:30:13 miod Exp $ */
+/* $OpenBSD: v3_pmaps.c,v 1.6 2015/02/10 05:43:09 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
@@ -90,7 +90,18 @@ ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, POLICY_MAPPINGS,
POLICY_MAPPING)
ASN1_ITEM_TEMPLATE_END(POLICY_MAPPINGS)
-IMPLEMENT_ASN1_ALLOC_FUNCTIONS(POLICY_MAPPING)
+
+POLICY_MAPPING *
+POLICY_MAPPING_new(void)
+{
+ return (POLICY_MAPPING*)ASN1_item_new(&POLICY_MAPPING_it);
+}
+
+void
+POLICY_MAPPING_free(POLICY_MAPPING *a)
+{
+ ASN1_item_free((ASN1_VALUE *)a, &POLICY_MAPPING_it);
+}
static STACK_OF(CONF_VALUE) *
i2v_POLICY_MAPPINGS(const X509V3_EXT_METHOD *method, void *a,