Check-in [e4e500972a]
Overview
Comment:Minor cleanup
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:e4e500972a914a0ea9e579d999c02cb1340a0aad
User & Date: rkeene on 2019-06-09 18:35:45
Other Links: manifest | tags
Context
2019-06-12
19:38
Handle converting from buffers which cannot be converted to byte arrays check-in: af11332c35 user: rkeene tags: trunk
2019-06-09
18:35
Minor cleanup check-in: e4e500972a user: rkeene tags: trunk
2019-06-08
22:18
Start of Tcl-based SSH agent that uses JavaScript implementation check-in: 7336ecd46a user: rkeene tags: trunk
Changes

Modified cackey.c from [50819dda69] to [60cd8b85ae].

   190    190   
   191    191   /* ATR If not available */
   192    192   #ifndef MAX_ATR_SIZE
   193    193   #define MAX_ATR_SIZE 1024
   194    194   #endif
   195    195   
   196    196   #ifdef CACKEY_DEBUG
          197  +#  define CACKEY_DEBUG_MIN(a, b) ((a) < (b) ? (a) : (b))
   197    198   #  ifdef HAVE_TIME_H
   198    199   #    include <time.h>
   199    200   static time_t cackey_debug_start_time = 0;
   200    201   static unsigned long CACKEY_DEBUG_GETTIME(void) {
   201    202   	if (cackey_debug_start_time == 0) {
   202    203   		cackey_debug_start_time = time(NULL);
   203    204   	}
................................................................................
   224    225   	unsigned long idx; \
   225    226   	int snprintf_ret; \
   226    227   	TMPBUF = (unsigned char *) (x); \
   227    228   	buf_user[0] = 0; \
   228    229   	buf_user[2] = 0; \
   229    230   	buf_user_p = buf_user; \
   230    231   	buf_user_size = sizeof(buf_user); \
   231         -	for (idx = 0; idx < MIN((y), sizeof(buf_user)); idx++) { \
          232  +	for (idx = 0; idx < CACKEY_DEBUG_MIN((y), sizeof(buf_user)); idx++) { \
   232    233   		if (buf_user_size <= 0) { \
   233    234   			break; \
   234    235   		}; \
   235    236   		snprintf_ret = snprintf(buf_user_p, buf_user_size, ", %02x", TMPBUF[idx]); \
   236    237   		if (snprintf_ret <= 0) { \
   237    238   			break; \
   238    239   		}; \
................................................................................
  3359   3360    *
  3360   3361    */
  3361   3362   static cackey_ret cackey_token_present(struct cackey_slot *slot) {
  3362   3363   	cackey_ret pcsc_connect_ret;
  3363   3364   	DWORD reader_len = 0, state = 0, protocol = 0, atr_len;
  3364   3365   	BYTE atr[MAX_ATR_SIZE];
  3365   3366   	LONG status_ret, scard_reconn_ret;
  3366         -	LPSTR *reader_name;
         3367  +	LPSTR reader_name;
  3367   3368   
  3368   3369   	CACKEY_DEBUG_PRINTF("Called.");
  3369   3370   
  3370   3371   	if (slot->internal) {
  3371   3372   		CACKEY_DEBUG_PRINTF("Returning token present (internal token)");
  3372   3373   
  3373   3374   		return(CACKEY_PCSC_S_TOKENPRESENT);