tpm: Return signature schemes supported by the key if TSS supports it
authorTobias Brunner <tobias@strongswan.org>
Mon, 15 Oct 2018 11:16:44 +0000 (13:16 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 26 Oct 2018 07:03:27 +0000 (09:03 +0200)
src/libtpmtss/plugins/tpm/tpm_private_key.c

index 3b7582a..9aeb471 100644 (file)
@@ -1,4 +1,5 @@
 /*
+ * Copyright (C) 2018 Tobias Brunner
  * Copyright (C) 2017 Andreas Steffen
  * HSR Hochschule fuer Technik Rapperswil
  *
@@ -75,6 +76,12 @@ METHOD(private_key_t, get_keysize, int,
        return this->pubkey->get_keysize(this->pubkey);
 }
 
+METHOD(private_key_t, supported_signature_schemes, enumerator_t*,
+       private_tpm_private_key_t *this)
+{
+       return this->tpm->supported_signature_schemes(this->tpm, this->handle);
+}
+
 METHOD(private_key_t, sign, bool,
        private_tpm_private_key_t *this, signature_scheme_t scheme, void *params,
        chunk_t data, chunk_t *signature)
@@ -201,6 +208,7 @@ tpm_private_key_t *tpm_private_key_connect(key_type_t type, va_list args)
                                .sign = _sign,
                                .decrypt = _decrypt,
                                .get_keysize = _get_keysize,
+                               .supported_signature_schemes = _supported_signature_schemes,
                                .get_public_key = _get_public_key,
                                .equals = private_key_equals,
                                .belongs_to = private_key_belongs_to,