summaryrefslogtreecommitdiff
path: root/key.c
diff options
context:
space:
mode:
Diffstat (limited to 'key.c')
-rw-r--r--key.c7
1 files changed, 6 insertions, 1 deletions
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: