diff src/mac/pelican/pelican.c @ 209:39d5d58461d6 libtomcrypt-orig LTC_1.05

Import of libtomcrypt 1.05
author Matt Johnston <matt@ucc.asn.au>
date Wed, 06 Jul 2005 03:53:40 +0000
parents 1c15b283127b
children
line wrap: on
line diff
--- a/src/mac/pelican/pelican.c	Fri May 06 13:23:02 2005 +0000
+++ b/src/mac/pelican/pelican.c	Wed Jul 06 03:53:40 2005 +0000
@@ -102,6 +102,12 @@
 
    LTC_ARGCHK(pelmac != NULL);
    LTC_ARGCHK(in     != NULL);
+
+   /* check range */
+   if (pelmac->buflen < 0 || pelmac->buflen > 15) {
+      return CRYPT_INVALID_ARG;
+   }
+
 #ifdef LTC_FAST
    if (pelmac->buflen == 0) {
       while (inlen & ~15) {
@@ -136,6 +142,12 @@
 {
    LTC_ARGCHK(pelmac  != NULL);
    LTC_ARGCHK(out     != NULL);
+
+   /* check range */
+   if (pelmac->buflen < 0 || pelmac->buflen > 16) {
+      return CRYPT_INVALID_ARG;
+   }
+
    if  (pelmac->buflen == 16) {
        four_rounds(pelmac);
        pelmac->buflen = 0;
@@ -147,3 +159,7 @@
 }                        
 
 #endif
+
+/* $Source: /cvs/libtom/libtomcrypt/src/mac/pelican/pelican.c,v $ */
+/* $Revision: 1.16 $ */
+/* $Date: 2005/05/05 14:35:59 $ */