X-Git-Url: http://www.average.org/gitweb/?p=pam_pcsc_cr.git;a=blobdiff_plain;f=authobj.c;h=f06de57f4542191ad040178570fa2903be90cfd2;hp=cb6f4f35321ce0abb3b12486b529df69449f4b8d;hb=af4a47cbe298e76f76cfa6dbff8190d0158bd080;hpb=2961e53fa16c04cbb2e90015d68a0b9454c2edd6;ds=sidebyside diff --git a/authobj.c b/authobj.c index cb6f4f3..f06de57 100644 --- a/authobj.c +++ b/authobj.c @@ -58,10 +58,15 @@ int make_authobj(const char *id, const char *pass, const char *nonce, if (hmac(secret, secsize, challenge, challengesize, key, &keysize)) return -1; +#if 0 + int i; + for (i = 0; i < keysize; i++) printf(", 0x%02x", key[i]); + printf("\n"); +#endif if (*bufsize < datasize) return -1; *bufsize = datasize; - if (encrypt(key, keysize, data, buffer, datasize)) return -1; + if (encrypt(key, CBLKSIZE, data, buffer, datasize)) return -1; return 0; } @@ -80,7 +85,7 @@ int parse_authobj(const unsigned char *key, const int keysize, unsigned char theirhash[HASHSIZE]; int theirhashsize = HASHSIZE; - if (decrypt(key, keysize, buffer, data, datasize)) + if (decrypt(key, CBLKSIZE, buffer, data, datasize)) return -1; if (serial_init(&srl, data, datasize)) return -1; tsize = *secsize;