hasher: Add uppercase short names for hash algorithms
authorTobias Brunner <tobias@strongswan.org>
Thu, 16 Nov 2017 16:13:36 +0000 (17:13 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 17 Nov 2017 08:30:53 +0000 (09:30 +0100)
src/libstrongswan/crypto/hashers/hasher.c
src/libstrongswan/crypto/hashers/hasher.h

index 713d7be..9f9fcd3 100644 (file)
@@ -57,6 +57,24 @@ ENUM_NEXT(hash_algorithm_short_names, HASH_UNKNOWN, HASH_SHA3_512, HASH_IDENTITY
        "sha3_512");
 ENUM_END(hash_algorithm_short_names, HASH_SHA3_512);
 
+ENUM_BEGIN(hash_algorithm_short_names_upper, HASH_SHA1, HASH_IDENTITY,
+       "SHA1",
+       "SHA256",
+       "SHA384",
+       "SHA512",
+       "IDENTITY");
+ENUM_NEXT(hash_algorithm_short_names_upper, HASH_UNKNOWN, HASH_SHA3_512, HASH_IDENTITY,
+       "UNKNOWN",
+       "MD2",
+       "MD4",
+       "MD5",
+       "SHA224",
+       "SHA3_224",
+       "SHA3_256",
+       "SHA3_384",
+       "SHA3_512");
+ENUM_END(hash_algorithm_short_names_upper, HASH_SHA3_512);
+
 /*
  * Described in header
  */
index d1f11fa..4165455 100644 (file)
@@ -74,6 +74,11 @@ extern enum_name_t *hash_algorithm_names;
 extern enum_name_t *hash_algorithm_short_names;
 
 /**
+ * Uppercase short names for hash_algorithm_names
+ */
+extern enum_name_t *hash_algorithm_short_names_upper;
+
+/**
  * Generic interface for all hash functions.
  */
 struct hasher_t {