summaryrefslogtreecommitdiffstats
path: root/crypto/pem
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2016-06-14 15:49:05 +0200
committerRichard Levitte <levitte@openssl.org>2016-06-15 20:09:27 +0200
commit2ac6115d9ee35308300b82d96078d03d81e7d320 (patch)
treed9c9c2af38b0b55f39dd418fa41650b102077971 /crypto/pem
parentfd809cfdbd6e32b6b67b68c59f6d55fbed7a9327 (diff)
Deal with the consequences of constifying getters
Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'crypto/pem')
-rw-r--r--crypto/pem/pvkfmt.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/crypto/pem/pvkfmt.c b/crypto/pem/pvkfmt.c
index 4c07aee8f2..bf512ecdf0 100644
--- a/crypto/pem/pvkfmt.c
+++ b/crypto/pem/pvkfmt.c
@@ -467,7 +467,8 @@ static int do_i2b_bio(BIO *out, EVP_PKEY *pk, int ispub)
static int check_bitlen_dsa(DSA *dsa, int ispub, unsigned int *pmagic)
{
int bitlen;
- BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub_key = NULL, *priv_key = NULL;
+ const BIGNUM *p = NULL, *q = NULL, *g = NULL;
+ const BIGNUM *pub_key = NULL, *priv_key = NULL;
DSA_get0_pqg(dsa, &p, &q, &g);
DSA_get0_key(dsa, &pub_key, &priv_key);
@@ -494,7 +495,7 @@ static int check_bitlen_dsa(DSA *dsa, int ispub, unsigned int *pmagic)
static int check_bitlen_rsa(RSA *rsa, int ispub, unsigned int *pmagic)
{
int nbyte, hnbyte, bitlen;
- BIGNUM *e;
+ const BIGNUM *e;
RSA_get0_key(rsa, &e, NULL, NULL);
if (BN_num_bits(e) > 32)
@@ -506,7 +507,7 @@ static int check_bitlen_rsa(RSA *rsa, int ispub, unsigned int *pmagic)
*pmagic = MS_RSA1MAGIC;
return bitlen;
} else {
- BIGNUM *d, *p, *q, *iqmp, *dmp1, *dmq1;
+ const BIGNUM *d, *p, *q, *iqmp, *dmp1, *dmq1;
*pmagic = MS_RSA2MAGIC;
@@ -534,7 +535,7 @@ static int check_bitlen_rsa(RSA *rsa, int ispub, unsigned int *pmagic)
static void write_rsa(unsigned char **out, RSA *rsa, int ispub)
{
int nbyte, hnbyte;
- BIGNUM *n, *d, *e, *p, *q, *iqmp, *dmp1, *dmq1;
+ const BIGNUM *n, *d, *e, *p, *q, *iqmp, *dmp1, *dmq1;
nbyte = RSA_size(rsa);
hnbyte = (RSA_bits(rsa) + 15) >> 4;
@@ -556,7 +557,8 @@ static void write_rsa(unsigned char **out, RSA *rsa, int ispub)
static void write_dsa(unsigned char **out, DSA *dsa, int ispub)
{
int nbyte;
- BIGNUM *p = NULL, *q = NULL, *g = NULL, *pub_key = NULL, *priv_key = NULL;
+ const BIGNUM *p = NULL, *q = NULL, *g = NULL;
+ const BIGNUM *pub_key = NULL, *priv_key = NULL;
DSA_get0_pqg(dsa, &p, &q, &g);
DSA_get0_key(dsa, &pub_key, &priv_key);