summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--key.c7
2 files changed, 10 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index f874fc546..beccb5297 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,9 @@
26 - deraadt@cvs.openbsd.org 2001/12/24 07:29:43 26 - deraadt@cvs.openbsd.org 2001/12/24 07:29:43
27 [ssh-add.c] 27 [ssh-add.c]
28 try all listed keys.. how did this get broken? 28 try all listed keys.. how did this get broken?
29 - markus@cvs.openbsd.org 2001/12/25 18:49:56
30 [key.c]
31 be more careful on allocation
29 32
3020020121 3320020121
31 - (djm) Rework ssh-rand-helper: 34 - (djm) Rework ssh-rand-helper:
@@ -7173,4 +7176,4 @@
7173 - Wrote replacements for strlcpy and mkdtemp 7176 - Wrote replacements for strlcpy and mkdtemp
7174 - Released 1.0pre1 7177 - Released 1.0pre1
7175 7178
7176$Id: ChangeLog,v 1.1729 2002/01/22 12:07:01 djm Exp $ 7179$Id: ChangeLog,v 1.1730 2002/01/22 12:07:21 djm Exp $
diff --git a/key.c b/key.c
index 1013578e1..3a0ed046b 100644
--- a/key.c
+++ b/key.c
@@ -32,7 +32,7 @@
32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 */ 33 */
34#include "includes.h" 34#include "includes.h"
35RCSID("$OpenBSD: key.c,v 1.36 2001/12/19 07:18:56 deraadt Exp $"); 35RCSID("$OpenBSD: key.c,v 1.37 2001/12/25 18:49:56 markus Exp $");
36 36
37#include <openssl/evp.h> 37#include <openssl/evp.h>
38 38
@@ -63,6 +63,8 @@ key_new(int type)
63 rsa = RSA_new(); 63 rsa = RSA_new();
64 rsa->n = BN_new(); 64 rsa->n = BN_new();
65 rsa->e = BN_new(); 65 rsa->e = BN_new();
66 if (rsa == NULL || rsa->n == NULL || rsa->e == NULL)
67 fatal("key_new: malloc failure");
66 k->rsa = rsa; 68 k->rsa = rsa;
67 break; 69 break;
68 case KEY_DSA: 70 case KEY_DSA:
@@ -71,6 +73,9 @@ key_new(int type)
71 dsa->q = BN_new(); 73 dsa->q = BN_new();
72 dsa->g = BN_new(); 74 dsa->g = BN_new();
73 dsa->pub_key = BN_new(); 75 dsa->pub_key = BN_new();
76 if (dsa == NULL || dsa->p == NULL || dsa->q == NULL ||
77 dsa->g == NULL || dsa->pub_key == NULL)
78 fatal("key_new: malloc failure");
74 k->dsa = dsa; 79 k->dsa = dsa;
75 break; 80 break;
76 case KEY_UNSPEC: 81 case KEY_UNSPEC: