aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2017-06-09 09:46:42 -0400
committerJack Lloyd <[email protected]>2017-06-09 09:46:42 -0400
commit9ae4536f9d891bcedaa21f012689351f5cf4e908 (patch)
tree8cf958ae4e862bd6166eb0b357bf810eb6b44bd2
parentc3a97f3f02c06bfbaa673a2e2555dd9b312f87a7 (diff)
Fix FFI build when Ed25519 disabled
-rw-r--r--src/lib/ffi/ffi.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp
index 7f07339e3..5bf4fe641 100644
--- a/src/lib/ffi/ffi.cpp
+++ b/src/lib/ffi/ffi.cpp
@@ -1623,7 +1623,7 @@ int botan_privkey_load_ed25519(botan_privkey_t* key,
return -1;
#else
- BOTAN_UNUSED(key, pubkey);
+ BOTAN_UNUSED(key, privkey);
return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
#endif
}
@@ -1654,6 +1654,7 @@ int botan_pubkey_load_ed25519(botan_pubkey_t* key,
int botan_privkey_ed25519_get_privkey(botan_privkey_t key,
uint8_t output[64])
{
+#if defined(BOTAN_HAS_ED25519)
return BOTAN_FFI_DO(Botan::Private_Key, key, k, {
if(Botan::Ed25519_PrivateKey* ed = dynamic_cast<Botan::Ed25519_PrivateKey*>(&k))
{
@@ -1668,11 +1669,16 @@ int botan_privkey_ed25519_get_privkey(botan_privkey_t key,
return -1;
}
});
+#else
+ BOTAN_UNUSED(key, output);
+ return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
+#endif
}
int botan_pubkey_ed25519_get_pubkey(botan_pubkey_t key,
uint8_t output[32])
{
+#if defined(BOTAN_HAS_ED25519)
return BOTAN_FFI_DO(Botan::Public_Key, key, k, {
if(Botan::Ed25519_PublicKey* ed = dynamic_cast<Botan::Ed25519_PublicKey*>(&k))
{
@@ -1687,6 +1693,10 @@ int botan_pubkey_ed25519_get_pubkey(botan_pubkey_t key,
return -1;
}
});
+#else
+ BOTAN_UNUSED(key, output);
+ return BOTAN_FFI_ERROR_NOT_IMPLEMENTED;
+#endif
}
int botan_pubkey_get_field(botan_mp_t output,