From 7bc0fdd3fd4535e06c35b92d71afab9a6de94cc5 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 2 Mar 2021 15:52:00 +0000 Subject: Make the EVP_PKEY_get0* functions have a const return type OTC have decided that the EVP_PKEY_get0* functions should have a const return type. This is a breaking change to emphasise that these values should be considered as immutable. Reviewed-by: Richard Levitte Reviewed-by: Shane Lontis Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/14319) --- crypto/pem/pvkfmt.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'crypto/pem') diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c index de673be005..8006c64b3a 100644 --- a/crypto/pem/pvkfmt.c +++ b/crypto/pem/pvkfmt.c @@ -450,12 +450,12 @@ static void write_lebn(unsigned char **out, const BIGNUM *bn, int len) *out += len; } -static int check_bitlen_rsa(RSA *rsa, int ispub, unsigned int *magic); -static void write_rsa(unsigned char **out, RSA *rsa, int ispub); +static int check_bitlen_rsa(const RSA *rsa, int ispub, unsigned int *magic); +static void write_rsa(unsigned char **out, const RSA *rsa, int ispub); #ifndef OPENSSL_NO_DSA -static int check_bitlen_dsa(DSA *dsa, int ispub, unsigned int *magic); -static void write_dsa(unsigned char **out, DSA *dsa, int ispub); +static int check_bitlen_dsa(const DSA *dsa, int ispub, unsigned int *magic); +static void write_dsa(unsigned char **out, const DSA *dsa, int ispub); #endif static int do_i2b(unsigned char **out, const EVP_PKEY *pk, int ispub) @@ -542,7 +542,7 @@ static int do_i2b_bio(BIO *out, const EVP_PKEY *pk, int ispub) return -1; } -static int check_bitlen_rsa(RSA *rsa, int ispub, unsigned int *pmagic) +static int check_bitlen_rsa(const RSA *rsa, int ispub, unsigned int *pmagic) { int nbyte, hnbyte, bitlen; const BIGNUM *e; @@ -582,7 +582,7 @@ static int check_bitlen_rsa(RSA *rsa, int ispub, unsigned int *pmagic) return 0; } -static void write_rsa(unsigned char **out, RSA *rsa, int ispub) +static void write_rsa(unsigned char **out, const RSA *rsa, int ispub) { int nbyte, hnbyte; const BIGNUM *n, *d, *e, *p, *q, *iqmp, *dmp1, *dmq1; @@ -605,7 +605,7 @@ static void write_rsa(unsigned char **out, RSA *rsa, int ispub) } #ifndef OPENSSL_NO_DSA -static int check_bitlen_dsa(DSA *dsa, int ispub, unsigned int *pmagic) +static int check_bitlen_dsa(const DSA *dsa, int ispub, unsigned int *pmagic) { int bitlen; const BIGNUM *p = NULL, *q = NULL, *g = NULL; @@ -633,7 +633,7 @@ static int check_bitlen_dsa(DSA *dsa, int ispub, unsigned int *pmagic) return 0; } -static void write_dsa(unsigned char **out, DSA *dsa, int ispub) +static void write_dsa(unsigned char **out, const DSA *dsa, int ispub) { int nbyte; const BIGNUM *p = NULL, *q = NULL, *g = NULL; -- cgit v1.2.3