2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
|
}
if (dest == NULL) {
dest = malloc(sizeof(*dest) * count);
}
for (idx = 0; idx < count; idx++) {
switch (dest[idx].id_type) {
case CACKEY_ID_TYPE_CAC:
memcpy(dest[idx].card.cac.applet, start[idx].card.cac.applet, sizeof(dest[idx].card.cac.applet));
dest[idx].card.cac.file = start[idx].card.cac.file;
break;
case CACKEY_ID_TYPE_PIV:
dest[idx].card.piv.key_id = start[idx].card.piv.key_id;
|
>
>
|
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
|
}
if (dest == NULL) {
dest = malloc(sizeof(*dest) * count);
}
for (idx = 0; idx < count; idx++) {
dest[idx].id_type = start[idx].id_type;
switch (dest[idx].id_type) {
case CACKEY_ID_TYPE_CAC:
memcpy(dest[idx].card.cac.applet, start[idx].card.cac.applet, sizeof(dest[idx].card.cac.applet));
dest[idx].card.cac.file = start[idx].card.cac.file;
break;
case CACKEY_ID_TYPE_PIV:
dest[idx].card.piv.key_id = start[idx].card.piv.key_id;
|
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
|
}
switch (id_type) {
case CACKEY_ID_TYPE_PIV:
case CACKEY_ID_TYPE_CAC:
break;
default:
CACKEY_DEBUG_PRINTF("Error. identity->pcsc_identity is not a supported value.");
return(-1);
}
/* Determine identity Key size */
if (identity->pcsc_identity->keysize < 0) {
identity->pcsc_identity->keysize = x509_to_keysize(identity->pcsc_identity->certificate, identity->pcsc_identity->certificate_len);
|
|
|
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
|
}
switch (id_type) {
case CACKEY_ID_TYPE_PIV:
case CACKEY_ID_TYPE_CAC:
break;
default:
CACKEY_DEBUG_PRINTF("Error. identity->pcsc_identity is not a supported value. Type is: 0x%lx (PIV = 0x%lx, CAC = 0x%lx)", (unsigned long) id_type, (unsigned long) CACKEY_ID_TYPE_PIV, (unsigned long) CACKEY_ID_TYPE_CAC);
return(-1);
}
/* Determine identity Key size */
if (identity->pcsc_identity->keysize < 0) {
identity->pcsc_identity->keysize = x509_to_keysize(identity->pcsc_identity->certificate, identity->pcsc_identity->certificate_len);
|