Commit 75dd6d64 authored by Matt Caswell's avatar Matt Caswell
Browse files

Implement AES CFB ciphers in the default provider

parent ed98df51
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -148,6 +148,15 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
        case NID_aes_256_ofb128:
        case NID_aes_192_ofb128:
        case NID_aes_128_ofb128:
        case NID_aes_256_cfb128:
        case NID_aes_192_cfb128:
        case NID_aes_128_cfb128:
        case NID_aes_256_cfb1:
        case NID_aes_192_cfb1:
        case NID_aes_128_cfb1:
        case NID_aes_256_cfb8:
        case NID_aes_192_cfb8:
        case NID_aes_128_cfb8:
            break;
        default:
            goto legacy;
+24 −0
Original line number Diff line number Diff line
@@ -205,6 +205,19 @@ IMPLEMENT_new_ctx(ofb, OFB, 256)
IMPLEMENT_new_ctx(ofb, OFB, 192)
IMPLEMENT_new_ctx(ofb, OFB, 128)

/* CFB */
IMPLEMENT_new_params(cfb, CFB)
IMPLEMENT_new_params(cfb1, CFB)
IMPLEMENT_new_params(cfb8, CFB)
IMPLEMENT_new_ctx(cfb, CFB, 256)
IMPLEMENT_new_ctx(cfb, CFB, 192)
IMPLEMENT_new_ctx(cfb, CFB, 128)
IMPLEMENT_new_ctx(cfb1, CFB, 256)
IMPLEMENT_new_ctx(cfb1, CFB, 192)
IMPLEMENT_new_ctx(cfb1, CFB, 128)
IMPLEMENT_new_ctx(cfb8, CFB, 256)
IMPLEMENT_new_ctx(cfb8, CFB, 192)
IMPLEMENT_new_ctx(cfb8, CFB, 128)

static void aes_freectx(void *vctx)
{
@@ -338,3 +351,14 @@ IMPLEMENT_block_funcs(cbc, 128, 16)
IMPLEMENT_stream_funcs(ofb, 256, 16)
IMPLEMENT_stream_funcs(ofb, 192, 16)
IMPLEMENT_stream_funcs(ofb, 128, 16)

/* CFB */
IMPLEMENT_stream_funcs(cfb, 256, 16)
IMPLEMENT_stream_funcs(cfb, 192, 16)
IMPLEMENT_stream_funcs(cfb, 128, 16)
IMPLEMENT_stream_funcs(cfb1, 256, 16)
IMPLEMENT_stream_funcs(cfb1, 192, 16)
IMPLEMENT_stream_funcs(cfb1, 128, 16)
IMPLEMENT_stream_funcs(cfb8, 256, 16)
IMPLEMENT_stream_funcs(cfb8, 192, 16)
IMPLEMENT_stream_funcs(cfb8, 128, 16)
+9 −0
Original line number Diff line number Diff line
@@ -20,3 +20,12 @@ extern const OSSL_DISPATCH aes128cbc_functions[];
extern const OSSL_DISPATCH aes256ofb_functions[];
extern const OSSL_DISPATCH aes192ofb_functions[];
extern const OSSL_DISPATCH aes128ofb_functions[];
extern const OSSL_DISPATCH aes256cfb_functions[];
extern const OSSL_DISPATCH aes192cfb_functions[];
extern const OSSL_DISPATCH aes128cfb_functions[];
extern const OSSL_DISPATCH aes256cfb1_functions[];
extern const OSSL_DISPATCH aes192cfb1_functions[];
extern const OSSL_DISPATCH aes128cfb1_functions[];
extern const OSSL_DISPATCH aes256cfb8_functions[];
extern const OSSL_DISPATCH aes192cfb8_functions[];
extern const OSSL_DISPATCH aes128cfb8_functions[];
+9 −0
Original line number Diff line number Diff line
@@ -65,6 +65,15 @@ static const OSSL_ALGORITHM deflt_ciphers[] = {
    { "AES-256-OFB", "default=yes", aes256ofb_functions },
    { "AES-192-OFB", "default=yes", aes192ofb_functions },
    { "AES-128-OFB", "default=yes", aes128ofb_functions },
    { "AES-256-CFB", "default=yes", aes256cfb_functions },
    { "AES-192-CFB", "default=yes", aes192cfb_functions },
    { "AES-128-CFB", "default=yes", aes128cfb_functions },
    { "AES-256-CFB1", "default=yes", aes256cfb1_functions },
    { "AES-192-CFB1", "default=yes", aes192cfb1_functions },
    { "AES-128-CFB1", "default=yes", aes128cfb1_functions },
    { "AES-256-CFB8", "default=yes", aes256cfb8_functions },
    { "AES-192-CFB8", "default=yes", aes192cfb8_functions },
    { "AES-128-CFB8", "default=yes", aes128cfb8_functions },
    { NULL, NULL, NULL }
};