summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3/v3_alt.c
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-09-24 13:37:16 +0200
committerMatt Caswell <matt@openssl.org>2017-01-25 10:06:34 +0100
commitd2a56999985ccf56ea6c82e6fa2f91c345bbc9d3 (patch)
treece01aa43b9446862e64c01c383a300a63352243a /crypto/x509v3/v3_alt.c
parentFix some extra or missing whitespaces... (diff)
downloadopenssl-d2a56999985ccf56ea6c82e6fa2f91c345bbc9d3.tar.xz
openssl-d2a56999985ccf56ea6c82e6fa2f91c345bbc9d3.zip
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/v3_alt.c')
-rw-r--r--crypto/x509v3/v3_alt.c7
1 files changed, 4 insertions, 3 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);