diff options
author | FdaSilvaYY <fdasilvayy@gmail.com> | 2016-07-07 23:45:55 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-08-23 11:47:22 +0200 |
commit | 9f5466b9b86607bb62239873e6be2de1fe9f71fb (patch) | |
tree | 5726015f77d40cdb31560353bb214eb8d1b24ca5 /crypto/x509v3 | |
parent | bf9d5e483db0683178f43ef74a4ae6577482db83 (diff) |
Constify some X509_NAME, ASN1 printing code
ASN1_buf_print, asn1_print_*, X509_NAME_oneline, X509_NAME_print
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/x509v3')
-rw-r--r-- | crypto/x509v3/v3_ncons.c | 3 | ||||
-rw-r--r-- | crypto/x509v3/v3_utl.c | 9 |
2 files changed, 6 insertions, 6 deletions
diff --git a/crypto/x509v3/v3_ncons.c b/crypto/x509v3/v3_ncons.c index fe3a9078f7..9b3bb128eb 100644 --- a/crypto/x509v3/v3_ncons.c +++ b/crypto/x509v3/v3_ncons.c @@ -199,7 +199,8 @@ int NAME_CONSTRAINTS_check(X509 *x, NAME_CONSTRAINTS *nc) /* Process any email address attributes in subject name */ for (i = -1;;) { - X509_NAME_ENTRY *ne; + const X509_NAME_ENTRY *ne; + i = X509_NAME_get_index_by_NID(nm, NID_pkcs9_emailAddress, i); if (i == -1) break; diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c index 2e4d08e02b..05edd85cf4 100644 --- a/crypto/x509v3/v3_utl.c +++ b/crypto/x509v3/v3_utl.c @@ -734,7 +734,7 @@ static int equal_wildcard(const unsigned char *pattern, size_t pattern_len, * to UTF8. */ -static int do_check_string(ASN1_STRING *a, int cmp_type, equal_fn equal, +static int do_check_string(const ASN1_STRING *a, int cmp_type, equal_fn equal, unsigned int flags, const char *b, size_t blen, char **peername) { @@ -840,10 +840,9 @@ static int do_x509_check(X509 *x, const char *chk, size_t chklen, i = -1; name = X509_get_subject_name(x); while ((i = X509_NAME_get_index_by_NID(name, cnid, i)) >= 0) { - X509_NAME_ENTRY *ne; - ASN1_STRING *str; - ne = X509_NAME_get_entry(name, i); - str = X509_NAME_ENTRY_get_data(ne); + const X509_NAME_ENTRY *ne = X509_NAME_get_entry(name, i); + const ASN1_STRING *str = X509_NAME_ENTRY_get_data(ne); + /* Positive on success, negative on error! */ if ((rv = do_check_string(str, -1, equal, flags, chk, chklen, peername)) != 0) |