Check-in [0e841c8724]
Overview
Comment:Fixed order of processing PIN command options
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | piv
Files: files | file ages | folders
SHA1:0e841c8724a6c4e2c00b03f45eea2fae412dca8d
User & Date: rkeene on 2013-08-19 03:25:14
Other Links: manifest | tags
Context
2013-08-19
03:33
Updated to exclude USG certificates slot if compiled without it check-in: eba8a2346a user: rkeene tags: piv
03:25
Fixed order of processing PIN command options check-in: 0e841c8724 user: rkeene tags: piv
03:19
Fixed memory leak when checking PIV certificates check-in: 182c88b988 user: rkeene tags: piv
Changes

Modified cackey.c from [2e881e3150] to [eb56c9fd75].

   876    876   #include "cackey_builtin_certs.h"
   877    877   };
   878    878   
   879    879   /* Protected Authentication Path command */
   880    880   #define CACKEY_PIN_COMMAND_DEFAULT_XSTR(str) CACKEY_PIN_COMMAND_DEFAULT_STR(str)
   881    881   #define CACKEY_PIN_COMMAND_DEFAULT_STR(str) #str
   882    882   static char *cackey_pin_command = NULL;
   883         -static char *cackey_pin_command_xonly = NULL;
   884    883   
   885    884   /* PCSC Global Handles */
   886    885   static LPSCARDCONTEXT cackey_pcsc_handle = NULL;
   887    886   
   888    887   static unsigned long cackey_getversion(void) {
   889    888   	static unsigned long retval = 255;
   890    889   	unsigned long major = 0;
................................................................................
  4152   4151   		cackey_biglock_init = 1;
  4153   4152   	}
  4154   4153   
  4155   4154   	/* Define a command to prompt user for a PIN */
  4156   4155   #ifdef CACKEY_PIN_COMMAND_DEFAULT
  4157   4156   	cackey_pin_command = CACKEY_PIN_COMMAND_DEFAULT_XSTR(CACKEY_PIN_COMMAND_DEFAULT);
  4158   4157   #endif
         4158  +
  4159   4159   #ifdef CACKEY_PIN_COMMAND_XONLY_DEFAULT
  4160         -	cackey_pin_command_xonly = CACKEY_PIN_COMMAND_DEFAULT_XSTR(CACKEY_PIN_COMMAND_XONLY_DEFAULT);
         4160  +	if (getenv("DISPLAY") != NULL) {
         4161  +		cackey_pin_command = CACKEY_PIN_COMMAND_DEFAULT_XSTR(CACKEY_PIN_COMMAND_XONLY_DEFAULT);
         4162  +	}
  4161   4163   #endif
  4162   4164   
  4163         -	if (getenv("DISPLAY") != NULL) {
  4164         -		cackey_pin_command = cackey_pin_command_xonly;
         4165  +	if (getenv("CACKEY_PIN_COMMAND") != NULL) {
         4166  +		cackey_pin_command = getenv("CACKEY_PIN_COMMAND");
  4165   4167   	}
  4166   4168   
  4167   4169   	if (getenv("CACKEY_PIN_COMMAND_XONLY") != NULL && getenv("DISPLAY") != NULL) {
  4168   4170   		cackey_pin_command = getenv("CACKEY_PIN_COMMAND_XONLY");
  4169   4171   	}
  4170   4172   
  4171         -	if (getenv("CACKEY_PIN_COMMAND") != NULL) {
  4172         -		cackey_pin_command = getenv("CACKEY_PIN_COMMAND");
  4173         -	}
  4174         -
  4175   4173   	CACKEY_DEBUG_PRINTF("Returning CKR_OK (%i)", CKR_OK);
  4176   4174   
  4177   4175   	return(CKR_OK);
  4178   4176   }
  4179   4177   
  4180   4178   CK_DEFINE_FUNCTION(CK_RV, C_Finalize)(CK_VOID_PTR pReserved) {
  4181   4179   	uint32_t idx;