diff options
author | Richard Levitte <levitte@openssl.org> | 2004-03-15 23:15:26 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2004-03-15 23:15:26 +0000 |
commit | 875a644a9047e96dfcce27af876d30460759805e (patch) | |
tree | 901dfcdc9d6e9a7fb676e5e80689bddfd05c4338 /crypto/x509 | |
parent | ec37635c948e2cda2dc55e8b3630f516a4b06fd7 (diff) |
Constify d2i, s2i, c2i and r2i functions and other associated
functions and macros.
This change has associated tags: LEVITTE_before_const and
LEVITTE_after_const. Those will be removed when this change has been
properly reviewed.
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x509.h | 12 | ||||
-rw-r--r-- | crypto/x509/x509_req.c | 3 | ||||
-rw-r--r-- | crypto/x509/x509spki.c | 3 |
3 files changed, 10 insertions, 8 deletions
diff --git a/crypto/x509/x509.h b/crypto/x509/x509.h index 9b26b24ef3..e7d2c5ba52 100644 --- a/crypto/x509/x509.h +++ b/crypto/x509/x509.h @@ -884,21 +884,21 @@ EVP_PKEY * X509_PUBKEY_get(X509_PUBKEY *key); int X509_get_pubkey_parameters(EVP_PKEY *pkey, STACK_OF(X509) *chain); int i2d_PUBKEY(EVP_PKEY *a,unsigned char **pp); -EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,unsigned char **pp, +EVP_PKEY * d2i_PUBKEY(EVP_PKEY **a,const unsigned char **pp, long length); #ifndef OPENSSL_NO_RSA int i2d_RSA_PUBKEY(RSA *a,unsigned char **pp); -RSA * d2i_RSA_PUBKEY(RSA **a,unsigned char **pp, +RSA * d2i_RSA_PUBKEY(RSA **a,const unsigned char **pp, long length); #endif #ifndef OPENSSL_NO_DSA int i2d_DSA_PUBKEY(DSA *a,unsigned char **pp); -DSA * d2i_DSA_PUBKEY(DSA **a,unsigned char **pp, +DSA * d2i_DSA_PUBKEY(DSA **a,const unsigned char **pp, long length); #endif #ifndef OPENSSL_NO_EC int i2d_EC_PUBKEY(EC_KEY *a, unsigned char **pp); -EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, unsigned char **pp, +EC_KEY *d2i_EC_PUBKEY(EC_KEY **a, const unsigned char **pp, long length); #endif @@ -929,7 +929,7 @@ int X509_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, int X509_set_ex_data(X509 *r, int idx, void *arg); void *X509_get_ex_data(X509 *r, int idx); int i2d_X509_AUX(X509 *a,unsigned char **pp); -X509 * d2i_X509_AUX(X509 **a,unsigned char **pp,long length); +X509 * d2i_X509_AUX(X509 **a,const unsigned char **pp,long length); int X509_alias_set1(X509 *x, unsigned char *name, int len); int X509_keyid_set1(X509 *x, unsigned char *id, int len); @@ -951,7 +951,7 @@ int X509_CRL_add0_revoked(X509_CRL *crl, X509_REVOKED *rev); X509_PKEY * X509_PKEY_new(void ); void X509_PKEY_free(X509_PKEY *a); int i2d_X509_PKEY(X509_PKEY *a,unsigned char **pp); -X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,unsigned char **pp,long length); +X509_PKEY * d2i_X509_PKEY(X509_PKEY **a,const unsigned char **pp,long length); DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKI) DECLARE_ASN1_FUNCTIONS(NETSCAPE_SPKAC) diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c index b4ad53431e..f70c6ab075 100644 --- a/crypto/x509/x509_req.c +++ b/crypto/x509/x509_req.c @@ -188,7 +188,8 @@ STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req) STACK_OF(X509_ATTRIBUTE) *sk; ASN1_TYPE *ext = NULL; int i; - unsigned char *p; + const unsigned char *p; + if ((req == NULL) || (req->req_info == NULL)) return(NULL); sk=req->req_info->attributes; diff --git a/crypto/x509/x509spki.c b/crypto/x509/x509spki.c index 4c3af946ec..ed868b838e 100644 --- a/crypto/x509/x509spki.c +++ b/crypto/x509/x509spki.c @@ -77,7 +77,8 @@ EVP_PKEY *NETSCAPE_SPKI_get_pubkey(NETSCAPE_SPKI *x) NETSCAPE_SPKI * NETSCAPE_SPKI_b64_decode(const char *str, int len) { - unsigned char *spki_der, *p; + unsigned char *spki_der; + const unsigned char *p; int spki_len; NETSCAPE_SPKI *spki; if(len <= 0) len = strlen(str); |