crypto: remove OSSL_FUTURE_CONST as it is not more needed since 4.0

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28033)
This commit is contained in:
Dr. David von Oheimb 2025-09-08 11:29:46 +02:00 committed by Tomas Mraz
parent 495f4beb86
commit 5929482814
10 changed files with 38 additions and 52 deletions

View File

@ -17,7 +17,7 @@
/* Print out an SPKI */
int NETSCAPE_SPKI_print(BIO *out, OSSL_FUTURE_CONST NETSCAPE_SPKI *spki)
int NETSCAPE_SPKI_print(BIO *out, const NETSCAPE_SPKI *spki)
{
EVP_PKEY *pkey;
ASN1_IA5STRING *chal;

View File

@ -32,12 +32,12 @@ int X509_CRL_print_fp(FILE *fp, X509_CRL *x)
}
#endif
int X509_CRL_print(BIO *out, OSSL_FUTURE_CONST X509_CRL *x)
int X509_CRL_print(BIO *out, const X509_CRL *x)
{
return X509_CRL_print_ex(out, x, XN_FLAG_COMPAT);
}
int X509_CRL_print_ex(BIO *out, OSSL_FUTURE_CONST X509_CRL *x, unsigned long nmflag)
int X509_CRL_print_ex(BIO *out, const X509_CRL *x, unsigned long nmflag)
{
STACK_OF(X509_REVOKED) *rev;
X509_REVOKED *r;

View File

@ -18,7 +18,7 @@
#include <openssl/dsa.h>
#ifndef OPENSSL_NO_STDIO
int X509_REQ_print_fp(FILE *fp, OSSL_FUTURE_CONST X509_REQ *x)
int X509_REQ_print_fp(FILE *fp, const X509_REQ *x)
{
BIO *b;
int ret;
@ -34,8 +34,7 @@ int X509_REQ_print_fp(FILE *fp, OSSL_FUTURE_CONST X509_REQ *x)
}
#endif
int X509_REQ_print_ex(BIO *bp, OSSL_FUTURE_CONST X509_REQ *x, unsigned long nmflags,
unsigned long cflag)
int X509_REQ_print_ex(BIO *bp, const X509_REQ *x, unsigned long nmflags, unsigned long cflag)
{
long l;
int i;
@ -210,7 +209,7 @@ int X509_REQ_print_ex(BIO *bp, OSSL_FUTURE_CONST X509_REQ *x, unsigned long nmfl
return 0;
}
int X509_REQ_print(BIO *bp, OSSL_FUTURE_CONST X509_REQ *x)
int X509_REQ_print(BIO *bp, const X509_REQ *x)
{
return X509_REQ_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
}

View File

@ -33,8 +33,7 @@ int X509_print_fp(FILE *fp, X509 *x)
return X509_print_ex_fp(fp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
}
int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag,
unsigned long cflag)
int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag, unsigned long cflag)
{
BIO *b;
int ret;
@ -50,13 +49,12 @@ int X509_print_ex_fp(FILE *fp, X509 *x, unsigned long nmflag,
}
#endif
int X509_print(BIO *bp, OSSL_FUTURE_CONST X509 *x)
int X509_print(BIO *bp, const X509 *x)
{
return X509_print_ex(bp, x, XN_FLAG_COMPAT, X509_FLAG_COMPAT);
}
int X509_print_ex(BIO *bp, OSSL_FUTURE_CONST X509 *x, unsigned long nmflags,
unsigned long cflag)
int X509_print_ex(BIO *bp, const X509 *x, unsigned long nmflags, unsigned long cflag)
{
long l;
int ret = 0;
@ -200,7 +198,7 @@ int X509_print_ex(BIO *bp, OSSL_FUTURE_CONST X509 *x, unsigned long nmflags,
return ret;
}
int X509_ocspid_print(BIO *bp, OSSL_FUTURE_CONST X509 *x)
int X509_ocspid_print(BIO *bp, const X509 *x)
{
unsigned char *der = NULL;
unsigned char *dertmp;
@ -322,7 +320,7 @@ int X509_signature_print(BIO *bp, const X509_ALGOR *sigalg,
return 1;
}
int X509_aux_print(BIO *out, OSSL_FUTURE_CONST X509 *x, int indent)
int X509_aux_print(BIO *out, const X509 *x, int indent)
{
char oidstr[80], first;
STACK_OF(ASN1_OBJECT) *trust, *reject;

View File

@ -74,7 +74,7 @@ EVP_PKEY *X509_REQ_get0_pubkey(const X509_REQ *req)
return X509_PUBKEY_get0(req->req_info.pubkey);
}
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(OSSL_FUTURE_CONST X509_REQ *req)
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(const X509_REQ *req)
{
return req->req_info.pubkey;
}
@ -139,7 +139,7 @@ static STACK_OF(X509_EXTENSION) *get_extensions_by_nid(const X509_REQ *req,
ASN1_ITEM_rptr(X509_EXTENSIONS));
}
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(OSSL_FUTURE_CONST X509_REQ *req)
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(const X509_REQ *req)
{
STACK_OF(X509_EXTENSION) *exts = NULL;
int *pnid;

View File

@ -120,7 +120,7 @@ const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl)
return crl->crl.extensions;
}
STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(OSSL_FUTURE_CONST X509_CRL *crl)
STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(const X509_CRL *crl)
{
return crl->crl.revoked;
}

View File

@ -82,7 +82,7 @@ int X509_keyid_set1(X509 *x, const unsigned char *id, int len)
return ASN1_STRING_set(aux->keyid, id, len);
}
unsigned char *X509_alias_get0(OSSL_FUTURE_CONST X509 *x, int *len)
unsigned char *X509_alias_get0(const X509 *x, int *len)
{
if (!x->aux || !x->aux->alias)
return NULL;
@ -91,7 +91,7 @@ unsigned char *X509_alias_get0(OSSL_FUTURE_CONST X509 *x, int *len)
return x->aux->alias->data;
}
unsigned char *X509_keyid_get0(OSSL_FUTURE_CONST X509 *x, int *len)
unsigned char *X509_keyid_get0(const X509 *x, int *len)
{
if (!x->aux || !x->aux->keyid)
return NULL;
@ -159,14 +159,14 @@ void X509_reject_clear(X509 *x)
}
}
STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(OSSL_FUTURE_CONST X509 *x)
STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(const X509 *x)
{
if (x->aux != NULL)
return x->aux->trust;
return NULL;
}
STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(OSSL_FUTURE_CONST X509 *x)
STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(const X509 *x)
{
if (x->aux != NULL)
return x->aux->reject;

View File

@ -33,12 +33,6 @@ extern "C" {
# include <openssl/safestack.h>
# include <openssl/macros.h>
# if OPENSSL_VERSION_MAJOR >= 4
# define OSSL_FUTURE_CONST const
# else
# define OSSL_FUTURE_CONST
# endif
typedef struct ossl_provider_st OSSL_PROVIDER; /* Provider Object */
# ifdef NO_ASN1_TYPEDEFS

View File

@ -344,7 +344,7 @@ char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *x);
EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x);
int NETSCAPE_SPKI_set_pubkey(NETSCAPE_SPKI *x, EVP_PKEY *pkey);
int NETSCAPE_SPKI_print(BIO *out, OSSL_FUTURE_CONST NETSCAPE_SPKI *spki);
int NETSCAPE_SPKI_print(BIO *out, const NETSCAPE_SPKI *spki);
int X509_signature_dump(BIO *bp, const ASN1_STRING *sig, int indent);
int X509_signature_print(BIO *bp, const X509_ALGOR *alg,
@ -600,8 +600,8 @@ ASN1_OCTET_STRING *X509_REQ_get0_distinguishing_id(X509_REQ *x);
int X509_alias_set1(X509 *x, const unsigned char *name, int len);
int X509_keyid_set1(X509 *x, const unsigned char *id, int len);
unsigned char *X509_alias_get0(OSSL_FUTURE_CONST X509 *x, int *len);
unsigned char *X509_keyid_get0(OSSL_FUTURE_CONST X509 *x, int *len);
unsigned char *X509_alias_get0(const X509 *x, int *len);
unsigned char *X509_keyid_get0(const X509 *x, int *len);
DECLARE_ASN1_FUNCTIONS(X509_REVOKED)
DECLARE_ASN1_FUNCTIONS(X509_CRL_INFO)
@ -710,11 +710,11 @@ int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp);
int X509_REQ_set_pubkey(X509_REQ *x, EVP_PKEY *pkey);
EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *req); /* deprecated */
EVP_PKEY *X509_REQ_get0_pubkey(const X509_REQ *req);
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(OSSL_FUTURE_CONST X509_REQ *req);
X509_PUBKEY *X509_REQ_get_X509_PUBKEY(const X509_REQ *req);
int X509_REQ_extension_nid(int nid);
int *X509_REQ_get_extension_nids(void);
void X509_REQ_set_extension_nids(int *nids);
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(OSSL_FUTURE_CONST X509_REQ *req);
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(const X509_REQ *req);
int X509_REQ_add_extensions_nid(X509_REQ *req,
const STACK_OF(X509_EXTENSION) *exts, int nid);
int X509_REQ_add_extensions(X509_REQ *req, const STACK_OF(X509_EXTENSION) *ext);
@ -759,7 +759,7 @@ OSSL_DEPRECATEDIN_1_1_0 ASN1_TIME *X509_CRL_get_nextUpdate(X509_CRL *crl);
#endif
X509_NAME *X509_CRL_get_issuer(const X509_CRL *crl);
const STACK_OF(X509_EXTENSION) *X509_CRL_get0_extensions(const X509_CRL *crl);
STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(OSSL_FUTURE_CONST X509_CRL *crl);
STACK_OF(X509_REVOKED) *X509_CRL_get_REVOKED(const X509_CRL *crl);
const X509_ALGOR *X509_CRL_get0_tbs_sigalg(const X509_CRL *crl);
void X509_CRL_get0_signature(const X509_CRL *crl, const ASN1_BIT_STRING **psig,
const X509_ALGOR **palg);
@ -821,29 +821,24 @@ unsigned long X509_NAME_hash_old(const X509_NAME *x);
int X509_CRL_cmp(const X509_CRL *a, const X509_CRL *b);
int X509_CRL_match(const X509_CRL *a, const X509_CRL *b);
int X509_aux_print(BIO *out, OSSL_FUTURE_CONST X509 *x, int indent);
int X509_aux_print(BIO *out, const X509 *x, int indent);
# ifndef OPENSSL_NO_STDIO
int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag,
unsigned long cflag);
int X509_print_ex_fp(FILE *bp, X509 *x, unsigned long nmflag, unsigned long cflag);
int X509_print_fp(FILE *bp, X509 *x);
int X509_CRL_print_fp(FILE *bp, X509_CRL *x);
int X509_REQ_print_fp(FILE *bp, OSSL_FUTURE_CONST X509_REQ *req);
int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent,
unsigned long flags);
int X509_REQ_print_fp(FILE *bp, const X509_REQ *req);
int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, unsigned long flags);
# endif
int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase);
int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent,
unsigned long flags);
int X509_print_ex(BIO *bp, OSSL_FUTURE_CONST X509 *x, unsigned long nmflag,
unsigned long cflag);
int X509_print(BIO *bp, OSSL_FUTURE_CONST X509 *x);
int X509_ocspid_print(BIO *bp, OSSL_FUTURE_CONST X509 *x);
int X509_CRL_print_ex(BIO *out, OSSL_FUTURE_CONST X509_CRL *x, unsigned long nmflag);
int X509_CRL_print(BIO *bp, OSSL_FUTURE_CONST X509_CRL *x);
int X509_REQ_print_ex(BIO *bp, OSSL_FUTURE_CONST X509_REQ *x, unsigned long nmflag,
unsigned long cflag);
int X509_REQ_print(BIO *bp, OSSL_FUTURE_CONST X509_REQ *req);
int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, unsigned long flags);
int X509_print_ex(BIO *bp, const X509 *x, unsigned long nmflag, unsigned long cflag);
int X509_print(BIO *bp, const X509 *x);
int X509_ocspid_print(BIO *bp, const X509 *x);
int X509_CRL_print_ex(BIO *out, const X509_CRL *x, unsigned long nmflag);
int X509_CRL_print(BIO *bp, const X509_CRL *x);
int X509_REQ_print_ex(BIO *bp, const X509_REQ *x, unsigned long nmflag, unsigned long cflag);
int X509_REQ_print(BIO *bp, const X509_REQ *req);
int X509_NAME_entry_count(const X509_NAME *name);
int X509_NAME_get_text_by_NID(const X509_NAME *name, int nid,

View File

@ -132,8 +132,8 @@ int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj);
void X509_trust_clear(X509 *x);
void X509_reject_clear(X509 *x);
STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(OSSL_FUTURE_CONST X509 *x);
STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(OSSL_FUTURE_CONST X509 *x);
STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(const X509 *x);
STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(const X509 *x);
int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
int);