aboutsummaryrefslogtreecommitdiffstats
path: root/src/libtls/tls_crypto.h
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2010-09-02 19:15:16 +0200
committerMartin Willi <martin@revosec.ch>2010-09-02 19:33:08 +0200
commitd29a82a9d4b517fada07d220c730d4d9b5fd210e (patch)
treeaa0e78ffb35069dd754822f0a77dd11e810ed622 /src/libtls/tls_crypto.h
parent60c4b3b545079cb96dd28746ca40051bb7aaefef (diff)
downloadstrongswan-d29a82a9d4b517fada07d220c730d4d9b5fd210e.tar.bz2
strongswan-d29a82a9d4b517fada07d220c730d4d9b5fd210e.tar.xz
Added generic TLS data sign/verify, hash/sig algorithm construction
Diffstat (limited to 'src/libtls/tls_crypto.h')
-rw-r--r--src/libtls/tls_crypto.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/libtls/tls_crypto.h b/src/libtls/tls_crypto.h
index be4005dad..833928a8a 100644
--- a/src/libtls/tls_crypto.h
+++ b/src/libtls/tls_crypto.h
@@ -329,6 +329,13 @@ struct tls_crypto_t {
tls_cipher_suite_t *suites, int count);
/**
+ * Write the list of supported hash/sig algorithms to writer.
+ *
+ * @param writer writer to write supported hash/sig algorithms
+ */
+ void (*get_signature_algorithms)(tls_crypto_t *this, tls_writer_t *writer);
+
+ /**
* Set the protection layer of the TLS stack to control it.
*
* @param protection protection layer to work on
@@ -345,6 +352,29 @@ struct tls_crypto_t {
tls_handshake_type_t type, chunk_t data);
/**
+ * Sign a blob of data, append signature to writer.
+ *
+ * @param key private key to use for signature
+ * @param writer TLS writer to write signature to
+ * @param data data to sign
+ * @param hashsig list of TLS1.2 hash/sig algorithms to select from
+ * @return TRUE if signature create successfully
+ */
+ bool (*sign)(tls_crypto_t *this, private_key_t *key,
+ tls_writer_t *writer, chunk_t data, chunk_t hashsig);
+
+ /**
+ * Verify a blob of data, read signature from a reader.
+ *
+ * @param key public key to verify signature with
+ * @param reader TLS reader to read signature from
+ * @param data data to verify signature
+ * @return TRUE if signature valid
+ */
+ bool (*verify)(tls_crypto_t *this, public_key_t *key,
+ tls_reader_t *reader, chunk_t data);
+
+ /**
* Create a signature of the handshake data using a given private key.
*
* @param key private key to use for signature