diff options
author | markus <> | 2002-05-16 22:24:53 +0000 |
---|---|---|
committer | markus <> | 2002-05-16 22:24:53 +0000 |
commit | ebb056571a324f84b5e5994894ff7823a5b27329 (patch) | |
tree | a826610d6c4dba994ca54bf84518a8fcc6fe24c8 /src | |
parent | 498bcc13a4a8a231522abdadc294f204edf18863 (diff) | |
download | openbsd-ebb056571a324f84b5e5994894ff7823a5b27329.tar.gz openbsd-ebb056571a324f84b5e5994894ff7823a5b27329.tar.bz2 openbsd-ebb056571a324f84b5e5994894ff7823a5b27329.zip |
add aes/bf/cast; ok deraadt@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/engine/hw_cryptodev.c | 52 | ||||
-rw-r--r-- | src/lib/libssl/src/crypto/engine/hw_cryptodev.c | 52 |
2 files changed, 100 insertions, 4 deletions
diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c index 7c3728f395..fe10381906 100644 --- a/src/lib/libcrypto/engine/hw_cryptodev.c +++ b/src/lib/libcrypto/engine/hw_cryptodev.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2002 Bob Beck <beck@openbsd.org> | 2 | * Copyright (c) 2002 Bob Beck <beck@openbsd.org> |
3 | * Copyright (c) 2002 Theo de Raadt | 3 | * Copyright (c) 2002 Theo de Raadt |
4 | * Copyright (c) 2002 Markus Friedl | ||
4 | * All rights reserved. | 5 | * All rights reserved. |
5 | * | 6 | * |
6 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without |
@@ -77,9 +78,9 @@ static struct { | |||
77 | } ciphers[] = { | 78 | } ciphers[] = { |
78 | { CRYPTO_DES_CBC, NID_des_cbc, 8, 8, }, | 79 | { CRYPTO_DES_CBC, NID_des_cbc, 8, 8, }, |
79 | { CRYPTO_3DES_CBC, NID_des_ede3_cbc, 8, 24, }, | 80 | { CRYPTO_3DES_CBC, NID_des_ede3_cbc, 8, 24, }, |
80 | { CRYPTO_AES_CBC, NID_undef, 8, 24, }, | 81 | { CRYPTO_AES_CBC, NID_aes_128_cbc, 16, 16, }, |
81 | { CRYPTO_BLF_CBC, NID_bf_cbc, 8, 16, }, | 82 | { CRYPTO_BLF_CBC, NID_bf_cbc, 8, 16, }, |
82 | { CRYPTO_CAST_CBC, NID_cast5_cbc, 8, 8, }, | 83 | { CRYPTO_CAST_CBC, NID_cast5_cbc, 8, 16, }, |
83 | { CRYPTO_SKIPJACK_CBC, NID_undef, 0, 0, }, | 84 | { CRYPTO_SKIPJACK_CBC, NID_undef, 0, 0, }, |
84 | { CRYPTO_ARC4, NID_rc4, 8, 16, }, | 85 | { CRYPTO_ARC4, NID_rc4, 8, 16, }, |
85 | { 0, NID_undef, 0, 0, }, | 86 | { 0, NID_undef, 0, 0, }, |
@@ -476,6 +477,44 @@ const EVP_CIPHER cryptodev_3des_cbc = { | |||
476 | NULL | 477 | NULL |
477 | }; | 478 | }; |
478 | 479 | ||
480 | const EVP_CIPHER cryptodev_bf_cbc = { | ||
481 | NID_bf_cbc, | ||
482 | 8, 16, 8, | ||
483 | EVP_CIPH_CBC_MODE, | ||
484 | cryptodev_init_key, | ||
485 | cryptodev_cipher, | ||
486 | cryptodev_cleanup, | ||
487 | sizeof(struct session_op), | ||
488 | EVP_CIPHER_set_asn1_iv, | ||
489 | EVP_CIPHER_get_asn1_iv, | ||
490 | NULL | ||
491 | }; | ||
492 | |||
493 | const EVP_CIPHER cryptodev_cast_cbc = { | ||
494 | NID_cast5_cbc, | ||
495 | 8, 16, 8, | ||
496 | EVP_CIPH_CBC_MODE, | ||
497 | cryptodev_init_key, | ||
498 | cryptodev_cipher, | ||
499 | cryptodev_cleanup, | ||
500 | sizeof(struct session_op), | ||
501 | EVP_CIPHER_set_asn1_iv, | ||
502 | EVP_CIPHER_get_asn1_iv, | ||
503 | NULL | ||
504 | }; | ||
505 | |||
506 | const EVP_CIPHER cryptodev_aes_cbc = { | ||
507 | NID_aes_128_cbc, | ||
508 | 16, 16, 16, | ||
509 | EVP_CIPH_CBC_MODE, | ||
510 | cryptodev_init_key, | ||
511 | cryptodev_cipher, | ||
512 | cryptodev_cleanup, | ||
513 | sizeof(struct session_op), | ||
514 | EVP_CIPHER_set_asn1_iv, | ||
515 | EVP_CIPHER_get_asn1_iv, | ||
516 | NULL | ||
517 | }; | ||
479 | 518 | ||
480 | /* | 519 | /* |
481 | * Registered by the ENGINE when used to find out how to deal with | 520 | * 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, | |||
499 | case NID_des_cbc: | 538 | case NID_des_cbc: |
500 | *cipher = &cryptodev_des_cbc; | 539 | *cipher = &cryptodev_des_cbc; |
501 | break; | 540 | break; |
541 | case NID_bf_cbc: | ||
542 | *cipher = &cryptodev_bf_cbc; | ||
543 | break; | ||
544 | case NID_cast5_cbc: | ||
545 | *cipher = &cryptodev_cast_cbc; | ||
546 | break; | ||
547 | case NID_aes_128_cbc: | ||
548 | *cipher = &cryptodev_aes_cbc; | ||
549 | break; | ||
502 | default: | 550 | default: |
503 | *cipher = NULL; | 551 | *cipher = NULL; |
504 | break; | 552 | break; |
diff --git a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c index 7c3728f395..fe10381906 100644 --- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c +++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2002 Bob Beck <beck@openbsd.org> | 2 | * Copyright (c) 2002 Bob Beck <beck@openbsd.org> |
3 | * Copyright (c) 2002 Theo de Raadt | 3 | * Copyright (c) 2002 Theo de Raadt |
4 | * Copyright (c) 2002 Markus Friedl | ||
4 | * All rights reserved. | 5 | * All rights reserved. |
5 | * | 6 | * |
6 | * Redistribution and use in source and binary forms, with or without | 7 | * Redistribution and use in source and binary forms, with or without |
@@ -77,9 +78,9 @@ static struct { | |||
77 | } ciphers[] = { | 78 | } ciphers[] = { |
78 | { CRYPTO_DES_CBC, NID_des_cbc, 8, 8, }, | 79 | { CRYPTO_DES_CBC, NID_des_cbc, 8, 8, }, |
79 | { CRYPTO_3DES_CBC, NID_des_ede3_cbc, 8, 24, }, | 80 | { CRYPTO_3DES_CBC, NID_des_ede3_cbc, 8, 24, }, |
80 | { CRYPTO_AES_CBC, NID_undef, 8, 24, }, | 81 | { CRYPTO_AES_CBC, NID_aes_128_cbc, 16, 16, }, |
81 | { CRYPTO_BLF_CBC, NID_bf_cbc, 8, 16, }, | 82 | { CRYPTO_BLF_CBC, NID_bf_cbc, 8, 16, }, |
82 | { CRYPTO_CAST_CBC, NID_cast5_cbc, 8, 8, }, | 83 | { CRYPTO_CAST_CBC, NID_cast5_cbc, 8, 16, }, |
83 | { CRYPTO_SKIPJACK_CBC, NID_undef, 0, 0, }, | 84 | { CRYPTO_SKIPJACK_CBC, NID_undef, 0, 0, }, |
84 | { CRYPTO_ARC4, NID_rc4, 8, 16, }, | 85 | { CRYPTO_ARC4, NID_rc4, 8, 16, }, |
85 | { 0, NID_undef, 0, 0, }, | 86 | { 0, NID_undef, 0, 0, }, |
@@ -476,6 +477,44 @@ const EVP_CIPHER cryptodev_3des_cbc = { | |||
476 | NULL | 477 | NULL |
477 | }; | 478 | }; |
478 | 479 | ||
480 | const EVP_CIPHER cryptodev_bf_cbc = { | ||
481 | NID_bf_cbc, | ||
482 | 8, 16, 8, | ||
483 | EVP_CIPH_CBC_MODE, | ||
484 | cryptodev_init_key, | ||
485 | cryptodev_cipher, | ||
486 | cryptodev_cleanup, | ||
487 | sizeof(struct session_op), | ||
488 | EVP_CIPHER_set_asn1_iv, | ||
489 | EVP_CIPHER_get_asn1_iv, | ||
490 | NULL | ||
491 | }; | ||
492 | |||
493 | const EVP_CIPHER cryptodev_cast_cbc = { | ||
494 | NID_cast5_cbc, | ||
495 | 8, 16, 8, | ||
496 | EVP_CIPH_CBC_MODE, | ||
497 | cryptodev_init_key, | ||
498 | cryptodev_cipher, | ||
499 | cryptodev_cleanup, | ||
500 | sizeof(struct session_op), | ||
501 | EVP_CIPHER_set_asn1_iv, | ||
502 | EVP_CIPHER_get_asn1_iv, | ||
503 | NULL | ||
504 | }; | ||
505 | |||
506 | const EVP_CIPHER cryptodev_aes_cbc = { | ||
507 | NID_aes_128_cbc, | ||
508 | 16, 16, 16, | ||
509 | EVP_CIPH_CBC_MODE, | ||
510 | cryptodev_init_key, | ||
511 | cryptodev_cipher, | ||
512 | cryptodev_cleanup, | ||
513 | sizeof(struct session_op), | ||
514 | EVP_CIPHER_set_asn1_iv, | ||
515 | EVP_CIPHER_get_asn1_iv, | ||
516 | NULL | ||
517 | }; | ||
479 | 518 | ||
480 | /* | 519 | /* |
481 | * Registered by the ENGINE when used to find out how to deal with | 520 | * 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, | |||
499 | case NID_des_cbc: | 538 | case NID_des_cbc: |
500 | *cipher = &cryptodev_des_cbc; | 539 | *cipher = &cryptodev_des_cbc; |
501 | break; | 540 | break; |
541 | case NID_bf_cbc: | ||
542 | *cipher = &cryptodev_bf_cbc; | ||
543 | break; | ||
544 | case NID_cast5_cbc: | ||
545 | *cipher = &cryptodev_cast_cbc; | ||
546 | break; | ||
547 | case NID_aes_128_cbc: | ||
548 | *cipher = &cryptodev_aes_cbc; | ||
549 | break; | ||
502 | default: | 550 | default: |
503 | *cipher = NULL; | 551 | *cipher = NULL; |
504 | break; | 552 | break; |