diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-04 12:23:19 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-13 09:35:02 +0100 |
commit | 9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2 (patch) | |
tree | e82c26569e5a952980e65a746af920beed602aab /crypto/rand/randfile.c | |
parent | 31a6b52f6db009c639c67387a707dd235f29a430 (diff) |
Convert all {NAME}err() in crypto/ to their corresponding ERR_raise() call
This includes error reporting for libcrypto sub-libraries in surprising
places.
This was done using util/err-to-raise
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13318)
Diffstat (limited to 'crypto/rand/randfile.c')
-rw-r--r-- | crypto/rand/randfile.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/rand/randfile.c b/crypto/rand/randfile.c index 2bdd76c078..b104895e3a 100644 --- a/crypto/rand/randfile.c +++ b/crypto/rand/randfile.c @@ -94,14 +94,14 @@ int RAND_load_file(const char *file, long bytes) return 0; if ((in = openssl_fopen(file, "rb")) == NULL) { - RANDerr(RAND_F_RAND_LOAD_FILE, RAND_R_CANNOT_OPEN_FILE); + ERR_raise(ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE); ERR_add_error_data(2, "Filename=", file); return -1; } #ifndef OPENSSL_NO_POSIX_IO if (fstat(fileno(in), &sb) < 0) { - RANDerr(RAND_F_RAND_LOAD_FILE, RAND_R_INTERNAL_ERROR); + ERR_raise(ERR_LIB_RAND, RAND_R_INTERNAL_ERROR); ERR_add_error_data(2, "Filename=", file); fclose(in); return -1; @@ -162,7 +162,7 @@ int RAND_load_file(const char *file, long bytes) OPENSSL_cleanse(buf, sizeof(buf)); fclose(in); if (!RAND_status()) { - RANDerr(RAND_F_RAND_LOAD_FILE, RAND_R_RESEED_ERROR); + ERR_raise(ERR_LIB_RAND, RAND_R_RESEED_ERROR); ERR_add_error_data(2, "Filename=", file); return -1; } @@ -179,7 +179,7 @@ int RAND_write_file(const char *file) struct stat sb; if (stat(file, &sb) >= 0 && !S_ISREG(sb.st_mode)) { - RANDerr(RAND_F_RAND_WRITE_FILE, RAND_R_NOT_A_REGULAR_FILE); + ERR_raise(ERR_LIB_RAND, RAND_R_NOT_A_REGULAR_FILE); ERR_add_error_data(2, "Filename=", file); return -1; } @@ -229,7 +229,7 @@ int RAND_write_file(const char *file) if (out == NULL) out = openssl_fopen(file, "wb"); if (out == NULL) { - RANDerr(RAND_F_RAND_WRITE_FILE, RAND_R_CANNOT_OPEN_FILE); + ERR_raise(ERR_LIB_RAND, RAND_R_CANNOT_OPEN_FILE); ERR_add_error_data(2, "Filename=", file); return -1; } |