aboutsummaryrefslogtreecommitdiffstats
path: root/cipher
diff options
context:
space:
mode:
Diffstat (limited to 'cipher')
-rw-r--r--cipher/ChangeLog5
-rw-r--r--cipher/rsa.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 25cc2657c..47f09ca00 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,3 +1,8 @@
+2004-09-23 Werner Koch <[email protected]>
+
+ * rsa.c (rsa_generate): Return the dummy list of factors only if
+ the caller asked for it.
+
2004-05-20 David Shaw <[email protected]>
* dsa.c (verify): s/exp/exponent/ to fix a compiler warning. From
diff --git a/cipher/rsa.c b/cipher/rsa.c
index 7eb757a97..e41ff2481 100644
--- a/cipher/rsa.c
+++ b/cipher/rsa.c
@@ -353,7 +353,8 @@ rsa_generate( int algo, unsigned nbits, MPI *skey, MPI **retfactors )
skey[4] = sk.q;
skey[5] = sk.u;
/* make an empty list of factors */
- *retfactors = m_alloc_clear( 1 * sizeof **retfactors );
+ if (retfactors)
+ *retfactors = m_alloc_clear( 1 * sizeof **retfactors );
return 0;
}