'sha' and 'sha1' are now treated as synonyms
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 23 Aug 2006 12:07:07 +0000 (12:07 -0000)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 23 Aug 2006 12:07:07 +0000 (12:07 -0000)
src/pluto/alg_info.c

index e8c84b4..ac5d167 100644 (file)
@@ -192,6 +192,10 @@ aalg_getbyname_esp(const char *const str, int len)
     if (!str || !*str)
        return -1;
 
+    /* interpret 'SHA' as 'SHA1' */
+    if (strncasecmp("SHA", str, len) == 0)
+       return enum_search(&auth_alg_names, "AUTH_ALGORITHM_HMAC_SHA1");
+
     ret = enum_search_prefix(&auth_alg_names,"AUTH_ALGORITHM_HMAC_", str ,len);
     if (ret >= 0)
        return ret;
@@ -337,6 +341,10 @@ aalg_getbyname_ike(const char *const str, int len)
     if (!str || !*str)
        return -1;
 
+    /* interpret 'SHA1' as 'SHA' */
+    if (strncasecmp("SHA1", str, len) == 0)
+       return enum_search(&oakley_hash_names, "OAKLEY_SHA");
+
     ret = enum_search_prefix(&oakley_hash_names,"OAKLEY_", str, len);
     if (ret >= 0)
        return ret;