summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-09-24 13:37:16 +0200
committerMatt Caswell <matt@openssl.org>2017-01-25 09:06:34 +0000
commitd2a56999985ccf56ea6c82e6fa2f91c345bbc9d3 (patch)
treece01aa43b9446862e64c01c383a300a63352243a /crypto/x509v3
parent28b86f313b43cc70d11054d3830ef82e7af8290a (diff)
Few nit's
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1618)
Diffstat (limited to 'crypto/x509v3')
-rw-r--r--crypto/x509v3/v3_alt.c7
-rw-r--r--crypto/x509v3/v3_ncons.c1
-rw-r--r--crypto/x509v3/v3_utl.c6
3 files changed, 8 insertions, 6 deletions
diff --git a/crypto/x509v3/v3_alt.c b/crypto/x509v3/v3_alt.c
index 0364e336a0..3062250d17 100644
--- a/crypto/x509v3/v3_alt.c
+++ b/crypto/x509v3/v3_alt.c
@@ -303,10 +303,12 @@ static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p)
ASN1_IA5STRING *email = NULL;
X509_NAME_ENTRY *ne;
GENERAL_NAME *gen = NULL;
- int i;
+ int i = -1;
+
if (ctx != NULL && ctx->flags == CTX_TEST)
return 1;
- if (!ctx || (!ctx->subject_cert && !ctx->subject_req)) {
+ if (ctx == NULL
+ || (ctx->subject_cert == NULL && ctx->subject_req == NULL)) {
X509V3err(X509V3_F_COPY_EMAIL, X509V3_R_NO_SUBJECT_DETAILS);
goto err;
}
@@ -317,7 +319,6 @@ static int copy_email(X509V3_CTX *ctx, GENERAL_NAMES *gens, int move_p)
nm = X509_REQ_get_subject_name(ctx->subject_req);
/* Now add any email address(es) to STACK */
- i = -1;
while ((i = X509_NAME_get_index_by_NID(nm,
NID_pkcs9_emailAddress, i)) >= 0) {
ne = X509_NAME_get_entry(nm, i);
diff --git a/crypto/x509v3/v3_ncons.c b/crypto/x509v3/v3_ncons.c
index 9b3bb128eb..36ff966a36 100644
--- a/crypto/x509v3/v3_ncons.c
+++ b/crypto/x509v3/v3_ncons.c
@@ -247,6 +247,7 @@ int NAME_CONSTRAINTS_check_CN(X509 *x, NAME_CONSTRAINTS *nc)
for (i = -1;;) {
X509_NAME_ENTRY *ne;
ASN1_STRING *hn;
+
i = X509_NAME_get_index_by_NID(nm, NID_commonName, i);
if (i == -1)
break;
diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c
index 7dc9a4533e..ac5217053a 100644
--- a/crypto/x509v3/v3_utl.c
+++ b/crypto/x509v3/v3_utl.c
@@ -424,11 +424,11 @@ static STACK_OF(OPENSSL_STRING) *get_email(X509_NAME *name,
{
STACK_OF(OPENSSL_STRING) *ret = NULL;
X509_NAME_ENTRY *ne;
- ASN1_IA5STRING *email;
+ const ASN1_IA5STRING *email;
GENERAL_NAME *gen;
- int i;
+ int i = -1;
+
/* Now add any email address(es) to STACK */
- i = -1;
/* First supplied X509_NAME */
while ((i = X509_NAME_get_index_by_NID(name,
NID_pkcs9_emailAddress, i)) >= 0) {