]> www.average.org Git - pam_pcsc_cr.git/blobdiff - crypto.c
clear test results
[pam_pcsc_cr.git] / crypto.c
index 282a713d494517afef007f57212df40691b264ca..003cc0f82da5a8f9dd51ef9abc74eab7b74caf5d 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -1,3 +1,6 @@
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 #include <assert.h>
 #include "crypto.h"
 #include "crypto_if.h"
@@ -25,6 +28,12 @@ int select_crypto_if(int ifno)
        return 0;
 }
 
+const char *crypto_init(int ifno)
+{
+       if (ifno < 0 || ifno > MAX_IF) return (const char *)0;
+       return ifs[ifno]->init();
+}
+
 static unsigned char iv[16] = {0};
 
 unsigned long encrypt(void *key, int keylen, void *pt, void *ct, int tlen)
@@ -47,7 +56,6 @@ unsigned long hash(void *pt, int tlen, void *tag, int *taglen)
 
 unsigned long hmac(void *key, int keylen, void *pt, int tlen, void *tag, int *taglen)
 {
-       assert(keylen == 20);
        assert(*taglen == 20);
        return ifs[which]->hmac(key, keylen, pt, tlen, tag, taglen);
 }