aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/auth/factotum/dsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/auth/factotum/dsa.c')
-rw-r--r--src/cmd/auth/factotum/dsa.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/auth/factotum/dsa.c b/src/cmd/auth/factotum/dsa.c
index c0d199e4..ced10355 100644
--- a/src/cmd/auth/factotum/dsa.c
+++ b/src/cmd/auth/factotum/dsa.c
@@ -86,6 +86,10 @@ readdsapriv(Key *k)
|| (priv->pub.q=strtomp(a, nil, 16, nil))==nil)
goto Error;
strlwr(a);
+ if(!probably_prime(priv->pub.p, 20) && !probably_prime(priv->pub.q, 20)) {
+ werrstr("dsa: p or q not prime");
+ goto Error;
+ }
if((a=strfindattr(k->attr, "alpha"))==nil
|| (priv->pub.alpha=strtomp(a, nil, 16, nil))==nil)
goto Error;