diff options
author | Damien Miller <djm@mindrot.org> | 2002-01-22 23:07:21 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2002-01-22 23:07:21 +1100 |
commit | 503761ac45c1546f211c3585f58f352f16400891 (patch) | |
tree | 1e41ec352243d0e057e957d93b4f9a5ed774a854 | |
parent | a055c25d059ddb2dcfd200ee18d4007f1c573984 (diff) |
- markus@cvs.openbsd.org 2001/12/25 18:49:56
[key.c]
be more careful on allocation
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | key.c | 7 |
2 files changed, 10 insertions, 2 deletions
@@ -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 | ||
30 | 20020121 | 33 | 20020121 |
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 $ |
@@ -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" |
35 | RCSID("$OpenBSD: key.c,v 1.36 2001/12/19 07:18:56 deraadt Exp $"); | 35 | RCSID("$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: |