[Pcsclite-cvs-commit] r420 - trunk/PKCS11/src

Ludovic Rousseau rousseau at costa.debian.org
Tue Mar 28 15:20:36 CEST 2006


Author: rousseau
Date: 2006-03-28 13:20:30 +0000 (Tue, 28 Mar 2006)
New Revision: 420

Modified:
   trunk/PKCS11/src/p11_crypt.c
   trunk/PKCS11/src/p11x_log.c
   trunk/PKCS11/src/p11x_object.c
   trunk/PKCS11/src/p11x_prefs.c
Log:
do not use assert()

Thanks to Iain MacDonnell for the patch


Modified: trunk/PKCS11/src/p11_crypt.c
===================================================================
--- trunk/PKCS11/src/p11_crypt.c	2006-03-28 13:16:31 UTC (rev 419)
+++ trunk/PKCS11/src/p11_crypt.c	2006-03-28 13:20:30 UTC (rev 420)
@@ -9,7 +9,6 @@
 **  Purpose: Encryption and decryption
 ** 
 ******************************************************************************/
-#include <assert.h>
 #include "cryptoki.h"
 
 /* Removed by Netscape
@@ -31,8 +30,6 @@
     int i = 0;
     int padLen = toLen - 3 - fromLen;
 
-    assert( toLen > fromLen );
-    assert( padLen >= 0 );
     if( toLen < fromLen || padLen < 0 ) {
         return 0;
     }
@@ -54,8 +51,6 @@
     memcpy(to+i, from, fromLen);
     i += fromLen;
 
-    assert( (CK_ULONG) i == toLen );
-
     return 1;
 }
 

Modified: trunk/PKCS11/src/p11x_log.c
===================================================================
--- trunk/PKCS11/src/p11x_log.c	2006-03-28 13:16:31 UTC (rev 419)
+++ trunk/PKCS11/src/p11x_log.c	2006-03-28 13:20:30 UTC (rev 420)
@@ -11,7 +11,6 @@
 ******************************************************************************/
 
 #include <stdio.h>
-#include <assert.h>
 #include <time.h>
 #include <stdarg.h>
 #include "cryptoki.h"

Modified: trunk/PKCS11/src/p11x_object.c
===================================================================
--- trunk/PKCS11/src/p11x_object.c	2006-03-28 13:16:31 UTC (rev 419)
+++ trunk/PKCS11/src/p11x_object.c	2006-03-28 13:20:30 UTC (rev 420)
@@ -12,7 +12,6 @@
 
 #include "cryptoki.h"
 #include "crackcert.h"
-#include <assert.h>
 
 /* #include <openssl/x509.h> */
 
@@ -1768,7 +1767,6 @@
             item = &issuer;
             break;
           default:
-            assert(0);
             return CKR_FUNCTION_FAILED;
         }
         memcpy(out, item->data, item->len);

Modified: trunk/PKCS11/src/p11x_prefs.c
===================================================================
--- trunk/PKCS11/src/p11x_prefs.c	2006-03-28 13:16:31 UTC (rev 419)
+++ trunk/PKCS11/src/p11x_prefs.c	2006-03-28 13:20:30 UTC (rev 420)
@@ -11,7 +11,6 @@
 ******************************************************************************/
 
 #include <stdio.h>
-#include <assert.h>
 #include "cryptoki.h"
 
 #ifndef HAVE_STRTOKR
@@ -323,7 +322,6 @@
         size = GetModuleFileName(NULL, buf, avail);
         if( size == 0 ) {
             /* function failed */
-            assert(0);
             goto loser;
         } else if(size == avail) {
             /* Our buffer was filled up, so it may have been too small.
@@ -333,8 +331,6 @@
             buf = NULL;
         } else {
             /* success */
-            assert( size < avail );
-            assert( size > 0 );
             break;
         }
     } while(1);
@@ -342,10 +338,8 @@
     /* find last backslash */
     for( i = size-1; i>=0 && buf[i] != '\\'; --i );
     if( i < 0 ) {
-        assert(0);
         goto loser;
     }
-    assert( i < size-1 ); /* last character shouldn't be backslash */
 
     /* get rid of everything after the last backslash */
     buf[i+1] = '\0';




More information about the Pcsclite-cvs-commit mailing list