From 0415cd0901af9320bef7ad9d005827e2db5b90a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Tue, 9 Jan 2007 10:04:20 +0000 Subject: [PATCH] Correct the test if the rsa is a complete RSA private key. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19774 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/des/rsa.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/des/rsa.c b/lib/des/rsa.c index 65f973952..46352ef9c 100644 --- a/lib/des/rsa.c +++ b/lib/des/rsa.c @@ -170,7 +170,8 @@ RSA_check_key(const RSA *key) * and then decrypt/verify. */ - if (rsa->q == NULL || rsa->dmp1 == NULL || rsa->dmq1 == NULL) + if ((rsa->d == NULL || rsa->n == NULL) && + (rsa->p == NULL || rsa->q || rsa->dmp1 == NULL || rsa->dmq1 == NULL || rsa->iqmp == NULL)) return 0; buffer = malloc(RSA_size(rsa));