Diff

Differences From Artifact [2007da4548]:

To Artifact [c41337ffcb]:


  3409   3409   			cackey_free_certs(identities[id_idx].pcsc_identity, 1, 1);
  3410   3410   		}
  3411   3411   	}
  3412   3412   
  3413   3413   	free(identities);
  3414   3414   }
  3415   3415   
  3416         -static unsigned long cackey_read_dod_identities(struct cackey_identity *identities, unsigned long id_idx, unsigned long num_dod_certs) {
  3417         -	unsigned long cert_idx;
         3416  +static unsigned long cackey_read_dod_identities(struct cackey_identity *identities, unsigned long num_dod_certs) {
         3417  +	unsigned long cert_idx, id_idx = 0;
  3418   3418   
  3419   3419   	for (cert_idx = 0; cert_idx < num_dod_certs; cert_idx++) {
  3420   3420   		identities[id_idx].pcsc_identity = NULL;
  3421   3421   		identities[id_idx].attributes = cackey_get_attributes(CKO_CERTIFICATE, &extra_certs[cert_idx], 0xf000 | cert_idx, &identities[id_idx].attributes_count);
  3422   3422   		id_idx++;
  3423   3423   
  3424   3424   		identities[id_idx].pcsc_identity = NULL;
................................................................................
  3468   3468   
  3469   3469   	if (slot->internal) {
  3470   3470   		num_ids = num_dod_certs * 3;
  3471   3471   
  3472   3472   		if (num_ids != 0) {
  3473   3473   			identities = malloc(num_ids * sizeof(*identities));
  3474   3474   
  3475         -			cackey_read_dod_identities(identities, 0, num_dod_certs);
         3475  +			cackey_read_dod_identities(identities, num_dod_certs);
  3476   3476   		} else {
  3477   3477   			identities = NULL;
  3478   3478   		}
  3479   3479   
  3480   3480   		*ids_found = num_ids;
  3481   3481   
  3482   3482   		return(identities);
................................................................................
  3508   3508   				id_idx++;
  3509   3509   			}
  3510   3510   		}
  3511   3511   
  3512   3512   		if (include_extra_certs) {
  3513   3513   			CACKEY_DEBUG_PRINTF("Including DoD Certificates on hardware slot");
  3514   3514   
  3515         -			cackey_read_dod_identities(identities, id_idx, num_dod_certs);
         3515  +			cackey_read_dod_identities(identities + id_idx, num_dod_certs);
  3516   3516   		}
  3517   3517   
  3518   3518   		cackey_free_certs(pcsc_identities, num_certs, 1);
  3519   3519   
  3520   3520   		*ids_found = num_ids;
  3521   3521   
  3522   3522   		return(identities);