From: tb Date: Sat, 2 Mar 2024 09:04:07 +0000 (+0000) Subject: Remove ASN1_PCTX nonsense X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2c2de1f85072e76d466f5e4bad862ee899893a81;p=openbsd Remove ASN1_PCTX nonsense This is only used by the fuzzing code. Another bit of poorly thought out extensibility that makes people pass NULL pointers to a bunch of APIs. ok jsing --- diff --git a/lib/libcrypto/Symbols.list b/lib/libcrypto/Symbols.list index 0e0a2eefa17..5a6ad4ac30f 100644 --- a/lib/libcrypto/Symbols.list +++ b/lib/libcrypto/Symbols.list @@ -81,18 +81,6 @@ ASN1_OCTET_STRING_free ASN1_OCTET_STRING_it ASN1_OCTET_STRING_new ASN1_OCTET_STRING_set -ASN1_PCTX_free -ASN1_PCTX_get_cert_flags -ASN1_PCTX_get_flags -ASN1_PCTX_get_nm_flags -ASN1_PCTX_get_oid_flags -ASN1_PCTX_get_str_flags -ASN1_PCTX_new -ASN1_PCTX_set_cert_flags -ASN1_PCTX_set_flags -ASN1_PCTX_set_nm_flags -ASN1_PCTX_set_oid_flags -ASN1_PCTX_set_str_flags ASN1_PRINTABLESTRING_free ASN1_PRINTABLESTRING_it ASN1_PRINTABLESTRING_new diff --git a/lib/libcrypto/Symbols.namespace b/lib/libcrypto/Symbols.namespace index 611165ec174..6bcd61696ec 100644 --- a/lib/libcrypto/Symbols.namespace +++ b/lib/libcrypto/Symbols.namespace @@ -1100,18 +1100,6 @@ _libre_ASN1_item_i2d _libre_ASN1_generate_nconf _libre_ASN1_generate_v3 _libre_ASN1_item_print -_libre_ASN1_PCTX_new -_libre_ASN1_PCTX_free -_libre_ASN1_PCTX_get_flags -_libre_ASN1_PCTX_set_flags -_libre_ASN1_PCTX_get_nm_flags -_libre_ASN1_PCTX_set_nm_flags -_libre_ASN1_PCTX_get_cert_flags -_libre_ASN1_PCTX_set_cert_flags -_libre_ASN1_PCTX_get_oid_flags -_libre_ASN1_PCTX_set_oid_flags -_libre_ASN1_PCTX_get_str_flags -_libre_ASN1_PCTX_set_str_flags _libre_SMIME_crlf_copy _libre_SMIME_text _libre_ERR_load_ASN1_strings diff --git a/lib/libcrypto/asn1/asn1.h b/lib/libcrypto/asn1/asn1.h index c44f85113b1..c9099465db2 100644 --- a/lib/libcrypto/asn1/asn1.h +++ b/lib/libcrypto/asn1/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.89 2024/03/02 09:02:04 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.90 2024/03/02 09:04:07 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -866,18 +866,6 @@ ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); int ASN1_item_print(BIO *out, ASN1_VALUE *ifld, int indent, const ASN1_ITEM *it, const ASN1_PCTX *pctx); -ASN1_PCTX *ASN1_PCTX_new(void); -void ASN1_PCTX_free(ASN1_PCTX *p); -unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p); -void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p); -void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p); -void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p); -void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); -unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p); -void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); int SMIME_crlf_copy(BIO *in, BIO *out, int flags); int SMIME_text(BIO *in, BIO *out); diff --git a/lib/libcrypto/asn1/tasn_prn.c b/lib/libcrypto/asn1/tasn_prn.c index d404838c68f..07764fc0913 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.26 2023/12/20 14:26:47 tb Exp $ */ +/* $OpenBSD: tasn_prn.c,v 1.27 2024/03/02 09:04:07 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -76,99 +76,6 @@ static const ASN1_PCTX default_pctx = { .flags = ASN1_PCTX_FLAGS_SHOW_ABSENT, }; -ASN1_PCTX * -ASN1_PCTX_new(void) -{ - ASN1_PCTX *p; - - if ((p = calloc(1, sizeof(ASN1_PCTX))) == NULL) { - ASN1error(ERR_R_MALLOC_FAILURE); - return NULL; - } - - return p; -} -LCRYPTO_ALIAS(ASN1_PCTX_new); - -void -ASN1_PCTX_free(ASN1_PCTX *p) -{ - free(p); -} -LCRYPTO_ALIAS(ASN1_PCTX_free); - -unsigned long -ASN1_PCTX_get_flags(const ASN1_PCTX *p) -{ - return p->flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_get_flags); - -void -ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags) -{ - p->flags = flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_set_flags); - -unsigned long -ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p) -{ - return p->nm_flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_get_nm_flags); - -void -ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags) -{ - p->nm_flags = flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_set_nm_flags); - -unsigned long -ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p) -{ - return p->cert_flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_get_cert_flags); - -void -ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags) -{ - p->cert_flags = flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_set_cert_flags); - -unsigned long -ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p) -{ - return p->oid_flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_get_oid_flags); - -void -ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags) -{ - p->oid_flags = flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_set_oid_flags); - -unsigned long -ASN1_PCTX_get_str_flags(const ASN1_PCTX *p) -{ - return p->str_flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_get_str_flags); - -void -ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags) -{ - p->str_flags = flags; -} -LCRYPTO_ALIAS(ASN1_PCTX_set_str_flags); - -/* Main print routines */ - static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, const ASN1_ITEM *it, const char *fname, const char *sname, int nohdr, const ASN1_PCTX *pctx); diff --git a/lib/libcrypto/hidden/openssl/asn1.h b/lib/libcrypto/hidden/openssl/asn1.h index 34790e31faa..169475a0ba6 100644 --- a/lib/libcrypto/hidden/openssl/asn1.h +++ b/lib/libcrypto/hidden/openssl/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.10 2024/03/02 09:02:04 tb Exp $ */ +/* $OpenBSD: asn1.h,v 1.11 2024/03/02 09:04:07 tb Exp $ */ /* * Copyright (c) 2023 Bob Beck * @@ -229,18 +229,6 @@ LCRYPTO_USED(ASN1_item_i2d); LCRYPTO_USED(ASN1_generate_nconf); LCRYPTO_USED(ASN1_generate_v3); LCRYPTO_USED(ASN1_item_print); -LCRYPTO_USED(ASN1_PCTX_new); -LCRYPTO_USED(ASN1_PCTX_free); -LCRYPTO_USED(ASN1_PCTX_get_flags); -LCRYPTO_USED(ASN1_PCTX_set_flags); -LCRYPTO_USED(ASN1_PCTX_get_nm_flags); -LCRYPTO_USED(ASN1_PCTX_set_nm_flags); -LCRYPTO_USED(ASN1_PCTX_get_cert_flags); -LCRYPTO_USED(ASN1_PCTX_set_cert_flags); -LCRYPTO_USED(ASN1_PCTX_get_oid_flags); -LCRYPTO_USED(ASN1_PCTX_set_oid_flags); -LCRYPTO_USED(ASN1_PCTX_get_str_flags); -LCRYPTO_USED(ASN1_PCTX_set_str_flags); LCRYPTO_USED(SMIME_crlf_copy); LCRYPTO_USED(SMIME_text); LCRYPTO_USED(ERR_load_ASN1_strings);