Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove DB_ERROR_WRONG_NUM_FIELDS and ensure TXT_DB_read always prints a message for an error #17060

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion apps/lib/apps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,8 +1632,10 @@ CA_DB *load_index(const char *dbfile, DB_ATTR *db_attr)
}
#endif

if ((tmpdb = TXT_DB_read(in, DB_NUMBER)) == NULL)
if ((tmpdb = TXT_DB_read(in, DB_NUMBER)) == NULL) {
BIO_printf(bio_err, "TXT_DB_read failed reading %s\n", dbfile);
goto err;
}

#ifndef OPENSSL_SYS_VMS
BIO_snprintf(buf, sizeof(buf), "%s.attr", dbfile);
Expand Down
1 change: 0 additions & 1 deletion crypto/txt_db/txt_db.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ TXT_DB *TXT_DB_read(BIO *in, int num)
*(p++) = '\0';
if ((n != num) || (*f != '\0')) {
OPENSSL_free(pp);
ret->error = DB_ERROR_WRONG_NUM_FIELDS;
goto err;
}
pp[n] = p;
Expand Down
1 change: 0 additions & 1 deletion include/openssl/txt_db.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
# define DB_ERROR_INDEX_OUT_OF_RANGE 3
# define DB_ERROR_NO_INDEX 4
# define DB_ERROR_INSERT_INDEX_CLASH 5
# define DB_ERROR_WRONG_NUM_FIELDS 6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an API break and so it would not be acceptable earlier than in 4.0.

Why do you remove this particular error?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it isn't really returned anywhere. But then OK, just keep the define here and perhaps add a comment, that it is never really returned.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix. Thanks!


#ifdef __cplusplus
extern "C" {
Expand Down