Diff

Differences From Artifact [5df163c7aa]:

To Artifact [967c6f655f]:


  3526   3526   }
  3527   3527   
  3528   3528   static struct cackey_identity *cackey_read_identities(struct cackey_slot *slot, unsigned long *ids_found) {
  3529   3529   	struct cackey_pcsc_identity *pcsc_identities;
  3530   3530   	struct cackey_identity *identities;
  3531   3531   	unsigned long num_ids, id_idx, curr_id_type;
  3532   3532   	unsigned long num_certs, num_dod_certs, cert_idx;
  3533         -	int include_extra_certs = 0;
         3533  +	int include_extra_certs = 0, include_dod_certs;
  3534   3534   
  3535   3535   	CACKEY_DEBUG_PRINTF("Called.");
  3536   3536   
  3537   3537   	if (ids_found == NULL) {
  3538   3538   		CACKEY_DEBUG_PRINTF("Error.  ids_found is NULL");
  3539   3539   
  3540   3540   		return(NULL);
................................................................................
  3548   3548   		include_extra_certs = 1;
  3549   3549   	}
  3550   3550   
  3551   3551   	if (getenv("CACKEY_NO_DOD_CERTS_ON_HW_SLOTS") != NULL) {
  3552   3552   		include_extra_certs = 0;
  3553   3553   	}
  3554   3554   
         3555  +#ifdef CACKEY_NO_EXTRA_CERTS
         3556  +	if (getenv("CACKEY_EXTRA_CERTS") != NULL) {
         3557  +		include_dod_certs = 1;
         3558  +	} else {
         3559  +		include_dod_certs = 0;
         3560  +	}
         3561  +#else
  3555   3562   	if (getenv("CACKEY_NO_EXTRA_CERTS") != NULL) {
  3556         -		num_dod_certs = 0;
         3563  +		include_dod_certs = 0;
  3557   3564   	} else {
         3565  +		include_dod_certs = 1;
         3566  +	}
         3567  +#endif
         3568  +
         3569  +	if (include_dod_certs) {
  3558   3570   		num_dod_certs = sizeof(extra_certs) / sizeof(extra_certs[0]);
         3571  +	} else {
         3572  +		num_dod_certs = 0;
  3559   3573   	}
  3560   3574   
  3561   3575   	if (slot->internal) {
  3562   3576   		num_ids = cackey_read_dod_identities(NULL, num_dod_certs);
  3563   3577   
  3564   3578   		if (num_ids != 0) {
  3565   3579   			identities = malloc(num_ids * sizeof(*identities));