j=x->cert_info->serialNumber->length;
p=(char *)x->cert_info->serialNumber->data;
- if(strlen(outdir) >= (j ? BSIZE-j*2-6 : BSIZE-8))
+ if(strlen(outdir) >= (size_t)(j ? BSIZE-j*2-6 : BSIZE-8))
{
BIO_printf(bio_err,"certificate file name too long\n");
goto err;
if (pkey->type == EVP_PKEY_DSA)
dgst=EVP_dss1();
else
-#endif
-#ifndef OPENSSL_NO_ECDSA
- if (pkey->type == EVP_PKEY_EC)
- dgst=EVP_ecdsa();
- else
#endif
dgst=EVP_md5();
}
}
j=TXT_DB_write(out,db);
if (j <= 0) goto err;
+ BIO_free_all(out);
+ out = NULL;
+ BIO_free_all(in);
+ in = NULL;
strncpy(buf[1],dbfile,BSIZE-4);
buf[1][BSIZE-4]='\0';
#ifndef OPENSSL_SYS_VMS
#else
strcat(buf[1],"-old");
#endif
- BIO_free(in);
- in = NULL;
- BIO_free(out);
- out = NULL;
if (rename(dbfile,buf[1]) < 0)
{
BIO_printf(bio_err,"unable to rename %s to %s\n", dbfile, buf[1]);
EVP_PKEY_copy_parameters(pktmp,pkey);
EVP_PKEY_free(pktmp);
#endif
-#ifndef OPENSSL_NO_ECDSA
- if (pkey->type == EVP_PKEY_EC)
- dgst = EVP_ecdsa();
- pktmp = X509_get_pubkey(ret);
- if (EVP_PKEY_missing_parameters(pktmp) &&
- !EVP_PKEY_missing_parameters(pkey))
- EVP_PKEY_copy_parameters(pktmp, pkey);
- EVP_PKEY_free(pktmp);
-#endif
-
if (!X509_sign(ret,pkey,dgst))
goto err;
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)
{
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';
ne_num++;
- }
+ }
if (!(n = X509_NAME_new()))
goto error;