diff --git a/src/crypto/axtls_aes.c b/src/crypto/axtls_aes.c index ac7e921d..f36a230c 100644 --- a/src/crypto/axtls_aes.c +++ b/src/crypto/axtls_aes.c @@ -4,7 +4,7 @@ #include #include -static int aes_setkey ( void *ctx, const void *key, size_t keylen ) { +static int aes_cbc_setkey ( void *ctx, const void *key, size_t keylen ) { AES_CTX *aesctx = ctx; AES_MODE mode; @@ -23,32 +23,32 @@ static int aes_setkey ( void *ctx, const void *key, size_t keylen ) { return 0; } -static void aes_setiv ( void *ctx, const void *iv ) { +static void aes_cbc_setiv ( void *ctx, const void *iv ) { AES_CTX *aesctx = ctx; memcpy ( aesctx->iv, iv, sizeof ( aesctx->iv ) ); } -static void aes_encrypt ( void *ctx, const void *data, void *dst, - size_t len ) { +static void aes_cbc_encrypt ( void *ctx, const void *data, void *dst, + size_t len ) { AES_CTX *aesctx = ctx; AES_cbc_encrypt ( aesctx, data, dst, len ); } -static void aes_decrypt ( void *ctx, const void *data, void *dst, - size_t len ) { +static void aes_cbc_decrypt ( void *ctx, const void *data, void *dst, + size_t len ) { AES_CTX *aesctx = ctx; AES_cbc_decrypt ( aesctx, data, dst, len ); } -struct crypto_algorithm aes_algorithm = { - .name = "aes", +struct crypto_algorithm aes_cbc_algorithm = { + .name = "aes_cbc", .ctxsize = sizeof ( AES_CTX ), .blocksize = 16, - .setkey = aes_setkey, - .setiv = aes_setiv, - .encode = aes_encrypt, - .decode = aes_decrypt, + .setkey = aes_cbc_setkey, + .setiv = aes_cbc_setiv, + .encode = aes_cbc_encrypt, + .decode = aes_cbc_decrypt, }; diff --git a/src/include/gpxe/aes.h b/src/include/gpxe/aes.h index 75cb4c44..dd6e7734 100644 --- a/src/include/gpxe/aes.h +++ b/src/include/gpxe/aes.h @@ -3,6 +3,6 @@ struct crypto_algorithm; -extern struct crypto_algorithm aes_algorithm; +extern struct crypto_algorithm aes_cbc_algorithm; #endif /* _GPXE_AES_H */ diff --git a/src/net/tls.c b/src/net/tls.c index f5bff7a4..df872d42 100644 --- a/src/net/tls.c +++ b/src/net/tls.c @@ -486,12 +486,12 @@ static int tls_select_cipher ( struct tls_session *tls, switch ( cipher_suite ) { case htons ( TLS_RSA_WITH_AES_128_CBC_SHA ): key_len = ( 128 / 8 ); - cipher = &aes_algorithm; + cipher = &aes_cbc_algorithm; digest = &sha1_algorithm; break; case htons ( TLS_RSA_WITH_AES_256_CBC_SHA ): key_len = ( 256 / 8 ); - cipher = &aes_algorithm; + cipher = &aes_cbc_algorithm; digest = &sha1_algorithm; break; default: