]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
keymat_v2: Add method to create QSKE implementation
authorTobias Brunner <tobias@strongswan.org>
Thu, 28 Jun 2018 09:38:54 +0000 (11:38 +0200)
committerTobias Brunner <tobias@strongswan.org>
Tue, 14 May 2019 08:53:14 +0000 (10:53 +0200)
src/charon-tkm/src/tkm/tkm_keymat.c
src/libcharon/sa/ikev2/keymat_v2.c
src/libcharon/sa/ikev2/keymat_v2.h

index 1107c2219ddd13da790e044ccfe5297326cc8dd5..db2db8b427706144bba4c2c8ae7eb5618b669ef6 100644 (file)
@@ -522,6 +522,7 @@ tkm_keymat_t *tkm_keymat_create(bool initiator)
                                        .get_aead = _get_aead,
                                        .destroy = _destroy,
                                },
+                               .create_qske = (void*)return_null,
                                .derive_ike_keys = _derive_ike_keys,
                                .derive_ike_keys_ppk = (void*)return_false,
                                .derive_child_keys = _derive_child_keys,
index db46b816b3182a5d56fd2eb70b3be7a71b736661..93eaee6f415326d8980c2f42a3a87847568fb946 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Tobias Brunner
+ * Copyright (C) 2015-2018 Tobias Brunner
  * Copyright (C) 2008 Martin Willi
  * HSR Hochschule fuer Technik Rapperswil
  *
@@ -90,6 +90,12 @@ METHOD(keymat_t, create_dh, diffie_hellman_t*,
        return lib->crypto->create_dh(lib->crypto, group);
 }
 
+METHOD(keymat_v2_t, create_qske, qske_t*,
+       private_keymat_v2_t *this, qske_mechanism_t mechanism)
+{
+       return lib->crypto->create_qske(lib->crypto, mechanism);
+}
+
 METHOD(keymat_t, create_nonce_gen, nonce_gen_t*,
        private_keymat_v2_t *this)
 {
@@ -862,6 +868,7 @@ keymat_v2_t *keymat_v2_create(bool initiator)
                                .get_aead = _get_aead,
                                .destroy = _destroy,
                        },
+                       .create_qske = _create_qske,
                        .derive_ike_keys = _derive_ike_keys,
                        .derive_ike_keys_ppk = _derive_ike_keys_ppk,
                        .derive_child_keys = _derive_child_keys,
index 3cc071aeb4f0734117a1efa986d4f22ebc40797d..612747051d9c5ae180a597acb6bd511b7ce6ee56 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2015 Tobias Brunner
+ * Copyright (C) 2011-2018 Tobias Brunner
  * HSR Hochschule fuer Technik Rapperswil
  *
  * This program is free software; you can redistribute it and/or modify it
@@ -36,6 +36,17 @@ struct keymat_v2_t {
         */
        keymat_t keymat;
 
+       /**
+        * Create a QSKE object.
+        *
+        * Only QSKE objects allocated through this method are passed to other
+        * keymat_t methods, allowing private QSKE implementations.
+        *
+        * @param mechanism     QSKE mechanism
+        * @return                      QSKE object, NULL if mechanism not supported
+        */
+       qske_t* (*create_qske)(keymat_v2_t *this, qske_mechanism_t mechanism);
+
        /**
         * Derive keys for the IKE_SA.
         *
@@ -90,6 +101,7 @@ struct keymat_v2_t {
                                                          chunk_t nonce_i, chunk_t nonce_r,
                                                          chunk_t *encr_i, chunk_t *integ_i,
                                                          chunk_t *encr_r, chunk_t *integ_r);
+
        /**
         * Get SKd to pass to derive_ikey_keys() during rekeying.
         *