diff options
author | Richard Levitte <levitte@openssl.org> | 2000-11-07 13:54:39 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-11-07 13:54:39 +0000 |
commit | a4aba800d9e0f81617d2f3d95d4fa99a4487bab2 (patch) | |
tree | eac98957868e4dc4af45182a91a7144c2ea1dc0b /crypto/asn1 | |
parent | 669cefdd3542e1dce8effeb8d898344c59608bfc (diff) | |
download | openssl-a4aba800d9e0f81617d2f3d95d4fa99a4487bab2.tar.gz |
Constify DSA-related code.
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/d2i_dsap.c | 2 | ||||
-rw-r--r-- | crypto/asn1/d2i_pr.c | 3 | ||||
-rw-r--r-- | crypto/asn1/d2i_pu.c | 3 | ||||
-rw-r--r-- | crypto/asn1/d2i_s_pr.c | 2 | ||||
-rw-r--r-- | crypto/asn1/d2i_s_pu.c | 2 | ||||
-rw-r--r-- | crypto/asn1/i2d_dsap.c | 2 | ||||
-rw-r--r-- | crypto/asn1/i2d_s_pr.c | 2 | ||||
-rw-r--r-- | crypto/asn1/i2d_s_pu.c | 2 | ||||
-rw-r--r-- | crypto/asn1/t_pkey.c | 8 | ||||
-rw-r--r-- | crypto/asn1/x_pubkey.c | 5 |
10 files changed, 17 insertions, 14 deletions
diff --git a/crypto/asn1/d2i_dsap.c b/crypto/asn1/d2i_dsap.c index 9d4dea6145..d97330791c 100644 --- a/crypto/asn1/d2i_dsap.c +++ b/crypto/asn1/d2i_dsap.c @@ -68,7 +68,7 @@ #define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER #endif -DSA *d2i_DSAparams(DSA **a, unsigned char **pp, long length) +DSA *d2i_DSAparams(DSA **a, const unsigned char **pp, long length) { int i=ERR_R_NESTED_ASN1_ERROR; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c index 6c3096d6ff..31584fe090 100644 --- a/crypto/asn1/d2i_pr.c +++ b/crypto/asn1/d2i_pr.c @@ -94,7 +94,8 @@ EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, unsigned char **pp, #endif #ifndef NO_DSA case EVP_PKEY_DSA: - if ((ret->pkey.dsa=d2i_DSAPrivateKey(NULL,pp,length)) == NULL) + if ((ret->pkey.dsa=d2i_DSAPrivateKey(NULL, + (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ { ASN1err(ASN1_F_D2I_PRIVATEKEY,ERR_R_ASN1_LIB); goto err; diff --git a/crypto/asn1/d2i_pu.c b/crypto/asn1/d2i_pu.c index fdbc0ac9e8..9eedde3de4 100644 --- a/crypto/asn1/d2i_pu.c +++ b/crypto/asn1/d2i_pu.c @@ -94,7 +94,8 @@ EVP_PKEY *d2i_PublicKey(int type, EVP_PKEY **a, unsigned char **pp, #endif #ifndef NO_DSA case EVP_PKEY_DSA: - if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL,pp,length)) == NULL) + if ((ret->pkey.dsa=d2i_DSAPublicKey(NULL, + (const unsigned char **)pp,length)) == NULL) /* TMP UGLY CAST */ { ASN1err(ASN1_F_D2I_PUBLICKEY,ERR_R_ASN1_LIB); goto err; diff --git a/crypto/asn1/d2i_s_pr.c b/crypto/asn1/d2i_s_pr.c index 55d5802d70..4722b26458 100644 --- a/crypto/asn1/d2i_s_pr.c +++ b/crypto/asn1/d2i_s_pr.c @@ -66,7 +66,7 @@ #include <openssl/objects.h> #include <openssl/asn1_mac.h> -DSA *d2i_DSAPrivateKey(DSA **a, unsigned char **pp, long length) +DSA *d2i_DSAPrivateKey(DSA **a, const unsigned char **pp, long length) { int i=ASN1_R_PARSING; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/d2i_s_pu.c b/crypto/asn1/d2i_s_pu.c index 0b7d2fafcc..4d1a772e8c 100644 --- a/crypto/asn1/d2i_s_pu.c +++ b/crypto/asn1/d2i_s_pu.c @@ -70,7 +70,7 @@ #define d2i_ASN1_INTEGER d2i_ASN1_UINTEGER #endif -DSA *d2i_DSAPublicKey(DSA **a, unsigned char **pp, long length) +DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length) { int i=ASN1_R_PARSING; ASN1_INTEGER *bs=NULL; diff --git a/crypto/asn1/i2d_dsap.c b/crypto/asn1/i2d_dsap.c index 157fb43893..028957992e 100644 --- a/crypto/asn1/i2d_dsap.c +++ b/crypto/asn1/i2d_dsap.c @@ -63,7 +63,7 @@ #include <openssl/asn1_mac.h> #include <openssl/dsa.h> -int i2d_DSAparams(DSA *a, unsigned char **pp) +int i2d_DSAparams(const DSA *a, unsigned char **pp) { BIGNUM *num[3]; ASN1_INTEGER bs; diff --git a/crypto/asn1/i2d_s_pr.c b/crypto/asn1/i2d_s_pr.c index 9922952ad7..124ad98285 100644 --- a/crypto/asn1/i2d_s_pr.c +++ b/crypto/asn1/i2d_s_pr.c @@ -64,7 +64,7 @@ #include <openssl/objects.h> #include <openssl/asn1_mac.h> -int i2d_DSAPrivateKey(DSA *a, unsigned char **pp) +int i2d_DSAPrivateKey(const DSA *a, unsigned char **pp) { BIGNUM *num[6]; unsigned char data[1]; diff --git a/crypto/asn1/i2d_s_pu.c b/crypto/asn1/i2d_s_pu.c index e6014b82a8..96e9ff595b 100644 --- a/crypto/asn1/i2d_s_pu.c +++ b/crypto/asn1/i2d_s_pu.c @@ -64,7 +64,7 @@ #include <openssl/objects.h> #include <openssl/asn1_mac.h> -int i2d_DSAPublicKey(DSA *a, unsigned char **pp) +int i2d_DSAPublicKey(const DSA *a, unsigned char **pp) { BIGNUM *num[4]; ASN1_INTEGER bs; diff --git a/crypto/asn1/t_pkey.c b/crypto/asn1/t_pkey.c index f204326386..644349df4e 100644 --- a/crypto/asn1/t_pkey.c +++ b/crypto/asn1/t_pkey.c @@ -140,7 +140,7 @@ err: #ifndef NO_DSA #ifndef NO_FP_API -int DSA_print_fp(FILE *fp, DSA *x, int off) +int DSA_print_fp(FILE *fp, const DSA *x, int off) { BIO *b; int ret; @@ -157,7 +157,7 @@ int DSA_print_fp(FILE *fp, DSA *x, int off) } #endif -int DSA_print(BIO *bp, DSA *x, int off) +int DSA_print(BIO *bp, const DSA *x, int off) { char str[128]; unsigned char *m=NULL; @@ -314,7 +314,7 @@ err: #ifndef NO_DSA #ifndef NO_FP_API -int DSAparams_print_fp(FILE *fp, DSA *x) +int DSAparams_print_fp(FILE *fp, const DSA *x) { BIO *b; int ret; @@ -331,7 +331,7 @@ int DSAparams_print_fp(FILE *fp, DSA *x) } #endif -int DSAparams_print(BIO *bp, DSA *x) +int DSAparams_print(BIO *bp, const DSA *x) { unsigned char *m=NULL; int reason=ERR_R_BUF_LIB,i,ret=0; diff --git a/crypto/asn1/x_pubkey.c b/crypto/asn1/x_pubkey.c index b2e2a51477..8d1dbce22e 100644 --- a/crypto/asn1/x_pubkey.c +++ b/crypto/asn1/x_pubkey.c @@ -206,6 +206,7 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) long j; int type; unsigned char *p; + const unsigned char *cp; #ifndef NO_DSA X509_ALGOR *a; #endif @@ -237,9 +238,9 @@ EVP_PKEY *X509_PUBKEY_get(X509_PUBKEY *key) if (a->parameter->type == V_ASN1_SEQUENCE) { ret->pkey.dsa->write_params=0; - p=a->parameter->value.sequence->data; + cp=p=a->parameter->value.sequence->data; j=a->parameter->value.sequence->length; - if (!d2i_DSAparams(&ret->pkey.dsa,&p,(long)j)) + if (!d2i_DSAparams(&ret->pkey.dsa,&cp,(long)j)) goto err; } ret->save_parameters=1; |