Differences From Artifact [941bf5cf9b]:
- File
cackey.c
— part of check-in
[b9e3c7741b]
at
2010-05-14 06:08:46
on branch trunk
— Updated to decompress certificates
Updated to correctly process TLV elements -- fixes bug where iterated past them when processing
Updated to correclty process TLV element total length (user: rkeene, size: 137434) [annotate] [blame] [check-ins using]
To Artifact [be5fbbbf72]:
- File cackey.c — part of check-in [2f0a97a3f1] at 2010-05-14 20:50:45 on branch trunk — Added support for reading label from CAC as string (user: rkeene, size: 137841) [annotate] [blame] [check-ins using]
︙ | |||
1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 | 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 | + + | unsigned char vlen_buf[2], vval_buf[8192], *vval; unsigned char *tmpbuf; ssize_t tlen, vlen; ssize_t read_ret; size_t offset_t = 0, offset_v = 0; unsigned char tag; size_t length; #ifdef HAVE_LIBZ uLongf tmpbuflen; int uncompress_ret; #endif CACKEY_DEBUG_PRINTF("Called."); read_ret = cackey_read_buffer(slot, tlen_buf, sizeof(tlen_buf), 1, offset_t); if (read_ret != sizeof(tlen_buf)) { CACKEY_DEBUG_PRINTF("Read failed, returning in failure"); |
︙ | |||
1478 1479 1480 1481 1482 1483 1484 | 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 | - | case GSCIS_TAG_CERTIFICATE: curr_entity = malloc(sizeof(*curr_entity)); tmpbuflen = length * 2; tmpbuf = malloc(tmpbuflen); #ifdef HAVE_LIBZ |
︙ | |||
2016 2017 2018 2019 2020 2021 2022 | 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 | - - - - + + + + + + + + + + + + + + + + + | break; case CKA_LABEL: CACKEY_DEBUG_PRINTF("Requesting attribute CKA_LABEL (0x%08lx) ...", (unsigned long) curr_attr_type); /* Determine name */ if (certificate_len >= 0) { x509_read_ret = x509_to_subject(certificate, certificate_len, &pValue); |
︙ |