aboutsummaryrefslogtreecommitdiffstats
path: root/apps/ca.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2002-10-23 13:11:38 +0000
committerBodo Möller <bodo@openssl.org>2002-10-23 13:11:38 +0000
commit907a8f1e6ef1166c9089841e130b6312b2956c8b (patch)
tree57aeedefb2f0068215b90a40f6df34b6a832ffba /apps/ca.c
parente1c191fe44513f3ac22b8890fb45a7cc934f3b57 (diff)
downloadopenssl-907a8f1e6ef1166c9089841e130b6312b2956c8b.tar.gz
fix warnings, and harmonize indentation
Diffstat (limited to 'apps/ca.c')
-rw-r--r--apps/ca.c44
1 files changed, 24 insertions, 20 deletions
diff --git a/apps/ca.c b/apps/ca.c
index 22c9f820c5..4867f309c7 100644
--- a/apps/ca.c
+++ b/apps/ca.c
@@ -3055,68 +3055,72 @@ X509_NAME *do_subject(char *subject, long chtype)
int nid;
if (!buf || !ne_types || !ne_values)
- {
+ {
BIO_printf(bio_err, "malloc error\n");
goto error;
- }
+ }
if (*subject != '/')
- {
+ {
BIO_printf(bio_err, "Subject does not start with '/'.\n");
goto error;
- }
+ }
sp++; /* skip leading / */
while (*sp)
- {
+ {
/* collect type */
ne_types[ne_num] = bp;
while (*sp)
- {
+ {
if (*sp == '\\') /* is there anything to escape in the type...? */
+ {
if (*++sp)
*bp++ = *sp++;
- else
- {
+ else
+ {
BIO_printf(bio_err, "escape character at end of string\n");
goto error;
- }
+ }
+ }
else if (*sp == '=')
- {
+ {
sp++;
*bp++ = '\0';
break;
- }
+ }
else
*bp++ = *sp++;
- }
+ }
if (!*sp)
- {
+ {
BIO_printf(bio_err, "end of string encountered while processing type of subject name element #%d\n", ne_num);
goto error;
- }
+ }
ne_values[ne_num] = bp;
while (*sp)
- {
+ {
if (*sp == '\\')
+ {
if (*++sp)
*bp++ = *sp++;
else
- {
+ {
BIO_printf(bio_err, "escape character at end of string\n");
goto error;
+ }
}
else if (*sp == '/')
- {
+ {
sp++;
break;
- }
+ }
else
*bp++ = *sp++;
- }
+ }
*bp++ = '\0';
ne_num++;
- }
+ }
if (!(n = X509_NAME_new()))
goto error;