|
21 | 21 | #include "unit.h" |
22 | 22 |
|
23 | 23 | #if defined(WP_HAVE_DES3CBC) || defined(WP_HAVE_AESCBC) || \ |
24 | | - defined(WP_HAVE_AESECB) || defined(WP_HAVE_AESCTR) |
| 24 | + defined(WP_HAVE_AESECB) || defined(WP_HAVE_AESCTR) || \ |
| 25 | + defined(WP_HAVE_AESCFB) |
25 | 26 |
|
26 | 27 | static int test_cipher_enc(const EVP_CIPHER *cipher, |
27 | 28 | unsigned char *key, unsigned char *iv, |
@@ -179,7 +180,8 @@ static int test_cipher_enc_dec(void *data, const char *cipher, int keyLen, |
179 | 180 | #endif |
180 | 181 |
|
181 | 182 | #if defined(WP_HAVE_DES3CBC) || defined(WP_HAVE_AESCBC) || \ |
182 | | - defined(WP_HAVE_AESECB) || defined(WP_HAVE_AESCTR) |
| 183 | + defined(WP_HAVE_AESECB) || defined(WP_HAVE_AESCTR) || \ |
| 184 | + defined(WP_HAVE_AESCFB) |
183 | 185 |
|
184 | 186 |
|
185 | 187 | /******************************************************************************/ |
@@ -542,3 +544,44 @@ int test_aes256_ctr_stream(void *data) |
542 | 544 |
|
543 | 545 | #endif /* WP_HAVE_AESCTR */ |
544 | 546 |
|
| 547 | +#ifdef WP_HAVE_AESCFB |
| 548 | + |
| 549 | +int test_aes128_cfb_stream(void *data) |
| 550 | +{ |
| 551 | + int err; |
| 552 | + |
| 553 | + err = test_stream_enc_dec(data, "AES-128-CFB", 16, 16, 16, 0); |
| 554 | + if (err == 0) |
| 555 | + err = test_stream_enc_dec(data, "AES-128-CFB", 16, 16, 1, 0); |
| 556 | + |
| 557 | + return err; |
| 558 | +} |
| 559 | + |
| 560 | +/******************************************************************************/ |
| 561 | + |
| 562 | +int test_aes192_cfb_stream(void *data) |
| 563 | +{ |
| 564 | + int err; |
| 565 | + |
| 566 | + err = test_stream_enc_dec(data, "AES-192-CFB", 24, 16, 15, 0); |
| 567 | + if (err == 0) |
| 568 | + err = test_stream_enc_dec(data, "AES-192-CFB", 24, 16, 2, 0); |
| 569 | + |
| 570 | + return err; |
| 571 | +} |
| 572 | + |
| 573 | +/******************************************************************************/ |
| 574 | + |
| 575 | +int test_aes256_cfb_stream(void *data) |
| 576 | +{ |
| 577 | + int err; |
| 578 | + |
| 579 | + err = test_stream_enc_dec(data, "AES-256-CFB", 32, 16, 14, 0); |
| 580 | + if (err == 0) |
| 581 | + err = test_stream_enc_dec(data, "AES-256-CFB", 32, 16, 3, 0); |
| 582 | + |
| 583 | + return err; |
| 584 | +} |
| 585 | + |
| 586 | +#endif /* WP_HAVE_AESCFB */ |
| 587 | + |
0 commit comments