diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-08-06 17:54:32 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-08-23 11:47:22 +0200 |
commit | a026fbf977ccac5c59597c9b2e1e1c288d0b1b69 (patch) | |
tree | 3a965bc926e1d91d4ca1c6d79622f703f87a8a52 /crypto | |
parent | 35da893f86a40d3711ed785bd8777c18238aee45 (diff) |
Constify some inputs buffers
remove useless cast to call ASN1_STRING_set
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/asn1/a_gentm.c | 3 | ||||
-rw-r--r-- | crypto/asn1/a_utctm.c | 3 | ||||
-rw-r--r-- | crypto/ocsp/ocsp_ext.c | 4 | ||||
-rw-r--r-- | crypto/x509/x_x509a.c | 4 |
4 files changed, 6 insertions, 8 deletions
diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c index 8d43ee5f53..c02c8d9acc 100644 --- a/crypto/asn1/a_gentm.c +++ b/crypto/asn1/a_gentm.c @@ -148,8 +148,7 @@ int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str) t.data = (unsigned char *)str; if (ASN1_GENERALIZEDTIME_check(&t)) { if (s != NULL) { - if (!ASN1_STRING_set((ASN1_STRING *)s, - (unsigned char *)str, t.length)) + if (!ASN1_STRING_set((ASN1_STRING *)s, str, t.length)) return 0; s->type = V_ASN1_GENERALIZEDTIME; } diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index eadc31a452..7916e300ef 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -119,8 +119,7 @@ int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str) t.data = (unsigned char *)str; if (ASN1_UTCTIME_check(&t)) { if (s != NULL) { - if (!ASN1_STRING_set((ASN1_STRING *)s, - (unsigned char *)str, t.length)) + if (!ASN1_STRING_set((ASN1_STRING *)s, str, t.length)) return 0; s->type = V_ASN1_UTCTIME; } diff --git a/crypto/ocsp/ocsp_ext.c b/crypto/ocsp/ocsp_ext.c index e60a8d3677..72d21796d2 100644 --- a/crypto/ocsp/ocsp_ext.c +++ b/crypto/ocsp/ocsp_ext.c @@ -357,7 +357,7 @@ int OCSP_copy_nonce(OCSP_BASICRESP *resp, OCSP_REQUEST *req) return OCSP_BASICRESP_add_ext(resp, req_ext, -1); } -X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim) +X509_EXTENSION *OCSP_crlID_new(const char *url, long *n, char *tim) { X509_EXTENSION *x = NULL; OCSP_CRLID *cid = NULL; @@ -430,7 +430,7 @@ X509_EXTENSION *OCSP_archive_cutoff_new(char *tim) * two--NID_ad_ocsp, NID_id_ad_caIssuers--and GeneralName value. This method * forces NID_ad_ocsp and uniformResourceLocator [6] IA5String. */ -X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, char **urls) +X509_EXTENSION *OCSP_url_svcloc_new(X509_NAME *issuer, const char **urls) { X509_EXTENSION *x = NULL; ASN1_IA5STRING *ia5 = NULL; diff --git a/crypto/x509/x_x509a.c b/crypto/x509/x_x509a.c index 4c8f48e3b5..8c9ad71d1b 100644 --- a/crypto/x509/x_x509a.c +++ b/crypto/x509/x_x509a.c @@ -47,7 +47,7 @@ static X509_CERT_AUX *aux_get(X509 *x) return x->aux; } -int X509_alias_set1(X509 *x, unsigned char *name, int len) +int X509_alias_set1(X509 *x, const unsigned char *name, int len) { X509_CERT_AUX *aux; if (!name) { @@ -64,7 +64,7 @@ int X509_alias_set1(X509 *x, unsigned char *name, int len) return ASN1_STRING_set(aux->alias, name, len); } -int X509_keyid_set1(X509 *x, unsigned char *id, int len) +int X509_keyid_set1(X509 *x, const unsigned char *id, int len) { X509_CERT_AUX *aux; if (!id) { |