Diff

Differences From Artifact [1675cfdb33]:

To Artifact [b4f00ff994]:


   867    867   
   868    868   /** Extra certificates to include in token **/
   869    869   struct cackey_pcsc_identity extra_certs[] = {
   870    870   #include "cackey_builtin_certs.h"
   871    871   };
   872    872   
   873    873   /* Protected Authentication Path command */
   874         -#ifdef CACKEY_PIN_COMMAND_DEFAULT
   875         -#  define CACKEY_PIN_COMMAND_DEFAULT_XSTR(str) CACKEY_PIN_COMMAND_DEFAULT_STR(str)
   876         -#  define CACKEY_PIN_COMMAND_DEFAULT_STR(str) #str
   877         -static char *cackey_pin_command = CACKEY_PIN_COMMAND_DEFAULT_XSTR(CACKEY_PIN_COMMAND_DEFAULT);
   878         -#else
          874  +#define CACKEY_PIN_COMMAND_DEFAULT_XSTR(str) CACKEY_PIN_COMMAND_DEFAULT_STR(str)
          875  +#define CACKEY_PIN_COMMAND_DEFAULT_STR(str) #str
   879    876   static char *cackey_pin_command = NULL;
   880         -#endif
          877  +static char *cackey_pin_command_xonly = NULL;
   881    878   
   882    879   /* PCSC Global Handles */
   883    880   static LPSCARDCONTEXT cackey_pcsc_handle = NULL;
   884    881   
   885    882   static unsigned long cackey_getversion(void) {
   886    883   	static unsigned long retval = 255;
   887    884   	unsigned long major = 0;
................................................................................
  4131   4128   			return(CKR_CANT_LOCK);
  4132   4129   		}
  4133   4130   
  4134   4131   		cackey_biglock_init = 1;
  4135   4132   	}
  4136   4133   
  4137   4134   	/* Define a command to prompt user for a PIN */
         4135  +#ifdef CACKEY_PIN_COMMAND_DEFAULT
         4136  +	cackey_pin_command = CACKEY_PIN_COMMAND_DEFAULT_XSTR(CACKEY_PIN_COMMAND_DEFAULT);
         4137  +#endif
         4138  +#ifdef CACKEY_PIN_COMMAND_XONLY_DEFAULT
         4139  +	cackey_pin_command_xonly = CACKEY_PIN_COMMAND_DEFAULT_XSTR(CACKEY_PIN_COMMAND_XONLY_DEFAULT);
         4140  +#endif
         4141  +
         4142  +	if (getenv("DISPLAY") != NULL) {
         4143  +		cackey_pin_command = cackey_pin_command_xonly;
         4144  +	}
         4145  +
         4146  +	if (getenv("CACKEY_PIN_COMMAND_XONLY") != NULL && getenv("DISPLAY") != NULL) {
         4147  +		cackey_pin_command = getenv("CACKEY_PIN_COMMAND_XONLY");
         4148  +	}
         4149  +
  4138   4150   	if (getenv("CACKEY_PIN_COMMAND") != NULL) {
  4139   4151   		cackey_pin_command = getenv("CACKEY_PIN_COMMAND");
  4140   4152   	}
  4141   4153   
  4142   4154   	CACKEY_DEBUG_PRINTF("Returning CKR_OK (%i)", CKR_OK);
  4143   4155   
  4144   4156   	return(CKR_OK);