aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2018-02-22 14:17:40 -0500
committerJack Lloyd <[email protected]>2018-02-22 14:17:40 -0500
commit363e5a26e96c539c029352b9ab00bd9d11d905d7 (patch)
treeb00c953c83414f224eecc4ee2084a499db766c9b /src
parent46a914e2d1732f0903436b74cbef7aa01607f075 (diff)
Fix incorrect check in DL key check
get_q returns zero instead of throwing if q is not set
Diffstat (limited to 'src')
-rw-r--r--src/lib/pubkey/dl_algo/dl_algo.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/lib/pubkey/dl_algo/dl_algo.cpp b/src/lib/pubkey/dl_algo/dl_algo.cpp
index 0ac6bfce5..c5fc1e082 100644
--- a/src/lib/pubkey/dl_algo/dl_algo.cpp
+++ b/src/lib/pubkey/dl_algo/dl_algo.cpp
@@ -75,16 +75,13 @@ bool DL_Scheme_PublicKey::check_key(RandomNumberGenerator& rng,
if(!m_group.verify_group(rng, strong))
return false;
- try
+ const BigInt& q = group_q();
+
+ if(q.is_zero() == false)
{
- const BigInt& q = group_q();
if(power_mod(m_y, q, p) != 1)
return false;
}
- catch(const Invalid_State&)
- {
- return true;
- }
return true;
}