diff options
Diffstat (limited to 'lib/libssl/src/apps/req.c')
| -rw-r--r-- | lib/libssl/src/apps/req.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/libssl/src/apps/req.c b/lib/libssl/src/apps/req.c index c6464e9401e..1a3d1d0dfab 100644 --- a/lib/libssl/src/apps/req.c +++ b/lib/libssl/src/apps/req.c @@ -824,7 +824,7 @@ loop: if ((x509ss=X509_new()) == NULL) goto end; /* Set version to V3 */ - if(!X509_set_version(x509ss, 2)) goto end; + if(extensions && !X509_set_version(x509ss, 2)) goto end; if (serial) { if (!X509_set_serialNumber(x509ss, serial)) goto end; @@ -1223,7 +1223,7 @@ start: for (;;) } /* If OBJ not recognised ignore it */ if ((nid=OBJ_txt2nid(type)) == NID_undef) goto start; - if (snprintf(buf,sizeof buf,"%s_default",v->name) + if (BIO_snprintf(buf,sizeof buf,"%s_default",v->name) >= sizeof buf) { BIO_printf(bio_err,"Name '%s' too long\n",v->name); @@ -1236,21 +1236,21 @@ start: for (;;) def=""; } - 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; } - 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; } - 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(); @@ -1288,7 +1288,7 @@ start2: for (;;) if ((nid=OBJ_txt2nid(type)) == NID_undef) goto start2; - if (snprintf(buf,sizeof buf,"%s_default",type) + if (BIO_snprintf(buf,sizeof buf,"%s_default",type) >= sizeof buf) { BIO_printf(bio_err,"Name '%s' too long\n",v->name); @@ -1303,7 +1303,7 @@ start2: for (;;) } - 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) { @@ -1311,11 +1311,11 @@ start2: for (;;) value=NULL; } - 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)) n_min = -1; - 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)) n_max = -1; @@ -1397,8 +1397,8 @@ start: (void)BIO_flush(bio_err); if(value != NULL) { - strlcpy(buf,value,sizeof 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 @@ -1420,8 +1420,8 @@ start: { if ((def == NULL) || (def[0] == '\0')) return(1); - strlcpy(buf,def,sizeof 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); @@ -1455,8 +1455,8 @@ start: (void)BIO_flush(bio_err); if (value != NULL) { - strlcpy(buf,value,sizeof 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 @@ -1478,8 +1478,8 @@ start: { if ((def == NULL) || (def[0] == '\0')) return(1); - strlcpy(buf,def,sizeof 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); |
