X-Git-Url: http://www.average.org/gitweb/?p=pam_pcsc_cr.git;a=blobdiff_plain;f=crypto.c;h=c2d6c1471f349dfee3ba981e0997c5a809f296c0;hp=003cc0f82da5a8f9dd51ef9abc74eab7b74caf5d;hb=55045da5118553f462a83ff65540ae026c44bdb0;hpb=724570ad4aaaa5eb67fe0e808d638321d522eba7 diff --git a/crypto.c b/crypto.c index 003cc0f..c2d6c14 100644 --- a/crypto.c +++ b/crypto.c @@ -34,16 +34,20 @@ const char *crypto_init(int ifno) return ifs[ifno]->init(); } -static unsigned char iv[16] = {0}; +#define INITIV {0} unsigned long encrypt(void *key, int keylen, void *pt, void *ct, int tlen) { + unsigned char iv[16] = INITIV; + assert(keylen == 16); return ifs[which]->encrypt(key, keylen, iv, pt, ct, tlen); } unsigned long decrypt(void *key, int keylen, void *ct, void *pt, int tlen) { + unsigned char iv[16] = INITIV; + assert(keylen == 16); return ifs[which]->decrypt(key, keylen, iv, ct, pt, tlen); }