diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-06 13:30:20 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-02-06 13:30:20 +0000 |
commit | ab780d6f7531cb8277609aedffbb4376d821f6ff (patch) | |
tree | 8d572281218b04f02d82a65b9564baee43c30b29 /src/libcryptobox | |
parent | 1a3627cee2990c65e8d7377399bf8558348cfbb3 (diff) | |
download | rspamd-ab780d6f7531cb8277609aedffbb4376d821f6ff.tar.gz rspamd-ab780d6f7531cb8277609aedffbb4376d821f6ff.zip |
Fix loading of pubkeys
Diffstat (limited to 'src/libcryptobox')
-rw-r--r-- | src/libcryptobox/keypair.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libcryptobox/keypair.c b/src/libcryptobox/keypair.c index b1b5b112b..8f0e8e8f6 100644 --- a/src/libcryptobox/keypair.c +++ b/src/libcryptobox/keypair.c @@ -338,13 +338,13 @@ rspamd_pubkey_from_base32 (const gchar *b32, } pk = rspamd_cryptobox_pubkey_alloc (type, alg); + pk->alg = alg; + pk->type = type; pk_data = rspamd_cryptobox_pubkey_pk (pk, &pklen); memcpy (pk_data, decoded, pklen); g_free (decoded); rspamd_cryptobox_hash (pk->id, pk_data, pklen, NULL, 0); - pk->alg = alg; - pk->type = type; return pk; } @@ -384,13 +384,13 @@ rspamd_pubkey_from_hex (const gchar *hex, } pk = rspamd_cryptobox_pubkey_alloc (type, alg); + pk->alg = alg; + pk->type = type; pk_data = rspamd_cryptobox_pubkey_pk (pk, &pklen); memcpy (pk_data, decoded, pklen); g_free (decoded); rspamd_cryptobox_hash (pk->id, pk_data, pklen, NULL, 0); - pk->alg = alg; - pk->type = type; return pk; } @@ -416,12 +416,12 @@ rspamd_pubkey_from_bin (const guchar *raw, } pk = rspamd_cryptobox_pubkey_alloc (type, alg); + pk->alg = alg; + pk->type = type; pk_data = rspamd_cryptobox_pubkey_pk (pk, &pklen); memcpy (pk_data, raw, pklen); rspamd_cryptobox_hash (pk->id, pk_data, pklen, NULL, 0); - pk->alg = alg; - pk->type = type; return pk; } |