summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2002-05-16 22:24:53 +0000
committermarkus <markus@openbsd.org>2002-05-16 22:24:53 +0000
commit3a63824656b3e9a00ca31dea58b80104808745ce (patch)
treeeb652d064eed4f6dabcbd54af595299a3399bd04 /lib/libssl/src
parentdon't limit xauth pathlen on client side and longer print length on (diff)
downloadwireguard-openbsd-3a63824656b3e9a00ca31dea58b80104808745ce.tar.xz
wireguard-openbsd-3a63824656b3e9a00ca31dea58b80104808745ce.zip
add aes/bf/cast; ok deraadt@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/engine/hw_cryptodev.c52
1 files changed, 50 insertions, 2 deletions
diff --git a/lib/libssl/src/crypto/engine/hw_cryptodev.c b/lib/libssl/src/crypto/engine/hw_cryptodev.c
index 7c3728f3951..fe103819064 100644
--- a/lib/libssl/src/crypto/engine/hw_cryptodev.c
+++ b/lib/libssl/src/crypto/engine/hw_cryptodev.c
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2002 Bob Beck <beck@openbsd.org>
* Copyright (c) 2002 Theo de Raadt
+ * Copyright (c) 2002 Markus Friedl
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -77,9 +78,9 @@ static struct {
} ciphers[] = {
{ CRYPTO_DES_CBC, NID_des_cbc, 8, 8, },
{ CRYPTO_3DES_CBC, NID_des_ede3_cbc, 8, 24, },
- { CRYPTO_AES_CBC, NID_undef, 8, 24, },
+ { CRYPTO_AES_CBC, NID_aes_128_cbc, 16, 16, },
{ CRYPTO_BLF_CBC, NID_bf_cbc, 8, 16, },
- { CRYPTO_CAST_CBC, NID_cast5_cbc, 8, 8, },
+ { CRYPTO_CAST_CBC, NID_cast5_cbc, 8, 16, },
{ CRYPTO_SKIPJACK_CBC, NID_undef, 0, 0, },
{ CRYPTO_ARC4, NID_rc4, 8, 16, },
{ 0, NID_undef, 0, 0, },
@@ -476,6 +477,44 @@ const EVP_CIPHER cryptodev_3des_cbc = {
NULL
};
+const EVP_CIPHER cryptodev_bf_cbc = {
+ NID_bf_cbc,
+ 8, 16, 8,
+ EVP_CIPH_CBC_MODE,
+ cryptodev_init_key,
+ cryptodev_cipher,
+ cryptodev_cleanup,
+ sizeof(struct session_op),
+ EVP_CIPHER_set_asn1_iv,
+ EVP_CIPHER_get_asn1_iv,
+ NULL
+};
+
+const EVP_CIPHER cryptodev_cast_cbc = {
+ NID_cast5_cbc,
+ 8, 16, 8,
+ EVP_CIPH_CBC_MODE,
+ cryptodev_init_key,
+ cryptodev_cipher,
+ cryptodev_cleanup,
+ sizeof(struct session_op),
+ EVP_CIPHER_set_asn1_iv,
+ EVP_CIPHER_get_asn1_iv,
+ NULL
+};
+
+const EVP_CIPHER cryptodev_aes_cbc = {
+ NID_aes_128_cbc,
+ 16, 16, 16,
+ EVP_CIPH_CBC_MODE,
+ cryptodev_init_key,
+ cryptodev_cipher,
+ cryptodev_cleanup,
+ sizeof(struct session_op),
+ EVP_CIPHER_set_asn1_iv,
+ EVP_CIPHER_get_asn1_iv,
+ NULL
+};
/*
* Registered by the ENGINE when used to find out how to deal with
@@ -499,6 +538,15 @@ cryptodev_engine_ciphers(ENGINE *e, const EVP_CIPHER **cipher,
case NID_des_cbc:
*cipher = &cryptodev_des_cbc;
break;
+ case NID_bf_cbc:
+ *cipher = &cryptodev_bf_cbc;
+ break;
+ case NID_cast5_cbc:
+ *cipher = &cryptodev_cast_cbc;
+ break;
+ case NID_aes_128_cbc:
+ *cipher = &cryptodev_aes_cbc;
+ break;
default:
*cipher = NULL;
break;