]> www.average.org Git - pam_pcsc_cr.git/blobdiff - authobj.c
add test_auth
[pam_pcsc_cr.git] / authobj.c
index cb6f4f35321ce0abb3b12486b529df69449f4b8d..f06de57f4542191ad040178570fa2903be90cfd2 100644 (file)
--- 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 (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 (*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;
 }
 
        return 0;
 }
@@ -80,7 +85,7 @@ int parse_authobj(const unsigned char *key, const int keysize,
        unsigned char theirhash[HASHSIZE];
        int theirhashsize = HASHSIZE;
 
        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;
                return -1;
        if (serial_init(&srl, data, datasize)) return -1;
        tsize = *secsize;