From e63afbf6f5157e776c612cb85bfaf98fa6e70075 Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 31 Oct 2021 16:28:50 +0000 Subject: [PATCH] Remove the unused X509_CERT_PAIR struct and the assicated API. ok beck jsing --- lib/libcrypto/asn1/x_x509a.c | 55 +----------------------------------- lib/libcrypto/pem/pem.h | 5 +--- lib/libcrypto/pem/pem_xaux.c | 30 +------------------- lib/libcrypto/x509/x509.h | 13 +-------- 4 files changed, 4 insertions(+), 99 deletions(-) diff --git a/lib/libcrypto/asn1/x_x509a.c b/lib/libcrypto/asn1/x_x509a.c index b0d7150b930..d5364cb07ba 100644 --- a/lib/libcrypto/asn1/x_x509a.c +++ b/lib/libcrypto/asn1/x_x509a.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_x509a.c,v 1.15 2018/05/01 19:01:27 tb Exp $ */ +/* $OpenBSD: x_x509a.c,v 1.16 2021/10/31 16:28:50 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -270,56 +270,3 @@ X509_reject_clear(X509 *x) x->aux->reject = NULL; } } - -static const ASN1_TEMPLATE X509_CERT_PAIR_seq_tt[] = { - { - .flags = ASN1_TFLG_EXPLICIT | ASN1_TFLG_OPTIONAL, - .tag = 0, - .offset = offsetof(X509_CERT_PAIR, forward), - .field_name = "forward", - .item = &X509_it, - }, - { - .flags = ASN1_TFLG_EXPLICIT | ASN1_TFLG_OPTIONAL, - .tag = 1, - .offset = offsetof(X509_CERT_PAIR, reverse), - .field_name = "reverse", - .item = &X509_it, - }, -}; - -const ASN1_ITEM X509_CERT_PAIR_it = { - .itype = ASN1_ITYPE_SEQUENCE, - .utype = V_ASN1_SEQUENCE, - .templates = X509_CERT_PAIR_seq_tt, - .tcount = sizeof(X509_CERT_PAIR_seq_tt) / sizeof(ASN1_TEMPLATE), - .funcs = NULL, - .size = sizeof(X509_CERT_PAIR), - .sname = "X509_CERT_PAIR", -}; - - -X509_CERT_PAIR * -d2i_X509_CERT_PAIR(X509_CERT_PAIR **a, const unsigned char **in, long len) -{ - return (X509_CERT_PAIR *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, - &X509_CERT_PAIR_it); -} - -int -i2d_X509_CERT_PAIR(X509_CERT_PAIR *a, unsigned char **out) -{ - return ASN1_item_i2d((ASN1_VALUE *)a, out, &X509_CERT_PAIR_it); -} - -X509_CERT_PAIR * -X509_CERT_PAIR_new(void) -{ - return (X509_CERT_PAIR *)ASN1_item_new(&X509_CERT_PAIR_it); -} - -void -X509_CERT_PAIR_free(X509_CERT_PAIR *a) -{ - ASN1_item_free((ASN1_VALUE *)a, &X509_CERT_PAIR_it); -} diff --git a/lib/libcrypto/pem/pem.h b/lib/libcrypto/pem/pem.h index adc85226e87..01c7174d39d 100644 --- a/lib/libcrypto/pem/pem.h +++ b/lib/libcrypto/pem/pem.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pem.h,v 1.19 2018/08/24 19:51:31 tb Exp $ */ +/* $OpenBSD: pem.h,v 1.20 2021/10/31 16:28:50 tb Exp $ */ /* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -114,7 +114,6 @@ extern "C" { #define PEM_STRING_X509_OLD "X509 CERTIFICATE" #define PEM_STRING_X509 "CERTIFICATE" -#define PEM_STRING_X509_PAIR "CERTIFICATE PAIR" #define PEM_STRING_X509_TRUSTED "TRUSTED CERTIFICATE" #define PEM_STRING_X509_REQ_OLD "NEW CERTIFICATE REQUEST" #define PEM_STRING_X509_REQ "CERTIFICATE REQUEST" @@ -435,8 +434,6 @@ DECLARE_PEM_rw(X509, X509) DECLARE_PEM_rw(X509_AUX, X509) -DECLARE_PEM_rw(X509_CERT_PAIR, X509_CERT_PAIR) - DECLARE_PEM_rw(X509_REQ, X509_REQ) DECLARE_PEM_write(X509_REQ_NEW, X509_REQ) diff --git a/lib/libcrypto/pem/pem_xaux.c b/lib/libcrypto/pem/pem_xaux.c index 0dd81523b58..68a78517044 100644 --- a/lib/libcrypto/pem/pem_xaux.c +++ b/lib/libcrypto/pem/pem_xaux.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pem_xaux.c,v 1.9 2016/09/04 16:10:38 jsing Exp $ */ +/* $OpenBSD: pem_xaux.c,v 1.10 2021/10/31 16:28:50 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2001. */ @@ -92,31 +92,3 @@ PEM_write_bio_X509_AUX(BIO *bp, X509 *x) return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_AUX, PEM_STRING_X509_TRUSTED, bp, x, NULL, NULL, 0, NULL, NULL); } - -X509_CERT_PAIR * -PEM_read_X509_CERT_PAIR(FILE *fp, X509_CERT_PAIR **x, pem_password_cb *cb, void *u) -{ - return PEM_ASN1_read((d2i_of_void *)d2i_X509_CERT_PAIR, PEM_STRING_X509_PAIR, fp, - (void **)x, cb, u); -} - -int -PEM_write_X509_CERT_PAIR(FILE *fp, X509_CERT_PAIR *x) -{ - return PEM_ASN1_write((i2d_of_void *)i2d_X509_CERT_PAIR, PEM_STRING_X509_PAIR, fp, - x, NULL, NULL, 0, NULL, NULL); -} - -X509_CERT_PAIR * -PEM_read_bio_X509_CERT_PAIR(BIO *bp, X509_CERT_PAIR **x, pem_password_cb *cb, void *u) -{ - return PEM_ASN1_read_bio((d2i_of_void *)d2i_X509_CERT_PAIR, PEM_STRING_X509_PAIR, bp, - (void **)x, cb, u); -} - -int -PEM_write_bio_X509_CERT_PAIR(BIO *bp, X509_CERT_PAIR *x) -{ - return PEM_ASN1_write_bio((i2d_of_void *)i2d_X509_CERT_PAIR, PEM_STRING_X509_PAIR, bp, - x, NULL, NULL, 0, NULL, NULL); -} diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index c89b2a5d320..d064f7dbded 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.82 2021/10/23 13:16:52 tb Exp $ */ +/* $OpenBSD: x509.h,v 1.83 2021/10/31 16:28:50 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -327,11 +327,6 @@ typedef struct x509_trust_st { DECLARE_STACK_OF(X509_TRUST) -typedef struct x509_cert_pair_st { - X509 *forward; - X509 *reverse; -} X509_CERT_PAIR; - /* standard trust ids */ #define X509_TRUST_DEFAULT -1 /* Only valid in purpose settings */ @@ -908,12 +903,6 @@ X509_CERT_AUX *d2i_X509_CERT_AUX(X509_CERT_AUX **a, const unsigned char **in, lo int i2d_X509_CERT_AUX(X509_CERT_AUX *a, unsigned char **out); extern const ASN1_ITEM X509_CERT_AUX_it; -X509_CERT_PAIR *X509_CERT_PAIR_new(void); -void X509_CERT_PAIR_free(X509_CERT_PAIR *a); -X509_CERT_PAIR *d2i_X509_CERT_PAIR(X509_CERT_PAIR **a, const unsigned char **in, long len); -int i2d_X509_CERT_PAIR(X509_CERT_PAIR *a, unsigned char **out); -extern const ASN1_ITEM X509_CERT_PAIR_it; - int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); int X509_set_ex_data(X509 *r, int idx, void *arg); -- 2.20.1