summaryrefslogtreecommitdiffstats
path: root/sys/crypto/rc5/rc5_cbc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/crypto/rc5/rc5_cbc.c')
-rw-r--r--sys/crypto/rc5/rc5_cbc.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sys/crypto/rc5/rc5_cbc.c b/sys/crypto/rc5/rc5_cbc.c
index c588eda..5972cc6 100644
--- a/sys/crypto/rc5/rc5_cbc.c
+++ b/sys/crypto/rc5/rc5_cbc.c
@@ -1,3 +1,6 @@
+/* $FreeBSD$ */
+/* $KAME: rc5_cbc.c,v 1.4 2000/06/14 10:41:17 itojun Exp $ */
+
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
* All rights reserved.
@@ -25,16 +28,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- *
- * $FreeBSD$
*/
/*
* based on sys/crypto/des/des_cbc.c, rewrote by Tomomi Suzuki
*/
#include <crypto/rc5/rc5.h>
+#define panic(x) do { printf(x); return EINVAL; } while (0)
-void
+int
rc5_cbc_process(m0, skip, length, e_key, iv, mode)
struct mbuf *m0;
size_t skip;
@@ -50,21 +52,21 @@ rc5_cbc_process(m0, skip, length, e_key, iv, mode)
/* sanity check */
if (m0->m_pkthdr.len < skip) {
printf("rc5_cbc_process: mbuf length < skip\n");
- return;
+ return EINVAL;
}
if (m0->m_pkthdr.len < length) {
printf("rc5_cbc_process: mbuf length < encrypt length\n");
- return;
+ return EINVAL;
}
if (m0->m_pkthdr.len < skip + length) {
printf("rc5_cbc_process: mbuf length < "
"skip + encrypt length\n");
- return;
+ return EINVAL;
}
if (length % 8) {
printf("rc5_cbc_process: length(%lu)is not multipleof 8\n",
(u_long)length);
- return;
+ return EINVAL;
}
m = m0;
@@ -207,5 +209,7 @@ rc5_cbc_process(m0, skip, length, e_key, iv, mode)
length -= 8;
}
+
+ return 0;
}
OpenPOWER on IntegriCloud