From 349b653a99ee37dbcead44a047d6d639c2906ccd Mon Sep 17 00:00:00 2001 From: Iaroslav Gridin Date: Sat, 29 Oct 2016 17:47:03 +0300 Subject: fix for BSD cryptodev by levitte Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/1784) --- crypto/engine/eng_cryptodev.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crypto/engine/eng_cryptodev.c b/crypto/engine/eng_cryptodev.c index 24692b111f..71a6565cd8 100644 --- a/crypto/engine/eng_cryptodev.c +++ b/crypto/engine/eng_cryptodev.c @@ -81,6 +81,14 @@ void engine_load_cryptodev_int(void) #else +/* Available on cryptodev-linux but not on FreeBSD 8.4 */ +# ifndef CRYPTO_HMAC_MAX_KEY_LEN +# define CRYPTO_HMAC_MAX_KEY_LEN 512 +# endif +# ifndef CRYPTO_CIPHER_MAX_KEY_LEN +# define CRYPTO_CIPHER_MAX_KEY_LEN 64 +# endif + struct dev_crypto_state { struct session_op d_sess; int d_fd; @@ -169,16 +177,22 @@ static struct { {CRYPTO_ARC4, NID_rc4, 0, 16}, {CRYPTO_DES_CBC, NID_des_cbc, 8, 8}, {CRYPTO_3DES_CBC, NID_des_ede3_cbc, 8, 24}, +# if !defined(CRYPTO_ALGORITHM_MIN) || defined(CRYPTO_3DES_ECB) {CRYPTO_3DES_ECB, NID_des_ede3_ecb, 0, 24}, +# endif {CRYPTO_AES_CBC, NID_aes_128_cbc, 16, 16}, {CRYPTO_AES_CBC, NID_aes_192_cbc, 16, 24}, {CRYPTO_AES_CBC, NID_aes_256_cbc, 16, 32}, +# if !defined(CRYPTO_ALGORITHM_MIN) || defined(CRYPTO_AES_CTR) {CRYPTO_AES_CTR, NID_aes_128_ctr, 14, 16}, {CRYPTO_AES_CTR, NID_aes_192_ctr, 14, 24}, {CRYPTO_AES_CTR, NID_aes_256_ctr, 14, 32}, +# endif +# if !defined(CRYPTO_ALGORITHM_MIN) || defined(CRYPTO_AES_ECB) {CRYPTO_AES_ECB, NID_aes_128_ecb, 0, 16}, {CRYPTO_AES_ECB, NID_aes_192_ecb, 0, 24}, {CRYPTO_AES_ECB, NID_aes_256_ecb, 0, 32}, +# endif {CRYPTO_BLF_CBC, NID_bf_cbc, 8, 16}, {CRYPTO_CAST_CBC, NID_cast5_cbc, 8, 16}, {CRYPTO_SKIPJACK_CBC, NID_undef, 0, 0}, -- cgit v1.2.3