shared-key: Add a new type for Postquantum Preshared Keys
authorTobias Brunner <tobias@strongswan.org>
Wed, 25 Jul 2018 13:30:05 +0000 (15:30 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 10 Sep 2018 16:03:01 +0000 (18:03 +0200)
Using a separate type allows us to easily check if we have any PPKs
available at all.

src/libstrongswan/credentials/keys/shared_key.c
src/libstrongswan/credentials/keys/shared_key.h

index 2294eaf..9720995 100644 (file)
 
 #include "shared_key.h"
 
-ENUM(shared_key_type_names, SHARED_ANY, SHARED_PIN,
+ENUM(shared_key_type_names, SHARED_ANY, SHARED_PPK,
        "ANY",
        "IKE",
        "EAP",
        "PRIVATE_KEY_PASS",
        "PIN",
+       "NTLM",
+       "PPK",
 );
 
 typedef struct private_shared_key_t private_shared_key_t;
@@ -93,7 +95,7 @@ shared_key_t *shared_key_create(shared_key_type_t type, chunk_t key)
                        .get_key = _get_key,
                        .get_ref = _get_ref,
                        .destroy = _destroy,
-               },      
+               },
                .type = type,
                .key = key,
                .ref = 1,
index d97139d..44e6f04 100644 (file)
@@ -43,6 +43,8 @@ enum shared_key_type_t {
        SHARED_PIN,
        /** Calculated NT Hash = MD4(UTF-16LE(password)) */
        SHARED_NT_HASH,
+       /** Postquantum Preshared Key */
+       SHARED_PPK,
 };
 
 /**