version 1.20, 2015/12/24 16:54:37 |
version 1.21, 2016/08/30 11:32:28 |
|
|
STACK_OF(CONF_VALUE) * attribs = NULL; |
STACK_OF(CONF_VALUE) * attribs = NULL; |
STACK_OF(X509) * cert_sk = NULL; |
STACK_OF(X509) * cert_sk = NULL; |
STACK_OF(OPENSSL_STRING) * sigopts = NULL; |
STACK_OF(OPENSSL_STRING) * sigopts = NULL; |
#define BUFLEN 256 |
|
char buf[3][BUFLEN]; |
|
char *tofree = NULL; |
char *tofree = NULL; |
const char *errstr = NULL; |
const char *errstr = NULL; |
DB_ATTR db_attr; |
DB_ATTR db_attr; |
|
|
|
|
if (sk_X509_num(cert_sk) > 0) { |
if (sk_X509_num(cert_sk) > 0) { |
if (!batch) { |
if (!batch) { |
|
char answer[10]; |
|
|
BIO_printf(bio_err, "\n%d out of %d certificate requests certified, commit? [y/n]", total_done, total); |
BIO_printf(bio_err, "\n%d out of %d certificate requests certified, commit? [y/n]", total_done, total); |
(void) BIO_flush(bio_err); |
(void) BIO_flush(bio_err); |
buf[0][0] = '\0'; |
if (!fgets(answer, sizeof answer - 1, stdin)) { |
if (!fgets(buf[0], 10, stdin)) { |
|
BIO_printf(bio_err, "CERTIFICATION CANCELED: I/O error\n"); |
BIO_printf(bio_err, "CERTIFICATION CANCELED: I/O error\n"); |
ret = 0; |
ret = 0; |
goto err; |
goto err; |
} |
} |
if ((buf[0][0] != 'y') && (buf[0][0] != 'Y')) { |
if ((answer[0] != 'y') && (answer[0] != 'Y')) { |
BIO_printf(bio_err, "CERTIFICATION CANCELED\n"); |
BIO_printf(bio_err, "CERTIFICATION CANCELED\n"); |
ret = 0; |
ret = 0; |
goto err; |
goto err; |
|
|
int k; |
int k; |
char *serialstr; |
char *serialstr; |
unsigned char *data; |
unsigned char *data; |
|
char pempath[PATH_MAX]; |
|
|
x = sk_X509_value(cert_sk, i); |
x = sk_X509_value(cert_sk, i); |
|
|
|
|
else |
else |
serialstr = strdup("00"); |
serialstr = strdup("00"); |
if (serialstr) { |
if (serialstr) { |
k = snprintf(buf[2], sizeof(buf[2]), |
k = snprintf(pempath, sizeof(pempath), |
"%s/%s.pem", outdir, serialstr); |
"%s/%s.pem", outdir, serialstr); |
free(serialstr); |
free(serialstr); |
if (k == -1 || k >= sizeof(buf[2])) { |
if (k == -1 || k >= sizeof(pempath)) { |
BIO_printf(bio_err, |
BIO_printf(bio_err, |
"certificate file name too long\n"); |
"certificate file name too long\n"); |
goto err; |
goto err; |
|
|
goto err; |
goto err; |
} |
} |
if (verbose) |
if (verbose) |
BIO_printf(bio_err, "writing %s\n", buf[2]); |
BIO_printf(bio_err, "writing %s\n", pempath); |
|
|
if (BIO_write_filename(Cout, buf[2]) <= 0) { |
if (BIO_write_filename(Cout, pempath) <= 0) { |
perror(buf[2]); |
perror(pempath); |
goto err; |
goto err; |
} |
} |
write_new_certificate(Cout, x, 0, notext); |
write_new_certificate(Cout, x, 0, notext); |
|
|
OPENSSL_STRING row[DB_NUMBER]; |
OPENSSL_STRING row[DB_NUMBER]; |
OPENSSL_STRING *irow = NULL; |
OPENSSL_STRING *irow = NULL; |
OPENSSL_STRING *rrow = NULL; |
OPENSSL_STRING *rrow = NULL; |
char buf[25]; |
|
|
|
tmptm = ASN1_UTCTIME_new(); |
tmptm = ASN1_UTCTIME_new(); |
if (tmptm == NULL) { |
if (tmptm == NULL) { |
|
|
BIO_printf(bio_err, "\n"); |
BIO_printf(bio_err, "\n"); |
|
|
if (!batch) { |
if (!batch) { |
|
char answer[25]; |
|
|
BIO_printf(bio_err, "Sign the certificate? [y/n]:"); |
BIO_printf(bio_err, "Sign the certificate? [y/n]:"); |
(void) BIO_flush(bio_err); |
(void) BIO_flush(bio_err); |
buf[0] = '\0'; |
if (!fgets(answer, sizeof(answer) - 1, stdin)) { |
if (!fgets(buf, sizeof(buf) - 1, stdin)) { |
|
BIO_printf(bio_err, |
BIO_printf(bio_err, |
"CERTIFICATE WILL NOT BE CERTIFIED: I/O error\n"); |
"CERTIFICATE WILL NOT BE CERTIFIED: I/O error\n"); |
ok = 0; |
ok = 0; |
goto err; |
goto err; |
} |
} |
if (!((buf[0] == 'y') || (buf[0] == 'Y'))) { |
if (!((answer[0] == 'y') || (answer[0] == 'Y'))) { |
BIO_printf(bio_err, |
BIO_printf(bio_err, |
"CERTIFICATE WILL NOT BE CERTIFIED\n"); |
"CERTIFICATE WILL NOT BE CERTIFIED\n"); |
ok = 0; |
ok = 0; |