shared-key: Add a new type for Postquantum Preshared Keys

Using a separate type allows us to easily check if we have any PPKs
available at all.
This commit is contained in:
Tobias Brunner 2018-07-25 15:30:05 +02:00
parent 0f423dda28
commit bac3ca2324
2 changed files with 6 additions and 2 deletions

View File

@ -15,12 +15,14 @@
#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,

View 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,
};
/**