Check crypto_scalarmult() return code

This commit is contained in:
Frank Denis
2015-11-17 01:31:52 +01:00
parent 246f1bd7c0
commit 20bdaa22e8

View File

@@ -544,7 +544,8 @@ static int gt_setup_crypto (struct crypto_ctx *ctx, int fd, int listener)
if (sodium_memcmp(auth_r, hash, hash_size))
return -2;
crypto_scalarmult(shared, secret, &data_r[nonce_size]);
if (crypto_scalarmult(shared, secret, &data_r[nonce_size]) != 0)
return -2;
crypto_generichash_state state;
crypto_generichash_init(&state, ctx->skey, sizeof(ctx->skey), sizeof(key));