end:
if (x == NULL && desc != NULL) {
- BIO_printf(bio_err, "unable to load %s\n", desc);
+ BIO_printf(bio_err, "Unable to load %s\n", desc);
ERR_print_errors(bio_err);
}
BIO_free(cert);
end:
if (x == NULL && desc != NULL) {
- BIO_printf(bio_err, "unable to load %s\n", desc);
+ BIO_printf(bio_err, "Unable to load %s\n", desc);
ERR_print_errors(bio_err);
}
BIO_free(in);
end:
if (req == NULL && desc != NULL) {
- BIO_printf(bio_err, "unable to load %s\n", desc);
+ BIO_printf(bio_err, "Unable to load %s\n", desc);
ERR_print_errors(bio_err);
}
BIO_free(in);
cb_data.prompt_info = file;
if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
- BIO_printf(bio_err, "no keyfile specified\n");
+ BIO_printf(bio_err, "No keyfile specified\n");
goto end;
}
if (format == FORMAT_ENGINE) {
if (e == NULL) {
- BIO_printf(bio_err, "no engine specified\n");
+ BIO_printf(bio_err, "No engine specified\n");
} else {
#ifndef OPENSSL_NO_ENGINE
if (ENGINE_init(e)) {
ENGINE_finish(e);
}
if (pkey == NULL && desc != NULL) {
- BIO_printf(bio_err, "cannot load %s from engine\n", desc);
+ BIO_printf(bio_err, "Cannot load %s from engine\n", desc);
ERR_print_errors(bio_err);
}
#else
- BIO_printf(bio_err, "engines not supported\n");
+ BIO_printf(bio_err, "Engines not supported\n");
#endif
}
goto end;
end:
BIO_free(key);
if (pkey == NULL && desc != NULL) {
- BIO_printf(bio_err, "unable to load %s\n", desc);
+ BIO_printf(bio_err, "Unable to load %s\n", desc);
ERR_print_errors(bio_err);
}
return pkey;
cb_data.prompt_info = file;
if (file == NULL && (!maybe_stdin || format == FORMAT_ENGINE)) {
- BIO_printf(bio_err, "no keyfile specified\n");
+ BIO_printf(bio_err, "No keyfile specified\n");
goto end;
}
if (format == FORMAT_ENGINE) {
if (e == NULL) {
- BIO_printf(bio_err, "no engine specified\n");
+ BIO_printf(bio_err, "No engine specified\n");
} else {
#ifndef OPENSSL_NO_ENGINE
pkey = ENGINE_load_public_key(e, file, (UI_METHOD *)get_ui_method(),
&cb_data);
if (pkey == NULL && desc != NULL) {
- BIO_printf(bio_err, "cannot load %s from engine\n", desc);
+ BIO_printf(bio_err, "Cannot load %s from engine\n", desc);
ERR_print_errors(bio_err);
}
#else
- BIO_printf(bio_err, "engines not supported\n");
+ BIO_printf(bio_err, "Engines not supported\n");
#endif
}
goto end;
end:
BIO_free(key);
if (pkey == NULL && desc != NULL) {
- BIO_printf(bio_err, "unable to load %s\n", desc);
+ BIO_printf(bio_err, "Unable to load %s\n", desc);
ERR_print_errors(bio_err);
}
return pkey;
cb_data.prompt_info = file;
if (format != FORMAT_PEM) {
- BIO_printf(bio_err, "bad input format specified for %s\n", desc);
+ BIO_printf(bio_err, "Bad input format specified for %s\n", desc);
return 0;
}
*pcrls = NULL;
}
if (desc != NULL) {
- BIO_printf(bio_err, "unable to load %s for %s\n",
+ BIO_printf(bio_err, "Unable to load %s for %s\n",
pcerts ? "certificates" : "CRLs", desc);
ERR_print_errors(bio_err);
}
ERR_clear_error();
return store;
end:
+ ERR_print_errors(bio_err);
X509_STORE_free(store);
return NULL;
}
#ifndef OPENSSL_NO_ENGINE
if (engine != NULL) {
if (strcmp(engine, "auto") == 0) {
- BIO_printf(bio_err, "enabling auto ENGINE support\n");
+ BIO_printf(bio_err, "Enabling auto ENGINE support\n");
ENGINE_register_all_complete();
return NULL;
}
if ((e = ENGINE_by_id(engine)) == NULL
&& (e = try_load_engine(engine)) == NULL) {
- BIO_printf(bio_err, "invalid engine \"%s\"\n", engine);
+ BIO_printf(bio_err, "Invalid engine \"%s\"\n", engine);
ERR_print_errors(bio_err);
return NULL;
}
ENGINE_ctrl_cmd(e, "SET_USER_INTERFACE", 0, (void *)get_ui_method(),
0, 1);
if (!ENGINE_set_default(e, ENGINE_METHOD_ALL)) {
- BIO_printf(bio_err, "can't use that engine\n");
+ BIO_printf(bio_err, "Cannot use engine \"%s\"\n", ENGINE_get_id(e));
ERR_print_errors(bio_err);
ENGINE_free(e);
return NULL;
}
- BIO_printf(bio_err, "engine \"%s\" set.\n", ENGINE_get_id(e));
+ BIO_printf(bio_err, "Engine \"%s\" set.\n", ENGINE_get_id(e));
}
#endif
return e;
BIO_printf(bio_err, "Out of memory\n");
} else {
if (!a2i_ASN1_INTEGER(in, ai, buf, 1024)) {
- BIO_printf(bio_err, "unable to load number from %s\n",
+ BIO_printf(bio_err, "Unable to load number from %s\n",
serialfile);
goto err;
}
ret = ASN1_INTEGER_to_BN(ai, NULL);
if (ret == NULL) {
- BIO_printf(bio_err,
- "error converting number from bin to BIGNUM\n");
+ BIO_printf(bio_err, "Error converting number from bin to BIGNUM\n");
goto err;
}
}
ai = NULL;
}
err:
+ ERR_print_errors(bio_err);
BIO_free(in);
ASN1_INTEGER_free(ai);
return ret;
else
j = strlen(serialfile) + strlen(suffix) + 1;
if (j >= BSIZE) {
- BIO_printf(bio_err, "file name too long\n");
+ BIO_printf(bio_err, "File name too long\n");
goto err;
}
}
out = BIO_new_file(buf[0], "w");
if (out == NULL) {
- ERR_print_errors(bio_err);
goto err;
}
ai = NULL;
}
err:
+ if (!ret)
+ ERR_print_errors(bio_err);
BIO_free_all(out);
ASN1_INTEGER_free(ai);
return ret;
if (i > j)
j = i;
if (j + 1 >= BSIZE) {
- BIO_printf(bio_err, "file name too long\n");
+ BIO_printf(bio_err, "File name too long\n");
goto err;
}
#ifndef OPENSSL_SYS_VMS
#endif
) {
BIO_printf(bio_err,
- "unable to rename %s to %s\n", serialfile, buf[1]);
+ "Unable to rename %s to %s\n", serialfile, buf[1]);
perror("reason");
goto err;
}
if (rename(buf[0], serialfile) < 0) {
BIO_printf(bio_err,
- "unable to rename %s to %s\n", buf[0], serialfile);
+ "Unable to rename %s to %s\n", buf[0], serialfile);
perror("reason");
rename(buf[1], serialfile);
goto err;
}
return 1;
err:
+ ERR_print_errors(bio_err);
return 0;
}
#endif
in = BIO_new_file(dbfile, "r");
- if (in == NULL) {
- ERR_print_errors(bio_err);
+ if (in == NULL)
goto err;
- }
#ifndef OPENSSL_NO_POSIX_IO
BIO_get_fp(in, &dbfp);
if (fstat(fileno(dbfp), &dbst) == -1) {
ERR_raise_data(ERR_LIB_SYS, errno,
"calling fstat(%s)", dbfile);
- ERR_print_errors(bio_err);
goto err;
}
#endif
#endif
err:
+ ERR_print_errors(bio_err);
NCONF_free(dbattr_conf);
TXT_DB_free(tmpdb);
BIO_free_all(in);
LHASH_HASH_FN(index_serial),
LHASH_COMP_FN(index_serial))) {
BIO_printf(bio_err,
- "error creating serial number index:(%ld,%ld,%ld)\n",
+ "Error creating serial number index:(%ld,%ld,%ld)\n",
db->db->error, db->db->arg1, db->db->arg2);
- return 0;
+ goto err;
}
if (db->attributes.unique_subject
&& !TXT_DB_create_index(db->db, DB_name, index_name_qual,
LHASH_HASH_FN(index_name),
LHASH_COMP_FN(index_name))) {
- BIO_printf(bio_err, "error creating name index:(%ld,%ld,%ld)\n",
+ BIO_printf(bio_err, "Error creating name index:(%ld,%ld,%ld)\n",
db->db->error, db->db->arg1, db->db->arg2);
- return 0;
+ goto err;
}
return 1;
+ err:
+ ERR_print_errors(bio_err);
+ return 0;
}
int save_index(const char *dbfile, const char *suffix, CA_DB *db)
j = strlen(dbfile) + strlen(suffix);
if (j + 6 >= BSIZE) {
- BIO_printf(bio_err, "file name too long\n");
+ BIO_printf(bio_err, "File name too long\n");
goto err;
}
#ifndef OPENSSL_SYS_VMS
out = BIO_new_file(buf[0], "w");
if (out == NULL) {
perror(dbfile);
- BIO_printf(bio_err, "unable to open '%s'\n", dbfile);
+ BIO_printf(bio_err, "Unable to open '%s'\n", dbfile);
goto err;
}
j = TXT_DB_write(out, db->db);
out = BIO_new_file(buf[1], "w");
if (out == NULL) {
perror(buf[2]);
- BIO_printf(bio_err, "unable to open '%s'\n", buf[2]);
+ BIO_printf(bio_err, "Unable to open '%s'\n", buf[2]);
goto err;
}
BIO_printf(out, "unique_subject = %s\n",
return 1;
err:
+ ERR_print_errors(bio_err);
return 0;
}
if (i > j)
j = i;
if (j + 6 >= BSIZE) {
- BIO_printf(bio_err, "file name too long\n");
+ BIO_printf(bio_err, "File name too long\n");
goto err;
}
#ifndef OPENSSL_SYS_VMS
&& errno != ENOTDIR
#endif
) {
- BIO_printf(bio_err, "unable to rename %s to %s\n", dbfile, buf[1]);
+ BIO_printf(bio_err, "Unable to rename %s to %s\n", dbfile, buf[1]);
perror("reason");
goto err;
}
if (rename(buf[0], dbfile) < 0) {
- BIO_printf(bio_err, "unable to rename %s to %s\n", buf[0], dbfile);
+ BIO_printf(bio_err, "Unable to rename %s to %s\n", buf[0], dbfile);
perror("reason");
rename(buf[1], dbfile);
goto err;
&& errno != ENOTDIR
#endif
) {
- BIO_printf(bio_err, "unable to rename %s to %s\n", buf[4], buf[3]);
+ BIO_printf(bio_err, "Unable to rename %s to %s\n", buf[4], buf[3]);
perror("reason");
rename(dbfile, buf[0]);
rename(buf[1], dbfile);
goto err;
}
if (rename(buf[2], buf[4]) < 0) {
- BIO_printf(bio_err, "unable to rename %s to %s\n", buf[2], buf[4]);
+ BIO_printf(bio_err, "Unable to rename %s to %s\n", buf[2], buf[4]);
perror("reason");
rename(buf[3], buf[4]);
rename(dbfile, buf[0]);
}
return 1;
err:
+ ERR_print_errors(bio_err);
return 0;
}
}
if (*cp == '\\' && *++cp == '\0') {
BIO_printf(bio_err,
- "%s: escape character at end of string\n",
+ "%s: Escape character at end of string\n",
opt_getprog());
goto err;
}