From f279a66d82ed47db823f56c423c0f51eb2d38467 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 7 Jan 2022 11:13:38 +0100 Subject: [PATCH 1/3] tests/sys_crypto_aes_ccm: use CIPHER_AES instead of CIPHER_AES_128 --- tests/sys_crypto_aes_ccm/tests-crypto-modes-ccm-128.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/sys_crypto_aes_ccm/tests-crypto-modes-ccm-128.c b/tests/sys_crypto_aes_ccm/tests-crypto-modes-ccm-128.c index 5c06226c5b..85b019293d 100644 --- a/tests/sys_crypto_aes_ccm/tests-crypto-modes-ccm-128.c +++ b/tests/sys_crypto_aes_ccm/tests-crypto-modes-ccm-128.c @@ -2186,7 +2186,7 @@ static void test_encrypt_op(const uint8_t *key, uint8_t key_len, TEST_ASSERT_MESSAGE(sizeof(data) >= output_expected_len, "Output buffer too small"); - err = cipher_init(&cipher, CIPHER_AES_128, key, key_len); + err = cipher_init(&cipher, CIPHER_AES, key, key_len); TEST_ASSERT_EQUAL_INT(1, err); len = cipher_encrypt_ccm(&cipher, adata, adata_len, @@ -2214,7 +2214,7 @@ static void test_decrypt_op(const uint8_t *key, uint8_t key_len, TEST_ASSERT_MESSAGE(sizeof(data) >= output_expected_len, "Output buffer too small"); - err = cipher_init(&cipher, CIPHER_AES_128, key, key_len); + err = cipher_init(&cipher, CIPHER_AES, key, key_len); TEST_ASSERT_EQUAL_INT(1, err); len = cipher_decrypt_ccm(&cipher, adata, adata_len, From 0e977b89ae606f197ff9040c3522825940ed2f10 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 7 Jan 2022 11:14:10 +0100 Subject: [PATCH 2/3] sys/crypto: remove deprecated CIPHER_AES_128 --- sys/crypto/aes.c | 1 - sys/fido2/ctap/ctap_crypto.c | 2 +- sys/include/crypto/ciphers.h | 8 -------- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/sys/crypto/aes.c b/sys/crypto/aes.c index 776b6cc192..22f3adb8c5 100644 --- a/sys/crypto/aes.c +++ b/sys/crypto/aes.c @@ -72,7 +72,6 @@ static const cipher_interface_t aes_interface = { aes_decrypt }; -const cipher_id_t CIPHER_AES_128 = &aes_interface; const cipher_id_t CIPHER_AES = &aes_interface; static const u32 Te0[256] = { diff --git a/sys/fido2/ctap/ctap_crypto.c b/sys/fido2/ctap/ctap_crypto.c index 86b54c5629..ecc4ffd9e7 100644 --- a/sys/fido2/ctap/ctap_crypto.c +++ b/sys/fido2/ctap/ctap_crypto.c @@ -196,7 +196,7 @@ int fido2_ctap_crypto_aes_ccm_enc(uint8_t *out, size_t out_len, cipher_t cipher; int ret; - ret = cipher_init(&cipher, CIPHER_AES_128, key, key_len); + ret = cipher_init(&cipher, CIPHER_AES, key, key_len); if (ret != 1) { return CTAP1_ERR_OTHER; diff --git a/sys/include/crypto/ciphers.h b/sys/include/crypto/ciphers.h index 19b133410d..3ae2845473 100644 --- a/sys/include/crypto/ciphers.h +++ b/sys/include/crypto/ciphers.h @@ -107,14 +107,6 @@ typedef struct cipher_interface_st { /** Pointer type to BlockCipher-Interface for the Cipher-Algorithms */ typedef const cipher_interface_t *cipher_id_t; -/** - * @brief AES_128 cipher id - * - * @deprecated Use @ref CIPHER_AES instead. Will be removed after 2021.07 - * release. - */ -extern const cipher_id_t CIPHER_AES_128; - /** * @brief AES cipher id */ From cdeaf007fe0f67d2f90f97554133f8acf7256e3f Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 7 Jan 2022 17:24:14 +0100 Subject: [PATCH 3/3] pkg/ndn-riot: add patch to fix CIPHER_AES_128 removal --- ...recated-CIPHER_AES_128-by-CIPHER_AES.patch | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 pkg/ndn-riot/patches/0006-replace-deprecated-CIPHER_AES_128-by-CIPHER_AES.patch diff --git a/pkg/ndn-riot/patches/0006-replace-deprecated-CIPHER_AES_128-by-CIPHER_AES.patch b/pkg/ndn-riot/patches/0006-replace-deprecated-CIPHER_AES_128-by-CIPHER_AES.patch new file mode 100644 index 0000000000..fd0a30a1f0 --- /dev/null +++ b/pkg/ndn-riot/patches/0006-replace-deprecated-CIPHER_AES_128-by-CIPHER_AES.patch @@ -0,0 +1,34 @@ +From a69fe71eb8e915db21bda6879ce0f8b768e5982d Mon Sep 17 00:00:00 2001 +From: Alexandre Abadie +Date: Fri, 7 Jan 2022 17:20:46 +0100 +Subject: [PATCH] replace deprecated CIPHER_AES_128 by CIPHER_AES + +--- + encoding/data.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/encoding/data.c b/encoding/data.c +index 6abf186..afebde4 100644 +--- a/encoding/data.c ++++ b/encoding/data.c +@@ -437,7 +437,7 @@ ndn_shared_block_t* ndn_data_encrypt_with_ccm(ndn_block_t* name, + + // Initiate cipher + cipher_t cipher; +- if (cipher_init(&cipher, CIPHER_AES_128, key, key_len) < 0) { ++ if (cipher_init(&cipher, CIPHER_AES, key, key_len) < 0) { + DEBUG("ndn_encoding: cannot init ccm cipher for encryption\n"); + return NULL; + } +@@ -1027,7 +1027,7 @@ ndn_shared_block_t* ndn_data_decrypt_with_ccm(ndn_block_t* block, + + // Initiate cipher + cipher_t cipher; +- if (cipher_init(&cipher, CIPHER_AES_128, key, key_len) < 0) { ++ if (cipher_init(&cipher, CIPHER_AES, key, key_len) < 0) { + DEBUG("ndn_encoding: cannot init ccm cipher for decryption\n"); + return NULL; + } +-- +2.32.0 +