From 29088a414610b1eea20aaeb89d31ffd433eb442c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Tue, 1 Feb 2022 09:38:26 +0100 Subject: [PATCH] Avoid duplicate program names MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Visual Studio and CMake didn't like having targets with the same name, albeit in different directories. Signed-off-by: Manuel Pégourié-Gonnard --- programs/.gitignore | 4 ++-- programs/Makefile | 16 ++++++++-------- programs/cipher/CMakeLists.txt | 2 +- .../cipher/{aead_demo.c => cipher_aead_demo.c} | 2 +- programs/hash/CMakeLists.txt | 2 +- programs/hash/{hmac_demo.c => md_hmac_demo.c} | 0 programs/psa/aead_demo.c | 4 ++-- programs/psa/hmac_demo.c | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) rename programs/cipher/{aead_demo.c => cipher_aead_demo.c} (98%) rename programs/hash/{hmac_demo.c => md_hmac_demo.c} (100%) diff --git a/programs/.gitignore b/programs/.gitignore index 076821fceb..7fe0401e57 100644 --- a/programs/.gitignore +++ b/programs/.gitignore @@ -13,10 +13,10 @@ *.exe aes/crypt_and_hash -cipher/aead_demo +cipher/cipher_aead_demo hash/generic_sum hash/hello -hash/hmac_demo +hash/md_hmac_demo hash/md5sum hash/sha1sum hash/sha2sum diff --git a/programs/Makefile b/programs/Makefile index fccddc69db..31295f67c3 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -62,10 +62,10 @@ endif ## make sure to check that it still works if you tweak the format here. APPS = \ aes/crypt_and_hash \ - cipher/aead_demo \ + cipher/cipher_aead_demo \ hash/generic_sum \ hash/hello \ - hash/hmac_demo \ + hash/md_hmac_demo \ pkey/dh_client \ pkey/dh_genprime \ pkey/dh_server \ @@ -177,9 +177,9 @@ aes/crypt_and_hash$(EXEXT): aes/crypt_and_hash.c $(DEP) echo " CC aes/crypt_and_hash.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) aes/crypt_and_hash.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ -cipher/aead_demo$(EXEXT): cipher/aead_demo.c $(DEP) - echo " CC cipher/aead_demo.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) cipher/aead_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ +cipher/cipher_aead_demo$(EXEXT): cipher/cipher_aead_demo.c $(DEP) + echo " CC cipher/cipher_aead_demo.c" + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) cipher/cipher_aead_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ hash/generic_sum$(EXEXT): hash/generic_sum.c $(DEP) echo " CC hash/generic_sum.c" @@ -189,9 +189,9 @@ hash/hello$(EXEXT): hash/hello.c $(DEP) echo " CC hash/hello.c" $(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/hello.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ -hash/hmac_demo$(EXEXT): hash/hmac_demo.c $(DEP) - echo " CC hash/hmac_demo.c" - $(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/hmac_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ +hash/md_hmac_demo$(EXEXT): hash/md_hmac_demo.c $(DEP) + echo " CC hash/md_hmac_demo.c" + $(CC) $(LOCAL_CFLAGS) $(CFLAGS) hash/md_hmac_demo.c $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ pkey/dh_client$(EXEXT): pkey/dh_client.c $(DEP) echo " CC pkey/dh_client.c" diff --git a/programs/cipher/CMakeLists.txt b/programs/cipher/CMakeLists.txt index cc16849c2a..93e5f31ee8 100644 --- a/programs/cipher/CMakeLists.txt +++ b/programs/cipher/CMakeLists.txt @@ -1,5 +1,5 @@ set(executables - aead_demo + cipher_aead_demo ) foreach(exe IN LISTS executables) diff --git a/programs/cipher/aead_demo.c b/programs/cipher/cipher_aead_demo.c similarity index 98% rename from programs/cipher/aead_demo.c rename to programs/cipher/cipher_aead_demo.c index 894225d80a..4da1bfc5b4 100644 --- a/programs/cipher/aead_demo.c +++ b/programs/cipher/cipher_aead_demo.c @@ -66,7 +66,7 @@ int main( void ) /* The real program starts here. */ -const char usage[] = "Usage: aead_demo [aes128-gcm|aes256-gcm|aes128-gcm_8|chachapoly]"; +const char usage[] = "Usage: cipher_aead_demo [aes128-gcm|aes256-gcm|aes128-gcm_8|chachapoly]"; /* Dummy data for encryption: IV/nonce, additional data, 2-part message */ const unsigned char iv1[12] = { 0x00 }; diff --git a/programs/hash/CMakeLists.txt b/programs/hash/CMakeLists.txt index 9ff1df1d18..da98188443 100644 --- a/programs/hash/CMakeLists.txt +++ b/programs/hash/CMakeLists.txt @@ -1,7 +1,7 @@ set(executables generic_sum hello - hmac_demo + md_hmac_demo ) foreach(exe IN LISTS executables) diff --git a/programs/hash/hmac_demo.c b/programs/hash/md_hmac_demo.c similarity index 100% rename from programs/hash/hmac_demo.c rename to programs/hash/md_hmac_demo.c diff --git a/programs/psa/aead_demo.c b/programs/psa/aead_demo.c index 4c7a5222c8..396e82883a 100644 --- a/programs/psa/aead_demo.c +++ b/programs/psa/aead_demo.c @@ -4,7 +4,7 @@ * This program AEAD-encrypts a message, using the algorithm and key size * specified on the command line, using the multi-part API. * - * It comes with a companion program cipher/aead_demo.c, which does the same + * It comes with a companion program cipher/cipher_aead_demo.c, which does the same * operations with the legacy Cipher API. The goal is that comparing the two * programs will help people migrating to the PSA Crypto API. * @@ -18,7 +18,7 @@ * On the other hand, with PSA, the algorithms encodes the desired tag length; * with Cipher the desired tag length needs to be tracked separately. * - * This program and its companion cipher/aead_demo.c illustrate this by doing the + * This program and its companion cipher/cipher_aead_demo.c illustrate this by doing the * same sequence of multi-part AEAD computation with both APIs; looking at the * two side by side should make the differences and similarities clear. */ diff --git a/programs/psa/hmac_demo.c b/programs/psa/hmac_demo.c index 2786bb3766..54fea038a3 100644 --- a/programs/psa/hmac_demo.c +++ b/programs/psa/hmac_demo.c @@ -3,7 +3,7 @@ * * This programs computes the HMAC of two messages using the multi-part API. * - * It comes with a companion program hash/hmac_demo.c, which does the same + * It comes with a companion program hash/md_hmac_demo.c, which does the same * operations with the legacy MD API. The goal is that comparing the two * programs will help people migrating to the PSA Crypto API. * @@ -13,7 +13,7 @@ * objects: (1) a psa_key_id_t to hold the key, and (2) a psa_operation_t for * multi-part progress. * - * This program and its companion hash/hmac_demo.c illustrate this by doing the + * This program and its companion hash/md_hmac_demo.c illustrate this by doing the * same sequence of multi-part HMAC computation with both APIs; looking at the * two side by side should make the differences and similarities clear. */