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/comp | |
parent | EVP: Adapt EVP_PKEY2PKCS8() to better handle provider-native keys (diff) | |
download | openssl-9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2.tar.xz openssl-9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2.zip |
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/comp')
-rw-r--r-- | crypto/comp/c_zlib.c | 14 | ||||
-rw-r--r-- | crypto/comp/comp_lib.c | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c index 0d84a52726..0211da9b91 100644 --- a/crypto/comp/c_zlib.c +++ b/crypto/comp/c_zlib.c @@ -321,13 +321,13 @@ static int bio_zlib_new(BIO *bi) # ifdef ZLIB_SHARED (void)COMP_zlib(); if (!zlib_loaded) { - COMPerr(COMP_F_BIO_ZLIB_NEW, COMP_R_ZLIB_NOT_SUPPORTED); + ERR_raise(ERR_LIB_COMP, COMP_R_ZLIB_NOT_SUPPORTED); return 0; } # endif ctx = OPENSSL_zalloc(sizeof(*ctx)); if (ctx == NULL) { - COMPerr(COMP_F_BIO_ZLIB_NEW, ERR_R_MALLOC_FAILURE); + ERR_raise(ERR_LIB_COMP, ERR_R_MALLOC_FAILURE); return 0; } ctx->ibufsize = ZLIB_DEFAULT_BUFSIZE; @@ -381,7 +381,7 @@ static int bio_zlib_read(BIO *b, char *out, int outl) if (!ctx->ibuf) { ctx->ibuf = OPENSSL_malloc(ctx->ibufsize); if (ctx->ibuf == NULL) { - COMPerr(COMP_F_BIO_ZLIB_READ, ERR_R_MALLOC_FAILURE); + ERR_raise(ERR_LIB_COMP, ERR_R_MALLOC_FAILURE); return 0; } inflateInit(zin); @@ -397,7 +397,7 @@ static int bio_zlib_read(BIO *b, char *out, int outl) while (zin->avail_in) { ret = inflate(zin, 0); if ((ret != Z_OK) && (ret != Z_STREAM_END)) { - COMPerr(COMP_F_BIO_ZLIB_READ, COMP_R_ZLIB_INFLATE_ERROR); + ERR_raise(ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR); ERR_add_error_data(2, "zlib error:", zError(ret)); return 0; } @@ -442,7 +442,7 @@ static int bio_zlib_write(BIO *b, const char *in, int inl) ctx->obuf = OPENSSL_malloc(ctx->obufsize); /* Need error here */ if (ctx->obuf == NULL) { - COMPerr(COMP_F_BIO_ZLIB_WRITE, ERR_R_MALLOC_FAILURE); + ERR_raise(ERR_LIB_COMP, ERR_R_MALLOC_FAILURE); return 0; } ctx->optr = ctx->obuf; @@ -483,7 +483,7 @@ static int bio_zlib_write(BIO *b, const char *in, int inl) /* Compress some more */ ret = deflate(zout, 0); if (ret != Z_OK) { - COMPerr(COMP_F_BIO_ZLIB_WRITE, COMP_R_ZLIB_DEFLATE_ERROR); + ERR_raise(ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR); ERR_add_error_data(2, "zlib error:", zError(ret)); return 0; } @@ -532,7 +532,7 @@ static int bio_zlib_flush(BIO *b) if (ret == Z_STREAM_END) ctx->odone = 1; else if (ret != Z_OK) { - COMPerr(COMP_F_BIO_ZLIB_FLUSH, COMP_R_ZLIB_DEFLATE_ERROR); + ERR_raise(ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR); ERR_add_error_data(2, "zlib error:", zError(ret)); return 0; } diff --git a/crypto/comp/comp_lib.c b/crypto/comp/comp_lib.c index 49195de3d2..e921709c0f 100644 --- a/crypto/comp/comp_lib.c +++ b/crypto/comp/comp_lib.c @@ -20,7 +20,7 @@ COMP_CTX *COMP_CTX_new(COMP_METHOD *meth) COMP_CTX *ret; if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { - COMPerr(COMP_F_COMP_CTX_NEW, ERR_R_MALLOC_FAILURE); + ERR_raise(ERR_LIB_COMP, ERR_R_MALLOC_FAILURE); return NULL; } ret->meth = meth; |