support for @#hex ID_KEY_ID identification_t
authorMartin Willi <martin@strongswan.org>
Tue, 6 May 2008 13:45:14 +0000 (13:45 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 6 May 2008 13:45:14 +0000 (13:45 -0000)
src/libstrongswan/utils/identification.c

index 45f9c6f..7c4c2e9 100644 (file)
@@ -1115,9 +1115,11 @@ identification_t *identification_create_from_string(char *string)
                {
                        if (*(string + 1) == '#')
                        {
-                               /* TODO: Pluto handles '#' as hex encoded ID_KEY_ID. */
-                               free(this);
-                               return NULL;
+                               string += 2;
+                               this->type = ID_KEY_ID;
+                               this->encoded = chunk_from_hex(
+                                                                       chunk_create(string, strlen(string)), NULL);
+                               return &(this->public);
                        }
                        else
                        {