From 52156a6f972a96f2cdda6126bcd884375a362883 Mon Sep 17 00:00:00 2001 From: tb Date: Mon, 1 Nov 2021 08:14:36 +0000 Subject: [PATCH] Unifdef LIBRESSL_NEW_API. Now that the library is bumped, this is no longer needed. ok jsing --- lib/libcrypto/asn1/asn1.h | 4 +--- lib/libcrypto/bio/bio.h | 4 +--- lib/libcrypto/crypto.h | 4 +--- lib/libcrypto/evp/evp.h | 4 +--- lib/libcrypto/ocsp/ocsp.h | 6 +----- lib/libcrypto/opensslfeatures.h | 1 - lib/libcrypto/x509/x509.h | 15 +-------------- lib/libcrypto/x509/x509_set.c | 4 +--- lib/libcrypto/x509/x509_vfy.h | 18 +----------------- lib/libcrypto/x509/x509v3.h | 4 +--- lib/libssl/ssl.h | 6 +----- 11 files changed, 10 insertions(+), 60 deletions(-) diff --git a/lib/libcrypto/asn1/asn1.h b/lib/libcrypto/asn1/asn1.h index 43b038adaa2..815256a30d5 100644 --- a/lib/libcrypto/asn1/asn1.h +++ b/lib/libcrypto/asn1/asn1.h @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1.h,v 1.55 2021/10/27 09:50:57 beck Exp $ */ +/* $OpenBSD: asn1.h,v 1.56 2021/11/01 08:14:36 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -773,10 +773,8 @@ ASN1_TIME *d2i_ASN1_TIME(ASN1_TIME **a, const unsigned char **in, long len); int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **out); extern const ASN1_ITEM ASN1_TIME_it; -#if defined(LIBRESSL_NEW_API) int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from, const ASN1_TIME *to); -#endif extern const ASN1_ITEM ASN1_OCTET_STRING_NDEF_it; diff --git a/lib/libcrypto/bio/bio.h b/lib/libcrypto/bio/bio.h index 735d16e6b97..78949f051ed 100644 --- a/lib/libcrypto/bio/bio.h +++ b/lib/libcrypto/bio/bio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: bio.h,v 1.46 2021/10/24 13:46:56 tb Exp $ */ +/* $OpenBSD: bio.h,v 1.47 2021/11/01 08:14:36 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -607,9 +607,7 @@ int BIO_free(BIO *a); int BIO_up_ref(BIO *bio); void *BIO_get_data(BIO *a); void BIO_set_data(BIO *a, void *ptr); -#if defined(LIBRESSL_NEW_API) int BIO_get_init(BIO *a); -#endif void BIO_set_init(BIO *a, int init); int BIO_get_shutdown(BIO *a); void BIO_set_shutdown(BIO *a, int shut); diff --git a/lib/libcrypto/crypto.h b/lib/libcrypto/crypto.h index aba55560296..ea475e3bf43 100644 --- a/lib/libcrypto/crypto.h +++ b/lib/libcrypto/crypto.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.h,v 1.51 2021/10/23 09:13:51 beck Exp $ */ +/* $OpenBSD: crypto.h,v 1.52 2021/11/01 08:14:36 tb Exp $ */ /* ==================================================================== * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved. * @@ -505,10 +505,8 @@ uint64_t OPENSSL_cpu_caps(void); int OPENSSL_isservice(void); #ifndef LIBRESSL_INTERNAL -#if defined(LIBRESSL_NEW_API) int FIPS_mode(void); int FIPS_mode_set(int r); -#endif void OPENSSL_init(void); diff --git a/lib/libcrypto/evp/evp.h b/lib/libcrypto/evp/evp.h index 4e32a794b4c..3af94350f71 100644 --- a/lib/libcrypto/evp/evp.h +++ b/lib/libcrypto/evp/evp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: evp.h,v 1.84 2021/10/24 13:51:07 tb Exp $ */ +/* $OpenBSD: evp.h,v 1.85 2021/11/01 08:14:36 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -486,9 +486,7 @@ int EVP_MD_block_size(const EVP_MD *md); unsigned long EVP_MD_flags(const EVP_MD *md); const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); -#if defined(LIBRESSL_NEW_API) void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); -#endif #define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) #define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) #define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) diff --git a/lib/libcrypto/ocsp/ocsp.h b/lib/libcrypto/ocsp/ocsp.h index 554d1646010..f942a8a0eb3 100644 --- a/lib/libcrypto/ocsp/ocsp.h +++ b/lib/libcrypto/ocsp/ocsp.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ocsp.h,v 1.17 2021/10/24 13:50:14 tb Exp $ */ +/* $OpenBSD: ocsp.h,v 1.18 2021/11/01 08:14:36 tb Exp $ */ /* Written by Tom Titchener for the OpenSSL * project. */ @@ -414,22 +414,18 @@ int OCSP_request_sign(OCSP_REQUEST *req, X509 *signer, EVP_PKEY *key, int OCSP_response_status(OCSP_RESPONSE *resp); OCSP_BASICRESP *OCSP_response_get1_basic(OCSP_RESPONSE *resp); -#if defined(LIBRESSL_NEW_API) const ASN1_OCTET_STRING *OCSP_resp_get0_signature(const OCSP_BASICRESP *bs); const X509_ALGOR *OCSP_resp_get0_tbs_sigalg(const OCSP_BASICRESP *bs); const OCSP_RESPDATA *OCSP_resp_get0_respdata(const OCSP_BASICRESP *bs); int OCSP_resp_get0_signer(OCSP_BASICRESP *bs, X509 **signer, STACK_OF(X509) *extra_certs); -#endif int OCSP_resp_count(OCSP_BASICRESP *bs); OCSP_SINGLERESP *OCSP_resp_get0(OCSP_BASICRESP *bs, int idx); -#if defined(LIBRESSL_NEW_API) const ASN1_GENERALIZEDTIME *OCSP_resp_get0_produced_at(const OCSP_BASICRESP *bs); const STACK_OF(X509) *OCSP_resp_get0_certs(const OCSP_BASICRESP *bs); int OCSP_resp_get0_id(const OCSP_BASICRESP *bs, const ASN1_OCTET_STRING **pid, const X509_NAME **pname); -#endif int OCSP_resp_find(OCSP_BASICRESP *bs, OCSP_CERTID *id, int last); int OCSP_single_get0_status(OCSP_SINGLERESP *single, int *reason, diff --git a/lib/libcrypto/opensslfeatures.h b/lib/libcrypto/opensslfeatures.h index 4b157a6e63f..f16e25e782f 100644 --- a/lib/libcrypto/opensslfeatures.h +++ b/lib/libcrypto/opensslfeatures.h @@ -6,7 +6,6 @@ #define LIBRESSL_HAS_TLS1_3 #define LIBRESSL_HAS_DTLS1_2 -#define LIBRESSL_NEW_API #define LIBRESSL_OPAQUE_X509 #define OPENSSL_THREADS diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h index 43b2307c8f1..9a44bf30aa2 100644 --- a/lib/libcrypto/x509/x509.h +++ b/lib/libcrypto/x509/x509.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509.h,v 1.85 2021/10/31 16:51:16 tb Exp $ */ +/* $OpenBSD: x509.h,v 1.86 2021/11/01 08:14:36 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -594,9 +594,7 @@ extern "C" { int X509_CRL_up_ref(X509_CRL *x); int X509_CRL_get_signature_nid(const X509_CRL *crl); -#if defined(LIBRESSL_NEW_API) int i2d_re_X509_CRL_tbs(X509_CRL *req, unsigned char **pp); -#endif const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl); long X509_CRL_get_version(const X509_CRL *crl); @@ -626,12 +624,7 @@ void X509_CRL_METHOD_free(X509_CRL_METHOD *m); void X509_CRL_set_meth_data(X509_CRL *crl, void *dat); void *X509_CRL_get_meth_data(X509_CRL *crl); -#if defined(LIBRESSL_NEW_API) X509_PUBKEY *X509_get_X509_PUBKEY(const X509 *x); -#else -#define X509_get_X509_PUBKEY(x) (x)->cert_info->key -#endif - const char *X509_verify_cert_error_string(long n); @@ -831,12 +824,10 @@ void X509_SIG_free(X509_SIG *a); X509_SIG *d2i_X509_SIG(X509_SIG **a, const unsigned char **in, long len); int i2d_X509_SIG(X509_SIG *a, unsigned char **out); extern const ASN1_ITEM X509_SIG_it; -#if defined(LIBRESSL_NEW_API) void X509_SIG_get0(const X509_SIG *sig, const X509_ALGOR **palg, const ASN1_OCTET_STRING **pdigest); void X509_SIG_getm(X509_SIG *sig, X509_ALGOR **palg, ASN1_OCTET_STRING **pdigest); -#endif X509_REQ_INFO *X509_REQ_INFO_new(void); void X509_REQ_INFO_free(X509_REQ_INFO *a); @@ -903,9 +894,7 @@ void *X509_get_ex_data(X509 *r, int idx); int i2d_X509_AUX(X509 *a,unsigned char **pp); X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); -#if defined(LIBRESSL_NEW_API) int i2d_re_X509_tbs(X509 *x, unsigned char **pp); -#endif void X509_get0_signature(const ASN1_BIT_STRING **psig, const X509_ALGOR **palg, const X509 *x); @@ -1019,10 +1008,8 @@ int X509_REQ_set_subject_name(X509_REQ *req, X509_NAME *name); X509_NAME *X509_REQ_get_subject_name(const X509_REQ *x); int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey); EVP_PKEY * X509_REQ_get_pubkey(X509_REQ *req); -#if defined(LIBRESSL_NEW_API) int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp); EVP_PKEY * X509_REQ_get0_pubkey(X509_REQ *req); -#endif int X509_REQ_extension_nid(int nid); int * X509_REQ_get_extension_nids(void); void X509_REQ_set_extension_nids(int *nids); diff --git a/lib/libcrypto/x509/x509_set.c b/lib/libcrypto/x509/x509_set.c index e086c021cd0..c4ce8e5674d 100644 --- a/lib/libcrypto/x509/x509_set.c +++ b/lib/libcrypto/x509/x509_set.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_set.c,v 1.18 2021/10/21 13:02:01 tb Exp $ */ +/* $OpenBSD: x509_set.c,v 1.19 2021/11/01 08:14:36 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -217,10 +217,8 @@ X509_get_signature_type(const X509 *x) return EVP_PKEY_type(OBJ_obj2nid(x->sig_alg->algorithm)); } -#if defined(LIBRESSL_NEW_API) X509_PUBKEY * X509_get_X509_PUBKEY(const X509 *x) { return x->cert_info->key; } -#endif diff --git a/lib/libcrypto/x509/x509_vfy.h b/lib/libcrypto/x509/x509_vfy.h index 676145cca7e..61ea11b71ac 100644 --- a/lib/libcrypto/x509/x509_vfy.h +++ b/lib/libcrypto/x509/x509_vfy.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_vfy.h,v 1.44 2021/10/31 16:51:16 tb Exp $ */ +/* $OpenBSD: x509_vfy.h,v 1.45 2021/11/01 08:14:36 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -201,10 +201,6 @@ struct x509_store_st { int X509_STORE_set_depth(X509_STORE *store, int depth); -#if !defined(LIBRESSL_NEW_API) -#define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func)) -#endif - #if defined(LIBRESSL_CRYPTO_INTERNAL) || !defined(LIBRESSL_OPAQUE_X509) /* This is the functions plus an instance of the local variables. */ struct x509_lookup_st { @@ -425,10 +421,8 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); | X509_V_FLAG_INHIBIT_ANY \ | X509_V_FLAG_INHIBIT_MAP) -#if defined(LIBRESSL_NEW_API) X509_OBJECT *X509_OBJECT_new(void); void X509_OBJECT_free(X509_OBJECT *a); -#endif int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type, X509_NAME *name); X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h, @@ -492,10 +486,8 @@ int X509_STORE_add_crl(X509_STORE *ctx, X509_CRL *x); int X509_STORE_CTX_get_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, X509_NAME *name, X509_OBJECT *ret); #define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject -#if defined(LIBRESSL_NEW_API) X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs, X509_LOOKUP_TYPE type, X509_NAME *name); -#endif int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret); @@ -530,13 +522,9 @@ void * X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,int idx); int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx); void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,int s); int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx); -#if defined(LIBRESSL_NEW_API) void X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth); -#endif X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx); -#if defined(LIBRESSL_NEW_API) void X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x); -#endif X509 *X509_STORE_CTX_get0_current_issuer(X509_STORE_CTX *ctx); X509_CRL *X509_STORE_CTX_get0_current_crl(X509_STORE_CTX *ctx); X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(X509_STORE_CTX *ctx); @@ -552,7 +540,6 @@ int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose, void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags); void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags, time_t t); -#if defined(LIBRESSL_NEW_API) void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *ctx, STACK_OF(X509) *sk); int (*X509_STORE_CTX_get_verify(X509_STORE_CTX *ctx))(X509_STORE_CTX *); void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, @@ -560,15 +547,12 @@ void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx, #define X509_STORE_set_verify_func(ctx, func) \ X509_STORE_set_verify((ctx), (func)) int (*X509_STORE_CTX_get_verify_cb(X509_STORE_CTX *ctx))(int, X509_STORE_CTX *); -#endif void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx, int (*verify_cb)(int, X509_STORE_CTX *)); X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(X509_STORE_CTX *ctx); int X509_STORE_CTX_get_explicit_policy(X509_STORE_CTX *ctx); -#if defined(LIBRESSL_NEW_API) int X509_STORE_CTX_get_num_untrusted(X509_STORE_CTX *ctx); -#endif X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(X509_STORE_CTX *ctx); void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param); diff --git a/lib/libcrypto/x509/x509v3.h b/lib/libcrypto/x509/x509v3.h index 62ed038d332..2d8ab6fc6e8 100644 --- a/lib/libcrypto/x509/x509v3.h +++ b/lib/libcrypto/x509/x509v3.h @@ -1,4 +1,4 @@ -/* $OpenBSD: x509v3.h,v 1.9 2021/10/23 17:43:06 tb Exp $ */ +/* $OpenBSD: x509v3.h,v 1.10 2021/11/01 08:14:36 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 1999. */ @@ -800,11 +800,9 @@ char *X509_PURPOSE_get0_sname(const X509_PURPOSE *xp); int X509_PURPOSE_get_trust(const X509_PURPOSE *xp); void X509_PURPOSE_cleanup(void); int X509_PURPOSE_get_id(const X509_PURPOSE *); -#if defined(LIBRESSL_NEW_API) uint32_t X509_get_extension_flags(X509 *x); uint32_t X509_get_key_usage(X509 *x); uint32_t X509_get_extended_key_usage(X509 *x); -#endif STACK_OF(OPENSSL_STRING) *X509_get1_email(X509 *x); STACK_OF(OPENSSL_STRING) *X509_REQ_get1_email(X509_REQ *x); diff --git a/lib/libssl/ssl.h b/lib/libssl/ssl.h index 258cde67e47..e3132682162 100644 --- a/lib/libssl/ssl.h +++ b/lib/libssl/ssl.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ssl.h,v 1.214 2021/10/23 20:42:50 beck Exp $ */ +/* $OpenBSD: ssl.h,v 1.215 2021/11/01 08:14:36 tb Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -506,7 +506,6 @@ void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, #define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) #define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) typedef void (*SSL_CTX_keylog_cb_func)(const SSL *ssl, const char *line); -#if defined(LIBRESSL_NEW_API) void SSL_CTX_set_keylog_callback(SSL_CTX *ctx, SSL_CTX_keylog_cb_func cb); SSL_CTX_keylog_cb_func SSL_CTX_get_keylog_callback(const SSL_CTX *ctx); int SSL_set_num_tickets(SSL *s, size_t num_tickets); @@ -514,7 +513,6 @@ size_t SSL_get_num_tickets(const SSL *s); int SSL_CTX_set_num_tickets(SSL_CTX *ctx, size_t num_tickets); size_t SSL_CTX_get_num_tickets(const SSL_CTX *ctx); STACK_OF(X509) *SSL_get0_verified_chain(const SSL *s); -#endif #ifndef LIBRESSL_INTERNAL struct ssl_aead_ctx_st; @@ -1294,11 +1292,9 @@ int SSL_is_server(const SSL *s); int SSL_read(SSL *ssl, void *buf, int num); int SSL_peek(SSL *ssl, void *buf, int num); int SSL_write(SSL *ssl, const void *buf, int num); -#if defined(LIBRESSL_NEW_API) int SSL_read_ex(SSL *ssl, void *buf, size_t num, size_t *bytes_read); int SSL_peek_ex(SSL *ssl, void *buf, size_t num, size_t *bytes_peeked); int SSL_write_ex(SSL *ssl, const void *buf, size_t num, size_t *bytes_written); -#endif #if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL) uint32_t SSL_CTX_get_max_early_data(const SSL_CTX *ctx); -- 2.20.1