2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
|
curr_id->certificate = NULL;
outidx--;
continue;
}
#ifdef HAVE_LIBZ
if (curr_id->certificate_len > 4) {
if (memcmp(curr_id->certificate, "\x1f\x8b\x08\x00", 4) == 0) {
tmpbuflen = curr_id->certificate_len * 2;
tmpbuf = malloc(tmpbuflen);
CACKEY_DEBUG_PRINTBUF("Attempting to decompress:", curr_id->certificate, curr_id->certificate_len);
gzip_stream.zalloc = NULL;
gzip_stream.zfree = NULL;
|
<
>
|
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
|
curr_id->certificate = NULL;
outidx--;
continue;
}
if (curr_id->certificate_len > 4) {
if (memcmp(curr_id->certificate, "\x1f\x8b\x08\x00", 4) == 0) {
#ifdef HAVE_LIBZ
tmpbuflen = curr_id->certificate_len * 2;
tmpbuf = malloc(tmpbuflen);
CACKEY_DEBUG_PRINTBUF("Attempting to decompress:", curr_id->certificate, curr_id->certificate_len);
gzip_stream.zalloc = NULL;
gzip_stream.zfree = NULL;
|
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
|
curr_id->certificate = tmpbuf;
curr_id->certificate_len = tmpbuflen;
} else {
CACKEY_DEBUG_PRINTF("Decompressing failed! uncompress() returned %i", uncompress_ret);
free(tmpbuf);
}
}
}
#endif
}
} else {
/* Read all the applets from the CCC's TLV */
ccc_tlv = cackey_read_tlv(slot);
/* Look for CARDURLs that coorespond to PKI applets */
for (ccc_curr = ccc_tlv; ccc_curr; ccc_curr = ccc_curr->_next) {
|
>
>
>
<
|
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
|
curr_id->certificate = tmpbuf;
curr_id->certificate_len = tmpbuflen;
} else {
CACKEY_DEBUG_PRINTF("Decompressing failed! uncompress() returned %i", uncompress_ret);
free(tmpbuf);
}
#else
CACKEY_DEBUG_PRINTF("Error. We got a compressed certificate but we do not have zlib. Hoping for the best.");
#endif
}
}
}
} else {
/* Read all the applets from the CCC's TLV */
ccc_tlv = cackey_read_tlv(slot);
/* Look for CARDURLs that coorespond to PKI applets */
for (ccc_curr = ccc_tlv; ccc_curr; ccc_curr = ccc_curr->_next) {
|