diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2015-02-10 04:21:51 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2015-02-10 04:21:51 +0000 |
commit | dd07bcb383a3c8648e2d353c200999537adb1076 (patch) | |
tree | c052370c1f5e046df4da70e989f9a7cd1ef93600 /lib | |
parent | 7fc0f9ee39dfdb1e0afacd8f4c9d2741fa79bce5 (diff) |
Expand the IMPLEMENT_ASN1_DUP_FUNCTION 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/asn1/x_algor.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/crypto/asn1/x_attrib.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/crypto/asn1/x_crl.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/crypto/asn1/x_exten.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/crypto/asn1/x_name.c | 16 | ||||
-rw-r--r-- | lib/libssl/src/crypto/asn1/x_req.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/crypto/asn1/x_x509.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/crypto/ocsp/ocsp_lib.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/crypto/pkcs7/pk7_asn1.c | 9 | ||||
-rw-r--r-- | lib/libssl/src/crypto/ts/ts_asn1.c | 65 |
10 files changed, 124 insertions, 29 deletions
diff --git a/lib/libssl/src/crypto/asn1/x_algor.c b/lib/libssl/src/crypto/asn1/x_algor.c index 7d264f9fd3a..63c4e028a6d 100644 --- a/lib/libssl/src/crypto/asn1/x_algor.c +++ b/lib/libssl/src/crypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.14 2015/02/09 15:05:59 jsing Exp $ */ +/* $OpenBSD: x_algor.c,v 1.15 2015/02/10 04:21:50 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -96,7 +96,12 @@ X509_ALGOR_free(X509_ALGOR *a) ASN1_item_free((ASN1_VALUE *)a, &X509_ALGOR_it); } IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_ALGORS, X509_ALGORS, X509_ALGORS) -IMPLEMENT_ASN1_DUP_FUNCTION(X509_ALGOR) + +X509_ALGOR * +X509_ALGOR_dup(X509_ALGOR *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(X509_ALGOR), x); +} IMPLEMENT_STACK_OF(X509_ALGOR) IMPLEMENT_ASN1_SET_OF(X509_ALGOR) diff --git a/lib/libssl/src/crypto/asn1/x_attrib.c b/lib/libssl/src/crypto/asn1/x_attrib.c index aafd5dd4851..4306bd6240b 100644 --- a/lib/libssl/src/crypto/asn1/x_attrib.c +++ b/lib/libssl/src/crypto/asn1/x_attrib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_attrib.c,v 1.10 2015/02/09 15:05:59 jsing Exp $ */ +/* $OpenBSD: x_attrib.c,v 1.11 2015/02/10 04:21:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -118,7 +118,12 @@ X509_ATTRIBUTE_free(X509_ATTRIBUTE *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_ATTRIBUTE_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(X509_ATTRIBUTE) + +X509_ATTRIBUTE * +X509_ATTRIBUTE_dup(X509_ATTRIBUTE *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(X509_ATTRIBUTE), x); +} X509_ATTRIBUTE * X509_ATTRIBUTE_create(int nid, int atrtype, void *value) diff --git a/lib/libssl/src/crypto/asn1/x_crl.c b/lib/libssl/src/crypto/asn1/x_crl.c index 2539fd92c40..9919d576e40 100644 --- a/lib/libssl/src/crypto/asn1/x_crl.c +++ b/lib/libssl/src/crypto/asn1/x_crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_crl.c,v 1.19 2015/02/09 15:05:59 jsing Exp $ */ +/* $OpenBSD: x_crl.c,v 1.20 2015/02/10 04:21:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -412,7 +412,12 @@ X509_CRL_free(X509_CRL *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_CRL_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(X509_CRL) + +X509_CRL * +X509_CRL_dup(X509_CRL *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(X509_CRL), x); +} static int X509_REVOKED_cmp(const X509_REVOKED * const *a, const X509_REVOKED * const *b) diff --git a/lib/libssl/src/crypto/asn1/x_exten.c b/lib/libssl/src/crypto/asn1/x_exten.c index 40c521ec800..ad26a9e8518 100644 --- a/lib/libssl/src/crypto/asn1/x_exten.c +++ b/lib/libssl/src/crypto/asn1/x_exten.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_exten.c,v 1.10 2015/02/09 15:05:59 jsing Exp $ */ +/* $OpenBSD: x_exten.c,v 1.11 2015/02/10 04:21:50 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -97,4 +97,9 @@ X509_EXTENSION_free(X509_EXTENSION *a) ASN1_item_free((ASN1_VALUE *)a, &X509_EXTENSION_it); } IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(X509_EXTENSIONS, X509_EXTENSIONS, X509_EXTENSIONS) -IMPLEMENT_ASN1_DUP_FUNCTION(X509_EXTENSION) + +X509_EXTENSION * +X509_EXTENSION_dup(X509_EXTENSION *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(X509_EXTENSION), x); +} diff --git a/lib/libssl/src/crypto/asn1/x_name.c b/lib/libssl/src/crypto/asn1/x_name.c index a7f0e14d130..d77702e4732 100644 --- a/lib/libssl/src/crypto/asn1/x_name.c +++ b/lib/libssl/src/crypto/asn1/x_name.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_name.c,v 1.21 2015/02/09 15:05:59 jsing Exp $ */ +/* $OpenBSD: x_name.c,v 1.22 2015/02/10 04:21:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -117,7 +117,12 @@ X509_NAME_ENTRY_free(X509_NAME_ENTRY *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_ENTRY_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME_ENTRY) + +X509_NAME_ENTRY * +X509_NAME_ENTRY_dup(X509_NAME_ENTRY *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(X509_NAME_ENTRY), x); +} /* For the "Name" type we need a SEQUENCE OF { SET OF X509_NAME_ENTRY } * so declare two template wrappers for this @@ -174,7 +179,12 @@ X509_NAME_free(X509_NAME *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_NAME_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(X509_NAME) + +X509_NAME * +X509_NAME_dup(X509_NAME *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(X509_NAME), x); +} static int x509_name_ex_new(ASN1_VALUE **val, const ASN1_ITEM *it) diff --git a/lib/libssl/src/crypto/asn1/x_req.c b/lib/libssl/src/crypto/asn1/x_req.c index 89b2d88d156..42c7adb2982 100644 --- a/lib/libssl/src/crypto/asn1/x_req.c +++ b/lib/libssl/src/crypto/asn1/x_req.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_req.c,v 1.11 2015/02/09 15:05:59 jsing Exp $ */ +/* $OpenBSD: x_req.c,v 1.12 2015/02/10 04:21:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -159,4 +159,9 @@ X509_REQ_free(X509_REQ *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_REQ_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(X509_REQ) + +X509_REQ * +X509_REQ_dup(X509_REQ *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(X509_REQ), x); +} diff --git a/lib/libssl/src/crypto/asn1/x_x509.c b/lib/libssl/src/crypto/asn1/x_x509.c index 8fd2d7684b3..a2778911cd2 100644 --- a/lib/libssl/src/crypto/asn1/x_x509.c +++ b/lib/libssl/src/crypto/asn1/x_x509.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_x509.c,v 1.18 2015/02/09 15:05:59 jsing Exp $ */ +/* $OpenBSD: x_x509.c,v 1.19 2015/02/10 04:21:50 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -187,7 +187,12 @@ X509_free(X509 *a) { ASN1_item_free((ASN1_VALUE *)a, &X509_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(X509) + +X509 * +X509_dup(X509 *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(X509), x); +} int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, diff --git a/lib/libssl/src/crypto/ocsp/ocsp_lib.c b/lib/libssl/src/crypto/ocsp/ocsp_lib.c index 618cc3b8699..099cc26cd76 100644 --- a/lib/libssl/src/crypto/ocsp/ocsp_lib.c +++ b/lib/libssl/src/crypto/ocsp/ocsp_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp_lib.c,v 1.16 2014/10/18 17:20:40 jsing Exp $ */ +/* $OpenBSD: ocsp_lib.c,v 1.17 2015/02/10 04:21:50 jsing Exp $ */ /* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL * project. */ @@ -274,4 +274,9 @@ err: return 0; } -IMPLEMENT_ASN1_DUP_FUNCTION(OCSP_CERTID) + +OCSP_CERTID * +OCSP_CERTID_dup(OCSP_CERTID *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(OCSP_CERTID), x); +} diff --git a/lib/libssl/src/crypto/pkcs7/pk7_asn1.c b/lib/libssl/src/crypto/pkcs7/pk7_asn1.c index 2522a1ae6c7..5e8d69413f3 100644 --- a/lib/libssl/src/crypto/pkcs7/pk7_asn1.c +++ b/lib/libssl/src/crypto/pkcs7/pk7_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pk7_asn1.c,v 1.8 2015/02/09 16:04:46 jsing Exp $ */ +/* $OpenBSD: pk7_asn1.c,v 1.9 2015/02/10 04:21:50 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -142,7 +142,12 @@ PKCS7_free(PKCS7 *a) ASN1_item_free((ASN1_VALUE *)a, &PKCS7_it); } IMPLEMENT_ASN1_NDEF_FUNCTION(PKCS7) -IMPLEMENT_ASN1_DUP_FUNCTION(PKCS7) + +PKCS7 * +PKCS7_dup(PKCS7 *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(PKCS7), x); +} ASN1_NDEF_SEQUENCE(PKCS7_SIGNED) = { ASN1_SIMPLE(PKCS7_SIGNED, version, ASN1_INTEGER), diff --git a/lib/libssl/src/crypto/ts/ts_asn1.c b/lib/libssl/src/crypto/ts/ts_asn1.c index 3ef882cf05e..888f8e3d982 100644 --- a/lib/libssl/src/crypto/ts/ts_asn1.c +++ b/lib/libssl/src/crypto/ts/ts_asn1.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts_asn1.c,v 1.6 2015/02/10 04:01:26 jsing Exp $ */ +/* $OpenBSD: ts_asn1.c,v 1.7 2015/02/10 04:21:50 jsing Exp $ */ /* Written by Nils Larsch for the OpenSSL project 2004. */ /* ==================================================================== @@ -91,7 +91,12 @@ TS_MSG_IMPRINT_free(TS_MSG_IMPRINT *a) { ASN1_item_free((ASN1_VALUE *)a, &TS_MSG_IMPRINT_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(TS_MSG_IMPRINT) + +TS_MSG_IMPRINT * +TS_MSG_IMPRINT_dup(TS_MSG_IMPRINT *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(TS_MSG_IMPRINT), x); +} #ifndef OPENSSL_NO_BIO TS_MSG_IMPRINT * @@ -155,7 +160,12 @@ TS_REQ_free(TS_REQ *a) { ASN1_item_free((ASN1_VALUE *)a, &TS_REQ_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(TS_REQ) + +TS_REQ * +TS_REQ_dup(TS_REQ *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(TS_REQ), x); +} #ifndef OPENSSL_NO_BIO TS_REQ * @@ -214,7 +224,12 @@ TS_ACCURACY_free(TS_ACCURACY *a) { ASN1_item_free((ASN1_VALUE *)a, &TS_ACCURACY_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(TS_ACCURACY) + +TS_ACCURACY * +TS_ACCURACY_dup(TS_ACCURACY *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(TS_ACCURACY), x); +} ASN1_SEQUENCE(TS_TST_INFO) = { ASN1_SIMPLE(TS_TST_INFO, version, ASN1_INTEGER), @@ -254,7 +269,12 @@ TS_TST_INFO_free(TS_TST_INFO *a) { ASN1_item_free((ASN1_VALUE *)a, &TS_TST_INFO_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(TS_TST_INFO) + +TS_TST_INFO * +TS_TST_INFO_dup(TS_TST_INFO *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(TS_TST_INFO), x); +} #ifndef OPENSSL_NO_BIO TS_TST_INFO * @@ -315,7 +335,12 @@ TS_STATUS_INFO_free(TS_STATUS_INFO *a) { ASN1_item_free((ASN1_VALUE *)a, &TS_STATUS_INFO_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(TS_STATUS_INFO) + +TS_STATUS_INFO * +TS_STATUS_INFO_dup(TS_STATUS_INFO *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(TS_STATUS_INFO), x); +} static int ts_resp_set_tst_info(TS_RESP *a) @@ -392,7 +417,12 @@ TS_RESP_free(TS_RESP *a) { ASN1_item_free((ASN1_VALUE *)a, &TS_RESP_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(TS_RESP) + +TS_RESP * +TS_RESP_dup(TS_RESP *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(TS_RESP), x); +} #ifndef OPENSSL_NO_BIO TS_RESP * @@ -450,7 +480,12 @@ ESS_ISSUER_SERIAL_free(ESS_ISSUER_SERIAL *a) { ASN1_item_free((ASN1_VALUE *)a, &ESS_ISSUER_SERIAL_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(ESS_ISSUER_SERIAL) + +ESS_ISSUER_SERIAL * +ESS_ISSUER_SERIAL_dup(ESS_ISSUER_SERIAL *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(ESS_ISSUER_SERIAL), x); +} ASN1_SEQUENCE(ESS_CERT_ID) = { ASN1_SIMPLE(ESS_CERT_ID, hash, ASN1_OCTET_STRING), @@ -482,7 +517,12 @@ ESS_CERT_ID_free(ESS_CERT_ID *a) { ASN1_item_free((ASN1_VALUE *)a, &ESS_CERT_ID_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(ESS_CERT_ID) + +ESS_CERT_ID * +ESS_CERT_ID_dup(ESS_CERT_ID *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(ESS_CERT_ID), x); +} ASN1_SEQUENCE(ESS_SIGNING_CERT) = { ASN1_SEQUENCE_OF(ESS_SIGNING_CERT, cert_ids, ESS_CERT_ID), @@ -514,7 +554,12 @@ ESS_SIGNING_CERT_free(ESS_SIGNING_CERT *a) { ASN1_item_free((ASN1_VALUE *)a, &ESS_SIGNING_CERT_it); } -IMPLEMENT_ASN1_DUP_FUNCTION(ESS_SIGNING_CERT) + +ESS_SIGNING_CERT * +ESS_SIGNING_CERT_dup(ESS_SIGNING_CERT *x) +{ + return ASN1_item_dup(ASN1_ITEM_rptr(ESS_SIGNING_CERT), x); +} /* Getting encapsulated TS_TST_INFO object from PKCS7. */ TS_TST_INFO * |