Update to OpenSSL 1.0.2.o
This commit is contained in:
42
apps/req.c
42
apps/req.c
@@ -331,7 +331,6 @@ int MAIN(int argc, char **argv)
|
||||
else if (strcmp(*argv, "-text") == 0)
|
||||
text = 1;
|
||||
else if (strcmp(*argv, "-x509") == 0) {
|
||||
newreq = 1;
|
||||
x509 = 1;
|
||||
} else if (strcmp(*argv, "-asn1-kludge") == 0)
|
||||
kludge = 1;
|
||||
@@ -447,6 +446,9 @@ int MAIN(int argc, char **argv)
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (x509 && infile == NULL)
|
||||
newreq = 1;
|
||||
|
||||
ERR_load_crypto_strings();
|
||||
if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
|
||||
BIO_printf(bio_err, "Error getting passwords\n");
|
||||
@@ -753,7 +755,7 @@ int MAIN(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (newreq) {
|
||||
if (newreq || x509) {
|
||||
if (pkey == NULL) {
|
||||
BIO_printf(bio_err, "you need to specify a private key\n");
|
||||
goto end;
|
||||
@@ -1191,7 +1193,7 @@ static int prompt_info(X509_REQ *req,
|
||||
/* If OBJ not recognised ignore it */
|
||||
if ((nid = OBJ_txt2nid(type)) == NID_undef)
|
||||
goto start;
|
||||
if (BIO_snprintf(buf, sizeof buf, "%s_default", v->name)
|
||||
if (BIO_snprintf(buf, sizeof(buf), "%s_default", v->name)
|
||||
>= (int)sizeof(buf)) {
|
||||
BIO_printf(bio_err, "Name '%s' too long\n", v->name);
|
||||
return 0;
|
||||
@@ -1202,19 +1204,19 @@ static int prompt_info(X509_REQ *req,
|
||||
def = "";
|
||||
}
|
||||
|
||||
BIO_snprintf(buf, sizeof buf, "%s_value", v->name);
|
||||
BIO_snprintf(buf, sizeof(buf), "%s_value", v->name);
|
||||
if ((value = NCONF_get_string(req_conf, dn_sect, buf)) == NULL) {
|
||||
ERR_clear_error();
|
||||
value = NULL;
|
||||
}
|
||||
|
||||
BIO_snprintf(buf, sizeof buf, "%s_min", v->name);
|
||||
BIO_snprintf(buf, sizeof(buf), "%s_min", v->name);
|
||||
if (!NCONF_get_number(req_conf, dn_sect, buf, &n_min)) {
|
||||
ERR_clear_error();
|
||||
n_min = -1;
|
||||
}
|
||||
|
||||
BIO_snprintf(buf, sizeof buf, "%s_max", v->name);
|
||||
BIO_snprintf(buf, sizeof(buf), "%s_max", v->name);
|
||||
if (!NCONF_get_number(req_conf, dn_sect, buf, &n_max)) {
|
||||
ERR_clear_error();
|
||||
n_max = -1;
|
||||
@@ -1250,7 +1252,7 @@ static int prompt_info(X509_REQ *req,
|
||||
if ((nid = OBJ_txt2nid(type)) == NID_undef)
|
||||
goto start2;
|
||||
|
||||
if (BIO_snprintf(buf, sizeof buf, "%s_default", type)
|
||||
if (BIO_snprintf(buf, sizeof(buf), "%s_default", type)
|
||||
>= (int)sizeof(buf)) {
|
||||
BIO_printf(bio_err, "Name '%s' too long\n", v->name);
|
||||
return 0;
|
||||
@@ -1262,20 +1264,20 @@ static int prompt_info(X509_REQ *req,
|
||||
def = "";
|
||||
}
|
||||
|
||||
BIO_snprintf(buf, sizeof buf, "%s_value", type);
|
||||
BIO_snprintf(buf, sizeof(buf), "%s_value", type);
|
||||
if ((value = NCONF_get_string(req_conf, attr_sect, buf))
|
||||
== NULL) {
|
||||
ERR_clear_error();
|
||||
value = NULL;
|
||||
}
|
||||
|
||||
BIO_snprintf(buf, sizeof buf, "%s_min", type);
|
||||
BIO_snprintf(buf, sizeof(buf), "%s_min", type);
|
||||
if (!NCONF_get_number(req_conf, attr_sect, buf, &n_min)) {
|
||||
ERR_clear_error();
|
||||
n_min = -1;
|
||||
}
|
||||
|
||||
BIO_snprintf(buf, sizeof buf, "%s_max", type);
|
||||
BIO_snprintf(buf, sizeof(buf), "%s_max", type);
|
||||
if (!NCONF_get_number(req_conf, attr_sect, buf, &n_max)) {
|
||||
ERR_clear_error();
|
||||
n_max = -1;
|
||||
@@ -1370,13 +1372,13 @@ static int add_DN_object(X509_NAME *n, char *text, const char *def,
|
||||
BIO_printf(bio_err, "%s [%s]:", text, def);
|
||||
(void)BIO_flush(bio_err);
|
||||
if (value != NULL) {
|
||||
BUF_strlcpy(buf, value, sizeof buf);
|
||||
BUF_strlcat(buf, "\n", sizeof buf);
|
||||
BUF_strlcpy(buf, value, sizeof(buf));
|
||||
BUF_strlcat(buf, "\n", sizeof(buf));
|
||||
BIO_printf(bio_err, "%s\n", value);
|
||||
} else {
|
||||
buf[0] = '\0';
|
||||
if (!batch) {
|
||||
if (!fgets(buf, sizeof buf, stdin))
|
||||
if (!fgets(buf, sizeof(buf), stdin))
|
||||
return 0;
|
||||
} else {
|
||||
buf[0] = '\n';
|
||||
@@ -1389,8 +1391,8 @@ static int add_DN_object(X509_NAME *n, char *text, const char *def,
|
||||
else if (buf[0] == '\n') {
|
||||
if ((def == NULL) || (def[0] == '\0'))
|
||||
return (1);
|
||||
BUF_strlcpy(buf, def, sizeof buf);
|
||||
BUF_strlcat(buf, "\n", sizeof buf);
|
||||
BUF_strlcpy(buf, def, sizeof(buf));
|
||||
BUF_strlcat(buf, "\n", sizeof(buf));
|
||||
} else if ((buf[0] == '.') && (buf[1] == '\n'))
|
||||
return (1);
|
||||
|
||||
@@ -1429,13 +1431,13 @@ static int add_attribute_object(X509_REQ *req, char *text, const char *def,
|
||||
BIO_printf(bio_err, "%s [%s]:", text, def);
|
||||
(void)BIO_flush(bio_err);
|
||||
if (value != NULL) {
|
||||
BUF_strlcpy(buf, value, sizeof buf);
|
||||
BUF_strlcat(buf, "\n", sizeof buf);
|
||||
BUF_strlcpy(buf, value, sizeof(buf));
|
||||
BUF_strlcat(buf, "\n", sizeof(buf));
|
||||
BIO_printf(bio_err, "%s\n", value);
|
||||
} else {
|
||||
buf[0] = '\0';
|
||||
if (!batch) {
|
||||
if (!fgets(buf, sizeof buf, stdin))
|
||||
if (!fgets(buf, sizeof(buf), stdin))
|
||||
return 0;
|
||||
} else {
|
||||
buf[0] = '\n';
|
||||
@@ -1448,8 +1450,8 @@ static int add_attribute_object(X509_REQ *req, char *text, const char *def,
|
||||
else if (buf[0] == '\n') {
|
||||
if ((def == NULL) || (def[0] == '\0'))
|
||||
return (1);
|
||||
BUF_strlcpy(buf, def, sizeof buf);
|
||||
BUF_strlcat(buf, "\n", sizeof buf);
|
||||
BUF_strlcpy(buf, def, sizeof(buf));
|
||||
BUF_strlcat(buf, "\n", sizeof(buf));
|
||||
} else if ((buf[0] == '.') && (buf[1] == '\n'))
|
||||
return (1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user