Skip to content

Commit

Permalink
fixup! refactor and constify X509_REQ_get_extensions()
Browse files Browse the repository at this point in the history
  • Loading branch information
DDvO committed Jul 4, 2024
1 parent ab09074 commit feebe21
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crypto/x509/x509_req.c
Original file line number Diff line number Diff line change
Expand Up @@ -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(const X509_REQ *req)
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(TYPEQOSSL_CONST_FUTURE X509_REQ *req)
{
STACK_OF(X509_EXTENSION) *exts = NULL;
int *pnid;
Expand Down
6 changes: 6 additions & 0 deletions include/openssl/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ extern "C" {
# include <openssl/safestack.h>
# include <openssl/macros.h>

#if OPENSSL_VERSION_MAJOR >= 4
# define OSSL_CONST_FUTURE const
#else
# define TYPEQOSSL_CONST_FUTURE
#endif

typedef struct ossl_provider_st OSSL_PROVIDER; /* Provider Object */

# ifdef NO_ASN1_TYPEDEFS
Expand Down
2 changes: 1 addition & 1 deletion include/openssl/x509.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ X509_PUBKEY *X509_REQ_get_X509_PUBKEY(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(const X509_REQ *req);
STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(TYPEQOSSL_CONST_FUTURE 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);
Expand Down

0 comments on commit feebe21

Please sign in to comment.