added support for AUTH_HMAC_SHA1_160
authorAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 4 May 2009 21:01:40 +0000 (23:01 +0200)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Mon, 4 May 2009 21:01:40 +0000 (23:01 +0200)
src/libstrongswan/crypto/signers/signer.c
src/libstrongswan/crypto/signers/signer.h
src/libstrongswan/plugins/hmac/hmac_signer.c

index 291e28d..d7be3c1 100644 (file)
 ENUM_BEGIN(integrity_algorithm_names, AUTH_UNDEFINED, AUTH_HMAC_SHA1_128,
        "UNDEFINED",
        "AUTH_HMAC_SHA1_128");
-ENUM_NEXT(integrity_algorithm_names, AUTH_HMAC_MD5_96, AUTH_HMAC_MD5_128, AUTH_HMAC_SHA1_128,
+ENUM_NEXT(integrity_algorithm_names, AUTH_HMAC_MD5_96, AUTH_HMAC_SHA1_160, AUTH_HMAC_SHA1_128,
        "HMAC_MD5_96",
        "HMAC_SHA1_96",
        "DES_MAC",
        "KPDK_MD5",
        "AES_XCBC_96",
-       "HMAC_MD5_128");
-ENUM_NEXT(integrity_algorithm_names, AUTH_HMAC_SHA2_256_128, AUTH_HMAC_SHA2_512_256, AUTH_HMAC_MD5_128,
+       "HMAC_MD5_128",
+       "HMAC_SHA1_160");
+ENUM_NEXT(integrity_algorithm_names, AUTH_HMAC_SHA2_256_128, AUTH_HMAC_SHA2_512_256, AUTH_HMAC_SHA1_160,
        "AUTH_HMAC_SHA2_256_128",
        "AUTH_HMAC_SHA2_384_192",
        "AUTH_HMAC_SHA2_512_256");
index 3b6433e..fc3d7a3 100644 (file)
@@ -41,8 +41,10 @@ enum integrity_algorithm_t {
        AUTH_DES_MAC = 3,
        AUTH_KPDK_MD5 = 4,
        AUTH_AES_XCBC_96 = 5,
-       /** RFC4595, used for RADIUS */
+       /** RFC4595, used for IKEv1 or RADIUS */
        AUTH_HMAC_MD5_128 = 6,
+       /** RFC4595, used for IKEv1 */
+       AUTH_HMAC_SHA1_160 = 7,
        /** Implemented via hmac_signer_t */
        AUTH_HMAC_SHA2_256_128 = 12,
        /** Implemented via hmac_signer_t */
index f37ae27..b44bc21 100644 (file)
@@ -153,6 +153,10 @@ hmac_signer_t *hmac_signer_create(integrity_algorithm_t algo)
                        hash = HASH_SHA1;
                        trunc = 16;
                        break;
+               case AUTH_HMAC_SHA1_160:
+                       hash = HASH_SHA1;
+                       trunc = 20;
+                       break;
                case AUTH_HMAC_MD5_96:
                        hash = HASH_MD5;
                        trunc = 12;