summaryrefslogtreecommitdiffstats
path: root/src/crypto/crypto_null.c
diff options
context:
space:
mode:
authorMichael Brown2012-03-18 14:25:10 +0100
committerMichael Brown2012-03-18 14:35:32 +0100
commitc00eb6e190d4957c0e7c5f1e18e4ea1fbaa5a6d0 (patch)
tree2242b632d196af26bd970ed3ab45264cc9f9a5db /src/crypto/crypto_null.c
parent[crypto] Add more ASN.1 functions for X.509 certificate parsing (diff)
downloadipxe-c00eb6e190d4957c0e7c5f1e18e4ea1fbaa5a6d0.tar.gz
ipxe-c00eb6e190d4957c0e7c5f1e18e4ea1fbaa5a6d0.tar.xz
ipxe-c00eb6e190d4957c0e7c5f1e18e4ea1fbaa5a6d0.zip
[crypto] Add abstraction for a public-key algorithm
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/crypto/crypto_null.c')
-rw-r--r--src/crypto/crypto_null.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/crypto/crypto_null.c b/src/crypto/crypto_null.c
index c9c32ae9..590ac560 100644
--- a/src/crypto/crypto_null.c
+++ b/src/crypto/crypto_null.c
@@ -81,7 +81,56 @@ struct cipher_algorithm cipher_null = {
.decrypt = cipher_null_decrypt,
};
+static int pubkey_null_init ( void *ctx __unused, const void *key __unused,
+ size_t key_len __unused ) {
+ return 0;
+}
+
+static size_t pubkey_null_max_len ( void *ctx __unused ) {
+ return 0;
+}
+
+static int pubkey_null_encrypt ( void *ctx __unused,
+ const void *plaintext __unused,
+ size_t plaintext_len __unused,
+ void *ciphertext __unused ) {
+ return 0;
+}
+
+static int pubkey_null_decrypt ( void *ctx __unused,
+ const void *ciphertext __unused,
+ size_t ciphertext_len __unused,
+ void *plaintext __unused ) {
+ return 0;
+}
+
+static int pubkey_null_sign ( void *ctx __unused,
+ struct digest_algorithm *digest __unused,
+ const void *value __unused,
+ void *signature __unused ) {
+ return 0;
+}
+
+static int pubkey_null_verify ( void *ctx __unused,
+ struct digest_algorithm *digest __unused,
+ const void *value __unused,
+ const void *signature __unused ,
+ size_t signature_len __unused ) {
+ return 0;
+}
+
+static void pubkey_null_final ( void *ctx __unused ) {
+ /* Do nothing */
+}
+
struct pubkey_algorithm pubkey_null = {
.name = "null",
.ctxsize = 0,
+ .init = pubkey_null_init,
+ .max_len = pubkey_null_max_len,
+ .encrypt = pubkey_null_encrypt,
+ .decrypt = pubkey_null_decrypt,
+ .sign = pubkey_null_sign,
+ .verify = pubkey_null_verify,
+ .final = pubkey_null_final,
};