aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcryptobox/keypairs_cache.c
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-05 14:47:25 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2016-02-05 14:47:25 +0000
commit1e0332c701c7ecc79c8ec2f94b2a2700a47b9133 (patch)
treec3fe11a950c1e2784974d11befb96b08b626f10d /src/libcryptobox/keypairs_cache.c
parentce62c022fc1d51a8a3f042ac08e7b48820d401a8 (diff)
downloadrspamd-1e0332c701c7ecc79c8ec2f94b2a2700a47b9133.tar.gz
rspamd-1e0332c701c7ecc79c8ec2f94b2a2700a47b9133.zip
Add flexible x25519/nist modes for cryptobox
Diffstat (limited to 'src/libcryptobox/keypairs_cache.c')
-rw-r--r--src/libcryptobox/keypairs_cache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcryptobox/keypairs_cache.c b/src/libcryptobox/keypairs_cache.c
index 2e87561da..5df5e8a27 100644
--- a/src/libcryptobox/keypairs_cache.c
+++ b/src/libcryptobox/keypairs_cache.c
@@ -81,23 +81,23 @@ rspamd_keypair_cache_process (struct rspamd_keypair_cache *c,
g_assert (kp_remote != NULL);
memset (&search, 0, sizeof (search));
- memcpy (search.pair, kp_remote->pk, rspamd_cryptobox_pk_bytes ());
+ memcpy (search.pair, kp_remote->pk, rspamd_cryptobox_pk_bytes (RSPAMD_CRYPTOBOX_MODE_25519));
memcpy (&search.pair[rspamd_cryptobox_MAX_PKBYTES], kp_local->sk,
- rspamd_cryptobox_sk_bytes ());
+ rspamd_cryptobox_sk_bytes (RSPAMD_CRYPTOBOX_MODE_25519));
new = rspamd_lru_hash_lookup (c->hash, &search, time (NULL));
if (new == NULL) {
new = g_slice_alloc0 (sizeof (*new));
- memcpy (new->pair, kp_remote->pk, rspamd_cryptobox_pk_bytes ());
+ memcpy (new->pair, kp_remote->pk, rspamd_cryptobox_pk_bytes (RSPAMD_CRYPTOBOX_MODE_25519));
memcpy (&new->pair[rspamd_cryptobox_MAX_PKBYTES], kp_local->sk,
- rspamd_cryptobox_sk_bytes ());
- rspamd_cryptobox_nm (new->nm, kp_remote->pk, kp_local->sk);
+ rspamd_cryptobox_sk_bytes (RSPAMD_CRYPTOBOX_MODE_25519));
+ rspamd_cryptobox_nm (new->nm, kp_remote->pk, kp_local->sk, RSPAMD_CRYPTOBOX_MODE_25519);
rspamd_lru_hash_insert (c->hash, new, new, time (NULL), -1);
}
g_assert (new != NULL);
- memcpy (kp_remote->nm, new->nm, rspamd_cryptobox_nm_bytes ());
+ memcpy (kp_remote->nm, new->nm, rspamd_cryptobox_nm_bytes (RSPAMD_CRYPTOBOX_MODE_25519));
kp_remote->has_nm = TRUE;
#if 0
memcpy (kp_local->nm, new->nm, rspamd_cryptobox_NMBYTES);