projects
/
openssl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reflect special `DEFAULT` behavior in ciphers(1)
[openssl.git]
/
apps
/
apps.c
diff --git
a/apps/apps.c
b/apps/apps.c
index ef573552eb42544af99787479f2b9169304a8354..6ae85233ccdc6aefabaed72ab532cf9f39a850d4 100644
(file)
--- a/
apps/apps.c
+++ b/
apps/apps.c
@@
-1538,12
+1538,27
@@
CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
BIO *in;
CONF *dbattr_conf = NULL;
char buf[BSIZE];
BIO *in;
CONF *dbattr_conf = NULL;
char buf[BSIZE];
+#ifndef OPENSSL_NO_POSIX_IO
+ FILE *dbfp;
+ struct stat dbst;
+#endif
in = BIO_new_file(dbfile, "r");
if (in == NULL) {
ERR_print_errors(bio_err);
goto err;
}
in = BIO_new_file(dbfile, "r");
if (in == NULL) {
ERR_print_errors(bio_err);
goto err;
}
+
+#ifndef OPENSSL_NO_POSIX_IO
+ BIO_get_fp(in, &dbfp);
+ if (fstat(fileno(dbfp), &dbst) == -1) {
+ SYSerr(SYS_F_FSTAT, errno);
+ ERR_add_error_data(3, "fstat('", dbfile, "')");
+ ERR_print_errors(bio_err);
+ goto err;
+ }
+#endif
+
if ((tmpdb = TXT_DB_read(in, DB_NUMBER)) == NULL)
goto err;
if ((tmpdb = TXT_DB_read(in, DB_NUMBER)) == NULL)
goto err;
@@
-1570,6
+1585,11
@@
CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
}
}
}
}
+ retdb->dbfname = OPENSSL_strdup(dbfile);
+#ifndef OPENSSL_NO_POSIX_IO
+ retdb->dbst = dbst;
+#endif
+
err:
NCONF_free(dbattr_conf);
TXT_DB_free(tmpdb);
err:
NCONF_free(dbattr_conf);
TXT_DB_free(tmpdb);
@@
-1577,6
+1597,9
@@
CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
return retdb;
}
return retdb;
}
+/*
+ * Returns > 0 on success, <= 0 on error
+ */
int index_index(CA_DB *db)
{
if (!TXT_DB_create_index(db->db, DB_serial, NULL,
int index_index(CA_DB *db)
{
if (!TXT_DB_create_index(db->db, DB_serial, NULL,
@@
-1715,6
+1738,7
@@
void free_index(CA_DB *db)
{
if (db) {
TXT_DB_free(db->db);
{
if (db) {
TXT_DB_free(db->db);
+ OPENSSL_free(db->dbfname);
OPENSSL_free(db);
}
}
OPENSSL_free(db);
}
}