diff options
| author | mrezai | 2016-04-15 19:03:35 +0430 |
|---|---|---|
| committer | Rémi Verschelde | 2016-04-27 08:49:39 +0200 |
| commit | 3efa0f130dbaaba5eecb42f76ed7518eedfdf0c8 (patch) | |
| tree | 91da0400f0a1386f7122e25c559abdfb53a9ec9e /drivers/builtin_openssl2/crypto/engine/eng_cryptodev.c | |
| parent | 47c7b535d2cdcb89c7799475662c70ca9c7ff41d (diff) | |
| download | godot-3efa0f130dbaaba5eecb42f76ed7518eedfdf0c8.tar.gz godot-3efa0f130dbaaba5eecb42f76ed7518eedfdf0c8.tar.zst godot-3efa0f130dbaaba5eecb42f76ed7518eedfdf0c8.zip | |
Update OpenSSL to version 1.0.2g
(cherry picked from commit e97922f22038e9049ed4c2db5b3736dfaa0edde3)
Diffstat (limited to 'drivers/builtin_openssl2/crypto/engine/eng_cryptodev.c')
| -rw-r--r-- | drivers/builtin_openssl2/crypto/engine/eng_cryptodev.c | 70 |
1 files changed, 66 insertions, 4 deletions
diff --git a/drivers/builtin_openssl2/crypto/engine/eng_cryptodev.c b/drivers/builtin_openssl2/crypto/engine/eng_cryptodev.c index a8a24d054..8fb9c3373 100644 --- a/drivers/builtin_openssl2/crypto/engine/eng_cryptodev.c +++ b/drivers/builtin_openssl2/crypto/engine/eng_cryptodev.c @@ -54,10 +54,10 @@ void ENGINE_load_cryptodev(void) # include <sys/types.h> # include <crypto/cryptodev.h> -# include <crypto/dh/dh.h> -# include <crypto/dsa/dsa.h> -# include <crypto/err/err.h> -# include <crypto/rsa/rsa.h> +# include <openssl/dh.h> +# include <openssl/dsa.h> +# include <openssl/err.h> +# include <openssl/rsa.h> # include <sys/ioctl.h> # include <errno.h> # include <stdio.h> @@ -160,6 +160,17 @@ static struct { { CRYPTO_AES_CBC, NID_aes_256_cbc, 16, 32, }, +# ifdef 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 { CRYPTO_BLF_CBC, NID_bf_cbc, 8, 16, }, @@ -630,6 +641,46 @@ const EVP_CIPHER cryptodev_aes_256_cbc = { NULL }; +# ifdef CRYPTO_AES_CTR +const EVP_CIPHER cryptodev_aes_ctr = { + NID_aes_128_ctr, + 16, 16, 14, + EVP_CIPH_CTR_MODE, + cryptodev_init_key, + cryptodev_cipher, + cryptodev_cleanup, + sizeof(struct dev_crypto_state), + EVP_CIPHER_set_asn1_iv, + EVP_CIPHER_get_asn1_iv, + NULL +}; + +const EVP_CIPHER cryptodev_aes_ctr_192 = { + NID_aes_192_ctr, + 16, 24, 14, + EVP_CIPH_CTR_MODE, + cryptodev_init_key, + cryptodev_cipher, + cryptodev_cleanup, + sizeof(struct dev_crypto_state), + EVP_CIPHER_set_asn1_iv, + EVP_CIPHER_get_asn1_iv, + NULL +}; + +const EVP_CIPHER cryptodev_aes_ctr_256 = { + NID_aes_256_ctr, + 16, 32, 14, + EVP_CIPH_CTR_MODE, + cryptodev_init_key, + cryptodev_cipher, + cryptodev_cleanup, + sizeof(struct dev_crypto_state), + EVP_CIPHER_set_asn1_iv, + EVP_CIPHER_get_asn1_iv, + NULL +}; +# endif /* * Registered by the ENGINE when used to find out how to deal with * a particular NID in the ENGINE. this says what we'll do at the @@ -667,6 +718,17 @@ cryptodev_engine_ciphers(ENGINE *e, const EVP_CIPHER **cipher, case NID_aes_256_cbc: *cipher = &cryptodev_aes_256_cbc; break; +# ifdef CRYPTO_AES_CTR + case NID_aes_128_ctr: + *cipher = &cryptodev_aes_ctr; + break; + case NID_aes_192_ctr: + *cipher = &cryptodev_aes_ctr_192; + break; + case NID_aes_256_ctr: + *cipher = &cryptodev_aes_ctr_256; + break; +# endif default: *cipher = NULL; break; |
