Diff

Differences From Artifact [eb56c9fd75]:

To Artifact [b9c502e6af]:


  4076   4076   	return(NULL);
  4077   4077   }
  4078   4078   
  4079   4079   CK_DEFINE_FUNCTION(CK_RV, C_Initialize)(CK_VOID_PTR pInitArgs) {
  4080   4080   	CK_C_INITIALIZE_ARGS CK_PTR args;
  4081   4081   	uint32_t idx, highest_slot;
  4082   4082   	int mutex_init_ret;
         4083  +	int include_dod_certs;
  4083   4084   
  4084   4085   	CACKEY_DEBUG_PRINTF("Called.");
  4085   4086   
  4086   4087   	if (cackey_initialized) {
  4087   4088   		CACKEY_DEBUG_PRINTF("Error.  Already initialized.");
  4088   4089   
  4089   4090   		return(CKR_CRYPTOKI_ALREADY_INITIALIZED);
................................................................................
  4119   4120   		cackey_slots[idx].transaction_need_hw_lock = 0;
  4120   4121   		cackey_slots[idx].slot_reset = 0;
  4121   4122   		cackey_slots[idx].token_flags = 0;
  4122   4123   		cackey_slots[idx].label = NULL;
  4123   4124   		cackey_slots[idx].internal = 0;
  4124   4125   	}
  4125   4126   
         4127  +#ifdef CACKEY_NO_EXTRA_CERTS
         4128  +	if (getenv("CACKEY_EXTRA_CERTS") != NULL) {
         4129  +		include_dod_certs = 1;
         4130  +	} else {
         4131  +		include_dod_certs = 0;
         4132  +	}
         4133  +#else
  4126   4134   	if (getenv("CACKEY_NO_EXTRA_CERTS") != NULL) {
         4135  +		include_dod_certs = 0;
         4136  +	} else {
         4137  +		include_dod_certs = 1;
         4138  +	}
         4139  +#endif
         4140  +
         4141  +	if (include_dod_certs == 0) {
  4127   4142   		CACKEY_DEBUG_PRINTF("Asked not to include DoD certificates");
  4128   4143   	} else {
  4129   4144   		highest_slot = (sizeof(cackey_slots) / sizeof(cackey_slots[0])) - 1;
  4130   4145   
  4131   4146   		CACKEY_DEBUG_PRINTF("Including DoD certs in slot %lu", (unsigned long) highest_slot);
  4132   4147   
  4133   4148   		cackey_slots[highest_slot].active = 1;