summaryrefslogtreecommitdiffstats
path: root/providers/implementations/ciphers
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-02-05 17:40:42 +0100
committerTomas Mraz <tomas@openssl.org>2021-02-11 09:34:31 +0100
commit2741128e9deeb7f6fd73f10a1c657c05433a41cb (patch)
treed8839a5c0f19b10c6cc16104d639168facee239b /providers/implementations/ciphers
parentdc9ec65a018d92306e4b3139239505c5cfc5b15e (diff)
Move the PROV_R reason codes to a public header
The PROV_R codes can be returned to applications so it is useful to have some common set of provider reason codes for the applications or third party providers. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/14086)
Diffstat (limited to 'providers/implementations/ciphers')
-rw-r--r--providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c2
-rw-r--r--providers/implementations/ciphers/cipher_aes_cts.inc2
-rw-r--r--providers/implementations/ciphers/cipher_aes_hw.c2
-rw-r--r--providers/implementations/ciphers/cipher_aes_ocb.c2
-rw-r--r--providers/implementations/ciphers/cipher_aes_siv.c2
-rw-r--r--providers/implementations/ciphers/cipher_aes_wrp.c2
-rw-r--r--providers/implementations/ciphers/cipher_aes_xts.c2
-rw-r--r--providers/implementations/ciphers/cipher_camellia_hw.c1
-rw-r--r--providers/implementations/ciphers/cipher_cast5.c2
-rw-r--r--providers/implementations/ciphers/cipher_chacha20.c2
-rw-r--r--providers/implementations/ciphers/cipher_chacha20_poly1305.c2
-rw-r--r--providers/implementations/ciphers/cipher_des.c4
-rw-r--r--providers/implementations/ciphers/cipher_null.c2
-rw-r--r--providers/implementations/ciphers/cipher_rc2.c2
-rw-r--r--providers/implementations/ciphers/cipher_rc4_hmac_md5.c2
-rw-r--r--providers/implementations/ciphers/cipher_rc5.c2
-rw-r--r--providers/implementations/ciphers/cipher_tdes.c4
-rw-r--r--providers/implementations/ciphers/cipher_tdes_common.c4
-rw-r--r--providers/implementations/ciphers/cipher_tdes_wrap.c2
-rw-r--r--providers/implementations/ciphers/ciphercommon.c2
-rw-r--r--providers/implementations/ciphers/ciphercommon_block.c2
-rw-r--r--providers/implementations/ciphers/ciphercommon_ccm.c2
-rw-r--r--providers/implementations/ciphers/ciphercommon_gcm.c4
23 files changed, 26 insertions, 27 deletions
diff --git a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
index 03f216d22e..abefc20ab2 100644
--- a/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
+++ b/providers/implementations/ciphers/cipher_aes_cbc_hmac_sha.c
@@ -18,6 +18,7 @@
/* Only for SSL3_VERSION and TLS1_VERSION */
#include <openssl/ssl.h>
+#include <openssl/proverr.h>
#include "cipher_aes_cbc_hmac_sha.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
@@ -28,7 +29,6 @@ const OSSL_DISPATCH ossl_##nm##kbits##sub##_functions[] = { \
{ 0, NULL } \
};
#else
-# include "prov/providercommonerr.h"
# define AES_CBC_HMAC_SHA_FLAGS (PROV_CIPHER_FLAG_AEAD \
| PROV_CIPHER_FLAG_TLS1_MULTIBLOCK)
diff --git a/providers/implementations/ciphers/cipher_aes_cts.inc b/providers/implementations/ciphers/cipher_aes_cts.inc
index dae112febf..f398534dda 100644
--- a/providers/implementations/ciphers/cipher_aes_cts.inc
+++ b/providers/implementations/ciphers/cipher_aes_cts.inc
@@ -9,8 +9,8 @@
/* Dispatch functions for AES CBC CTS ciphers */
+#include <openssl/proverr.h>
#include "cipher_aes_cts.h"
-#include "prov/providercommonerr.h"
#define AES_CTS_FLAGS PROV_CIPHER_FLAG_CTS
diff --git a/providers/implementations/ciphers/cipher_aes_hw.c b/providers/implementations/ciphers/cipher_aes_hw.c
index 0b6f06f915..3aed088171 100644
--- a/providers/implementations/ciphers/cipher_aes_hw.c
+++ b/providers/implementations/ciphers/cipher_aes_hw.c
@@ -13,8 +13,8 @@
*/
#include "internal/deprecated.h"
+#include <openssl/proverr.h>
#include "cipher_aes.h"
-#include "prov/providercommonerr.h"
static int cipher_hw_aes_initkey(PROV_CIPHER_CTX *dat,
const unsigned char *key, size_t keylen)
diff --git a/providers/implementations/ciphers/cipher_aes_ocb.c b/providers/implementations/ciphers/cipher_aes_ocb.c
index 26ffdab7a4..b94d7644df 100644
--- a/providers/implementations/ciphers/cipher_aes_ocb.c
+++ b/providers/implementations/ciphers/cipher_aes_ocb.c
@@ -14,9 +14,9 @@
*/
#include "internal/deprecated.h"
+#include <openssl/proverr.h>
#include "cipher_aes_ocb.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#include "prov/ciphercommon_aead.h"
#include "prov/implementations.h"
diff --git a/providers/implementations/ciphers/cipher_aes_siv.c b/providers/implementations/ciphers/cipher_aes_siv.c
index 469515bb8c..9a9adb02d9 100644
--- a/providers/implementations/ciphers/cipher_aes_siv.c
+++ b/providers/implementations/ciphers/cipher_aes_siv.c
@@ -15,10 +15,10 @@
*/
#include "internal/deprecated.h"
+#include <openssl/proverr.h>
#include "cipher_aes_siv.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#include "prov/ciphercommon_aead.h"
#include "prov/provider_ctx.h"
diff --git a/providers/implementations/ciphers/cipher_aes_wrp.c b/providers/implementations/ciphers/cipher_aes_wrp.c
index dc625216ca..967e12206b 100644
--- a/providers/implementations/ciphers/cipher_aes_wrp.c
+++ b/providers/implementations/ciphers/cipher_aes_wrp.c
@@ -13,9 +13,9 @@
*/
#include "internal/deprecated.h"
+#include <openssl/proverr.h>
#include "cipher_aes.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#include "prov/implementations.h"
/* AES wrap with padding has IV length of 4, without padding 8 */
diff --git a/providers/implementations/ciphers/cipher_aes_xts.c b/providers/implementations/ciphers/cipher_aes_xts.c
index cf768d27d4..c5699d645b 100644
--- a/providers/implementations/ciphers/cipher_aes_xts.c
+++ b/providers/implementations/ciphers/cipher_aes_xts.c
@@ -15,10 +15,10 @@
*/
#include "internal/deprecated.h"
+#include <openssl/proverr.h>
#include "cipher_aes_xts.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define AES_XTS_FLAGS PROV_CIPHER_FLAG_CUSTOM_IV
#define AES_XTS_IV_BITS 128
diff --git a/providers/implementations/ciphers/cipher_camellia_hw.c b/providers/implementations/ciphers/cipher_camellia_hw.c
index e8ada99a7e..06b29ca287 100644
--- a/providers/implementations/ciphers/cipher_camellia_hw.c
+++ b/providers/implementations/ciphers/cipher_camellia_hw.c
@@ -14,7 +14,6 @@
#include "internal/deprecated.h"
#include "cipher_camellia.h"
-#include <openssl/camellia.h>
static int cipher_hw_camellia_initkey(PROV_CIPHER_CTX *dat,
const unsigned char *key, size_t keylen)
diff --git a/providers/implementations/ciphers/cipher_cast5.c b/providers/implementations/ciphers/cipher_cast5.c
index 1d525343b4..f5f7cba631 100644
--- a/providers/implementations/ciphers/cipher_cast5.c
+++ b/providers/implementations/ciphers/cipher_cast5.c
@@ -15,10 +15,10 @@
/* Dispatch functions for cast cipher modes ecb, cbc, ofb, cfb */
+#include <openssl/proverr.h>
#include "cipher_cast.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define CAST5_FLAGS PROV_CIPHER_FLAG_VARIABLE_LENGTH
diff --git a/providers/implementations/ciphers/cipher_chacha20.c b/providers/implementations/ciphers/cipher_chacha20.c
index b2fe1b1957..c4042c1b39 100644
--- a/providers/implementations/ciphers/cipher_chacha20.c
+++ b/providers/implementations/ciphers/cipher_chacha20.c
@@ -9,10 +9,10 @@
/* Dispatch functions for chacha20 cipher */
+#include <openssl/proverr.h>
#include "cipher_chacha20.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define CHACHA20_KEYLEN (CHACHA_KEY_SIZE)
#define CHACHA20_BLKLEN (1)
diff --git a/providers/implementations/ciphers/cipher_chacha20_poly1305.c b/providers/implementations/ciphers/cipher_chacha20_poly1305.c
index 919d4fba94..0565b05f39 100644
--- a/providers/implementations/ciphers/cipher_chacha20_poly1305.c
+++ b/providers/implementations/ciphers/cipher_chacha20_poly1305.c
@@ -9,10 +9,10 @@
/* Dispatch functions for chacha20_poly1305 cipher */
+#include <openssl/proverr.h>
#include "cipher_chacha20_poly1305.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define CHACHA20_POLY1305_KEYLEN CHACHA_KEY_SIZE
diff --git a/providers/implementations/ciphers/cipher_des.c b/providers/implementations/ciphers/cipher_des.c
index ec186445c8..dd8bbefa36 100644
--- a/providers/implementations/ciphers/cipher_des.c
+++ b/providers/implementations/ciphers/cipher_des.c
@@ -13,12 +13,12 @@
*/
#include "internal/deprecated.h"
+#include <openssl/rand.h>
+#include <openssl/proverr.h>
#include "prov/ciphercommon.h"
#include "cipher_des.h"
-#include <openssl/rand.h>
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define DES_FLAGS 0
diff --git a/providers/implementations/ciphers/cipher_null.c b/providers/implementations/ciphers/cipher_null.c
index c3ebb25c28..01db056983 100644
--- a/providers/implementations/ciphers/cipher_null.c
+++ b/providers/implementations/ciphers/cipher_null.c
@@ -10,10 +10,10 @@
#include <string.h>
#include <openssl/crypto.h>
#include <openssl/core_dispatch.h>
+#include <openssl/proverr.h>
#include "prov/implementations.h"
#include "prov/ciphercommon.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
typedef struct prov_cipher_null_ctx_st {
int enc;
diff --git a/providers/implementations/ciphers/cipher_rc2.c b/providers/implementations/ciphers/cipher_rc2.c
index 09d66b2cdd..6e25d1534a 100644
--- a/providers/implementations/ciphers/cipher_rc2.c
+++ b/providers/implementations/ciphers/cipher_rc2.c
@@ -15,10 +15,10 @@
*/
#include "internal/deprecated.h"
+#include <openssl/proverr.h>
#include "cipher_rc2.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define RC2_40_MAGIC 0xa0
#define RC2_64_MAGIC 0x78
diff --git a/providers/implementations/ciphers/cipher_rc4_hmac_md5.c b/providers/implementations/ciphers/cipher_rc4_hmac_md5.c
index b757197110..c69b9aecb8 100644
--- a/providers/implementations/ciphers/cipher_rc4_hmac_md5.c
+++ b/providers/implementations/ciphers/cipher_rc4_hmac_md5.c
@@ -15,10 +15,10 @@
*/
#include "internal/deprecated.h"
+#include <openssl/proverr.h>
#include "cipher_rc4_hmac_md5.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define RC4_HMAC_MD5_FLAGS (PROV_CIPHER_FLAG_VARIABLE_LENGTH \
| PROV_CIPHER_FLAG_AEAD)
diff --git a/providers/implementations/ciphers/cipher_rc5.c b/providers/implementations/ciphers/cipher_rc5.c
index ec408ed885..db0dbaaf05 100644
--- a/providers/implementations/ciphers/cipher_rc5.c
+++ b/providers/implementations/ciphers/cipher_rc5.c
@@ -15,10 +15,10 @@
*/
#include "internal/deprecated.h"
+#include <openssl/proverr.h>
#include "cipher_rc5.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define RC5_FLAGS PROV_CIPHER_FLAG_VARIABLE_LENGTH
diff --git a/providers/implementations/ciphers/cipher_tdes.c b/providers/implementations/ciphers/cipher_tdes.c
index a2855af481..6ab083db41 100644
--- a/providers/implementations/ciphers/cipher_tdes.c
+++ b/providers/implementations/ciphers/cipher_tdes.c
@@ -13,11 +13,11 @@
*/
#include "internal/deprecated.h"
+#include <openssl/rand.h>
+#include <openssl/proverr.h>
#include "prov/ciphercommon.h"
#include "cipher_tdes.h"
-#include <openssl/rand.h>
#include "prov/implementations.h"
-#include "prov/providercommonerr.h"
/*
* NOTE: ECB mode does not use an IV - but existing test code is setting
diff --git a/providers/implementations/ciphers/cipher_tdes_common.c b/providers/implementations/ciphers/cipher_tdes_common.c
index 17b8ce40b0..2accb24b0a 100644
--- a/providers/implementations/ciphers/cipher_tdes_common.c
+++ b/providers/implementations/ciphers/cipher_tdes_common.c
@@ -13,12 +13,12 @@
*/
#include "internal/deprecated.h"
+#include <openssl/rand.h>
+#include <openssl/proverr.h>
#include "prov/ciphercommon.h"
#include "cipher_tdes.h"
-#include <openssl/rand.h>
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
void *tdes_newctx(void *provctx, int mode, size_t kbits, size_t blkbits,
size_t ivbits, uint64_t flags, const PROV_CIPHER_HW *hw)
diff --git a/providers/implementations/ciphers/cipher_tdes_wrap.c b/providers/implementations/ciphers/cipher_tdes_wrap.c
index b78a77c254..d42bf78d8e 100644
--- a/providers/implementations/ciphers/cipher_tdes_wrap.c
+++ b/providers/implementations/ciphers/cipher_tdes_wrap.c
@@ -15,11 +15,11 @@
#include <openssl/sha.h>
#include <openssl/rand.h>
+#include <openssl/proverr.h>
#include "cipher_tdes_default.h"
#include "crypto/evp.h"
#include "prov/implementations.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
#define TDES_WRAP_FLAGS PROV_CIPHER_FLAG_CUSTOM_IV
diff --git a/providers/implementations/ciphers/ciphercommon.c b/providers/implementations/ciphers/ciphercommon.c
index fa73edb473..2e0603ce19 100644
--- a/providers/implementations/ciphers/ciphercommon.c
+++ b/providers/implementations/ciphers/ciphercommon.c
@@ -13,10 +13,10 @@
/* For SSL3_VERSION */
#include <openssl/ssl.h>
+#include <openssl/proverr.h>
#include "ciphercommon_local.h"
#include "prov/provider_ctx.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
/*-
* Generic cipher functions for OSSL_PARAM gettables and settables
diff --git a/providers/implementations/ciphers/ciphercommon_block.c b/providers/implementations/ciphers/ciphercommon_block.c
index 68d5495b77..de375a6327 100644
--- a/providers/implementations/ciphers/ciphercommon_block.c
+++ b/providers/implementations/ciphers/ciphercommon_block.c
@@ -11,9 +11,9 @@
/* For SSL3_VERSION, TLS1_VERSION etc */
#include <openssl/ssl.h>
#include <openssl/rand.h>
+#include <openssl/proverr.h>
#include "internal/constant_time.h"
#include "ciphercommon_local.h"
-#include "prov/providercommonerr.h"
/* Functions defined in ssl/tls_pad.c */
int ssl3_cbc_remove_padding_and_mac(size_t *reclen,
diff --git a/providers/implementations/ciphers/ciphercommon_ccm.c b/providers/implementations/ciphers/ciphercommon_ccm.c
index 0009e9876c..a87bf487e6 100644
--- a/providers/implementations/ciphers/ciphercommon_ccm.c
+++ b/providers/implementations/ciphers/ciphercommon_ccm.c
@@ -9,10 +9,10 @@
/* Dispatch functions for ccm mode */
+#include <openssl/proverr.h>
#include "prov/ciphercommon.h"
#include "prov/ciphercommon_ccm.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
static int ccm_cipher_internal(PROV_CCM_CTX *ctx, unsigned char *out,
size_t *padlen, const unsigned char *in,
diff --git a/providers/implementations/ciphers/ciphercommon_gcm.c b/providers/implementations/ciphers/ciphercommon_gcm.c
index 974a8f6026..8b9d06b0a4 100644
--- a/providers/implementations/ciphers/ciphercommon_gcm.c
+++ b/providers/implementations/ciphers/ciphercommon_gcm.c
@@ -9,11 +9,11 @@
/* Dispatch functions for gcm mode */
+#include <openssl/rand.h>
+#include <openssl/proverr.h>
#include "prov/ciphercommon.h"
#include "prov/ciphercommon_gcm.h"
#include "prov/providercommon.h"
-#include "prov/providercommonerr.h"
-#include <openssl/rand.h>
#include "prov/provider_ctx.h"
static int gcm_tls_init(PROV_GCM_CTX *dat, unsigned char *aad, size_t aad_len);