diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2016-12-30 16:04:35 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2016-12-30 16:04:35 +0000 |
commit | 57cb0248226d36a5449332a55be39a4cab6512ba (patch) | |
tree | c4909c7b0a6c8fdd0f096ebafff5b194e209f7a4 | |
parent | 066ab35bfc8af0958fe7746928c26fd184b72e83 (diff) |
Expand ASN1_ITEM_rptr and ASN1_ITEM_ptr macros - no change in generated
assembly.
-rw-r--r-- | lib/libcrypto/asn1/p5_pbe.c | 4 | ||||
-rw-r--r-- | lib/libcrypto/asn1/p5_pbev2.c | 6 | ||||
-rw-r--r-- | lib/libcrypto/asn1/tasn_dec.c | 10 | ||||
-rw-r--r-- | lib/libcrypto/asn1/tasn_enc.c | 12 | ||||
-rw-r--r-- | lib/libcrypto/asn1/tasn_fre.c | 6 | ||||
-rw-r--r-- | lib/libcrypto/asn1/tasn_new.c | 6 | ||||
-rw-r--r-- | lib/libcrypto/asn1/tasn_prn.c | 8 | ||||
-rw-r--r-- | lib/libcrypto/asn1/x_crl.c | 4 | ||||
-rw-r--r-- | lib/libcrypto/asn1/x_name.c | 10 |
9 files changed, 33 insertions, 33 deletions
diff --git a/lib/libcrypto/asn1/p5_pbe.c b/lib/libcrypto/asn1/p5_pbe.c index 3e7057bb246..e0609e02e9b 100644 --- a/lib/libcrypto/asn1/p5_pbe.c +++ b/lib/libcrypto/asn1/p5_pbe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p5_pbe.c,v 1.20 2015/02/11 04:00:39 jsing Exp $ */ +/* $OpenBSD: p5_pbe.c,v 1.21 2016/12/30 16:04:34 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -148,7 +148,7 @@ PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, else arc4random_buf(sstr, saltlen); - if (!ASN1_item_pack(pbe, ASN1_ITEM_rptr(PBEPARAM), &pbe_str)) { + if (!ASN1_item_pack(pbe, &PBEPARAM_it, &pbe_str)) { ASN1err(ASN1_F_PKCS5_PBE_SET0_ALGOR, ERR_R_MALLOC_FAILURE); goto err; } diff --git a/lib/libcrypto/asn1/p5_pbev2.c b/lib/libcrypto/asn1/p5_pbev2.c index 9be7e0205c5..155e2b0b3e4 100644 --- a/lib/libcrypto/asn1/p5_pbev2.c +++ b/lib/libcrypto/asn1/p5_pbev2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p5_pbev2.c,v 1.23 2015/09/30 18:41:06 jsing Exp $ */ +/* $OpenBSD: p5_pbev2.c,v 1.24 2016/12/30 16:04:34 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999-2004. */ @@ -265,7 +265,7 @@ PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, unsigned char *salt, /* Encode PBE2PARAM into parameter */ - if (!ASN1_item_pack(pbe2, ASN1_ITEM_rptr(PBE2PARAM), + if (!ASN1_item_pack(pbe2, &PBE2PARAM_it, &ret->parameter->value.sequence)) goto merr; ret->parameter->type = V_ASN1_SEQUENCE; @@ -358,7 +358,7 @@ PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, int prf_nid, if (!(keyfunc->parameter = ASN1_TYPE_new())) goto merr; - if (!ASN1_item_pack(kdf, ASN1_ITEM_rptr(PBKDF2PARAM), + if (!ASN1_item_pack(kdf, &PBKDF2PARAM_it, &keyfunc->parameter->value.sequence)) goto merr; keyfunc->parameter->type = V_ASN1_SEQUENCE; diff --git a/lib/libcrypto/asn1/tasn_dec.c b/lib/libcrypto/asn1/tasn_dec.c index e75fe536338..de78164995d 100644 --- a/lib/libcrypto/asn1/tasn_dec.c +++ b/lib/libcrypto/asn1/tasn_dec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_dec.c,v 1.32 2016/05/04 15:00:24 tedu Exp $ */ +/* $OpenBSD: tasn_dec.c,v 1.33 2016/12/30 16:04:34 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -589,7 +589,7 @@ asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len, while (sk_ASN1_VALUE_num(sktmp) > 0) { vtmp = sk_ASN1_VALUE_pop(sktmp); ASN1_item_ex_free(&vtmp, - ASN1_ITEM_ptr(tt->item)); + tt->item); } } @@ -616,7 +616,7 @@ asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len, } skfield = NULL; if (!ASN1_item_ex_d2i(&skfield, &p, len, - ASN1_ITEM_ptr(tt->item), -1, 0, 0, ctx)) { + tt->item, -1, 0, 0, ctx)) { ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR); goto err; @@ -637,7 +637,7 @@ asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len, } else if (flags & ASN1_TFLG_IMPTAG) { /* IMPLICIT tagging */ ret = ASN1_item_ex_d2i(val, &p, len, - ASN1_ITEM_ptr(tt->item), tt->tag, aclass, opt, ctx); + tt->item, tt->tag, aclass, opt, ctx); if (!ret) { ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, ERR_R_NESTED_ASN1_ERROR); @@ -646,7 +646,7 @@ asn1_template_noexp_d2i(ASN1_VALUE **val, const unsigned char **in, long len, return -1; } else { /* Nothing special */ - ret = ASN1_item_ex_d2i(val, &p, len, ASN1_ITEM_ptr(tt->item), + ret = ASN1_item_ex_d2i(val, &p, len, tt->item, -1, tt->flags & ASN1_TFLG_COMBINE, opt, ctx); if (!ret) { ASN1err(ASN1_F_ASN1_TEMPLATE_NOEXP_D2I, diff --git a/lib/libcrypto/asn1/tasn_enc.c b/lib/libcrypto/asn1/tasn_enc.c index 7d90c68c85e..f3341901fea 100644 --- a/lib/libcrypto/asn1/tasn_enc.c +++ b/lib/libcrypto/asn1/tasn_enc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_enc.c,v 1.20 2016/05/04 15:00:24 tedu Exp $ */ +/* $OpenBSD: tasn_enc.c,v 1.21 2016/12/30 16:04:34 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -330,7 +330,7 @@ asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) { skitem = sk_ASN1_VALUE_value(sk, i); skcontlen += ASN1_item_ex_i2d(&skitem, NULL, - ASN1_ITEM_ptr(tt->item), -1, iclass); + tt->item, -1, iclass); } sklen = ASN1_object_size(ndef, skcontlen, sktag); /* If EXPLICIT need length of surrounding tag */ @@ -349,7 +349,7 @@ asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, /* SET or SEQUENCE and IMPLICIT tag */ ASN1_put_object(out, ndef, skcontlen, sktag, skaclass); /* And the stuff itself */ - asn1_set_seq_out(sk, out, skcontlen, ASN1_ITEM_ptr(tt->item), + asn1_set_seq_out(sk, out, skcontlen, tt->item, isset, iclass); if (ndef == 2) { ASN1_put_eoc(out); @@ -363,7 +363,7 @@ asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, if (flags & ASN1_TFLG_EXPTAG) { /* EXPLICIT tagging */ /* Find length of tagged item */ - i = ASN1_item_ex_i2d(pval, NULL, ASN1_ITEM_ptr(tt->item), + i = ASN1_item_ex_i2d(pval, NULL, tt->item, -1, iclass); if (!i) return 0; @@ -372,7 +372,7 @@ asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, if (out) { /* Output tag and item */ ASN1_put_object(out, ndef, i, ttag, tclass); - ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), + ASN1_item_ex_i2d(pval, out, tt->item, -1, iclass); if (ndef == 2) ASN1_put_eoc(out); @@ -381,7 +381,7 @@ asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, } /* Either normal or IMPLICIT tagging: combine class and flags */ - return ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), + return ASN1_item_ex_i2d(pval, out, tt->item, ttag, tclass | iclass); } diff --git a/lib/libcrypto/asn1/tasn_fre.c b/lib/libcrypto/asn1/tasn_fre.c index 30d68786b19..9276034808f 100644 --- a/lib/libcrypto/asn1/tasn_fre.c +++ b/lib/libcrypto/asn1/tasn_fre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_fre.c,v 1.14 2015/02/14 15:23:57 miod Exp $ */ +/* $OpenBSD: tasn_fre.c,v 1.15 2016/12/30 16:04:34 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -176,13 +176,13 @@ ASN1_template_free(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) { ASN1_VALUE *vtmp; vtmp = sk_ASN1_VALUE_value(sk, i); - asn1_item_combine_free(&vtmp, ASN1_ITEM_ptr(tt->item), + asn1_item_combine_free(&vtmp, tt->item, 0); } sk_ASN1_VALUE_free(sk); *pval = NULL; } else - asn1_item_combine_free(pval, ASN1_ITEM_ptr(tt->item), + asn1_item_combine_free(pval, tt->item, tt->flags & ASN1_TFLG_COMBINE); } diff --git a/lib/libcrypto/asn1/tasn_new.c b/lib/libcrypto/asn1/tasn_new.c index 986e5811b6c..491de0131ee 100644 --- a/lib/libcrypto/asn1/tasn_new.c +++ b/lib/libcrypto/asn1/tasn_new.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_new.c,v 1.15 2015/07/20 15:43:23 miod Exp $ */ +/* $OpenBSD: tasn_new.c,v 1.16 2016/12/30 16:04:34 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -244,7 +244,7 @@ asn1_item_clear(ASN1_VALUE **pval, const ASN1_ITEM *it) int ASN1_template_new(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) { - const ASN1_ITEM *it = ASN1_ITEM_ptr(tt->item); + const ASN1_ITEM *it = tt->item; int ret; if (tt->flags & ASN1_TFLG_OPTIONAL) { @@ -291,7 +291,7 @@ asn1_template_clear(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt) if (tt->flags & (ASN1_TFLG_ADB_MASK|ASN1_TFLG_SK_MASK)) *pval = NULL; else - asn1_item_clear(pval, ASN1_ITEM_ptr(tt->item)); + asn1_item_clear(pval, tt->item); } diff --git a/lib/libcrypto/asn1/tasn_prn.c b/lib/libcrypto/asn1/tasn_prn.c index c8601a1a895..80e7fbb8903 100644 --- a/lib/libcrypto/asn1/tasn_prn.c +++ b/lib/libcrypto/asn1/tasn_prn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tasn_prn.c,v 1.14 2015/12/23 01:50:26 mmcc Exp $ */ +/* $OpenBSD: tasn_prn.c,v 1.15 2016/12/30 16:04:34 jsing Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -339,7 +339,7 @@ asn1_template_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, flags = tt->flags; if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME) - sname = ASN1_ITEM_ptr(tt->item)->sname; + sname = tt->item->sname; else sname = NULL; if (pctx->flags & ASN1_PCTX_FLAGS_NO_FIELD_NAME) @@ -371,7 +371,7 @@ asn1_template_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, return 0; skitem = sk_ASN1_VALUE_value(stack, i); if (!asn1_item_print_ctx(out, &skitem, indent + 2, - ASN1_ITEM_ptr(tt->item), NULL, NULL, 1, pctx)) + tt->item, NULL, NULL, 1, pctx)) return 0; } if (!i && BIO_printf(out, "%*s<EMPTY>\n", indent + 2, "") <= 0) @@ -382,7 +382,7 @@ asn1_template_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, } return 1; } - return asn1_item_print_ctx(out, fld, indent, ASN1_ITEM_ptr(tt->item), + return asn1_item_print_ctx(out, fld, indent, tt->item, fname, sname, 0, pctx); } diff --git a/lib/libcrypto/asn1/x_crl.c b/lib/libcrypto/asn1/x_crl.c index 6062587ed46..eeff341d7d4 100644 --- a/lib/libcrypto/asn1/x_crl.c +++ b/lib/libcrypto/asn1/x_crl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_crl.c,v 1.25 2015/07/20 15:29:13 miod Exp $ */ +/* $OpenBSD: x_crl.c,v 1.26 2016/12/30 16:04:34 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -571,7 +571,7 @@ X509_CRL_get0_by_cert(X509_CRL *crl, X509_REVOKED **ret, X509 *x) static int def_crl_verify(X509_CRL *crl, EVP_PKEY *r) { - return(ASN1_item_verify(ASN1_ITEM_rptr(X509_CRL_INFO), + return(ASN1_item_verify(&X509_CRL_INFO_it, crl->sig_alg, crl->signature, crl->crl, r)); } diff --git a/lib/libcrypto/asn1/x_name.c b/lib/libcrypto/asn1/x_name.c index be936318d86..87bcc2c5ba8 100644 --- a/lib/libcrypto/asn1/x_name.c +++ b/lib/libcrypto/asn1/x_name.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_name.c,v 1.31 2015/07/24 15:09:52 jsing Exp $ */ +/* $OpenBSD: x_name.c,v 1.32 2016/12/30 16:04:34 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -302,7 +302,7 @@ x509_name_ex_d2i(ASN1_VALUE **val, const unsigned char **in, long len, /* Get internal representation of Name */ ret = ASN1_item_ex_d2i(&intname.a, &p, len, - ASN1_ITEM_rptr(X509_NAME_INTERNAL), tag, aclass, opt, ctx); + &X509_NAME_INTERNAL_it, tag, aclass, opt, ctx); if (ret <= 0) return ret; @@ -410,11 +410,11 @@ x509_name_encode(X509_NAME *a) goto memerr; } len = ASN1_item_ex_i2d(&intname.a, NULL, - ASN1_ITEM_rptr(X509_NAME_INTERNAL), -1, -1); + &X509_NAME_INTERNAL_it, -1, -1); if (!BUF_MEM_grow(a->bytes, len)) goto memerr; p = (unsigned char *)a->bytes->data; - ASN1_item_ex_i2d(&intname.a, &p, ASN1_ITEM_rptr(X509_NAME_INTERNAL), + ASN1_item_ex_i2d(&intname.a, &p, &X509_NAME_INTERNAL_it, -1, -1); sk_STACK_OF_X509_NAME_ENTRY_pop_free(intname.s, local_sk_X509_NAME_ENTRY_free); @@ -615,7 +615,7 @@ i2d_name_canon(STACK_OF(STACK_OF_X509_NAME_ENTRY) *_intname, unsigned char **in) for (i = 0; i < sk_ASN1_VALUE_num(intname); i++) { v = sk_ASN1_VALUE_value(intname, i); ltmp = ASN1_item_ex_i2d(&v, in, - ASN1_ITEM_rptr(X509_NAME_ENTRIES), -1, -1); + &X509_NAME_ENTRIES_it, -1, -1); if (ltmp < 0) return ltmp; len += ltmp; |