summaryrefslogtreecommitdiffstats
path: root/sys/crypto/cryptosoft.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/crypto/cryptosoft.c')
-rw-r--r--sys/crypto/cryptosoft.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/crypto/cryptosoft.c b/sys/crypto/cryptosoft.c
index f61cc6248c7..dfb2329ccc6 100644
--- a/sys/crypto/cryptosoft.c
+++ b/sys/crypto/cryptosoft.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cryptosoft.c,v 1.41 2004/05/07 14:42:26 millert Exp $ */
+/* $OpenBSD: cryptosoft.c,v 1.42 2004/12/20 20:31:18 hshoexer Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
@@ -619,8 +619,11 @@ swcr_newsession(u_int32_t *sid, struct cryptoini *cri)
txf = &enc_xform_null;
goto enccommon;
enccommon:
- txf->setkey(&((*swd)->sw_kschedule), cri->cri_key,
- cri->cri_klen / 8);
+ if (txf->setkey(&((*swd)->sw_kschedule), cri->cri_key,
+ cri->cri_klen / 8) < 0) {
+ swcr_freesession(i);
+ return EINVAL;
+ }
(*swd)->sw_exf = txf;
break;