View | Details | Raw Unified | Return to bug 684 | Differences between
and this patch

Collapse All | Expand All

(-)sshconnect2.c.orig (-1 / +18 lines)
Lines 990-996 Link Here
990
	Key *key;
990
	Key *key;
991
	AuthenticationConnection *ac;
991
	AuthenticationConnection *ac;
992
	char *comment;
992
	char *comment;
993
	int i, found;
993
	int i, j, found;
994
994
995
	TAILQ_INIT(&agent);	/* keys from the agent */
995
	TAILQ_INIT(&agent);	/* keys from the agent */
996
	TAILQ_INIT(&files);	/* keys from the config file */
996
	TAILQ_INIT(&files);	/* keys from the config file */
Lines 1003-1008 Link Here
1003
		if (key && key->type == KEY_RSA1)
1003
		if (key && key->type == KEY_RSA1)
1004
			continue;
1004
			continue;
1005
		options.identity_keys[i] = NULL;
1005
		options.identity_keys[i] = NULL;
1006
1007
		/* Duplicate keys here can cause problems in 
1008
		 * input_userauth_pk_ok() if the key is also 
1009
		 * in the agent.  
1010
		 */
1011
		for (j = 0; j < options.num_identity_files; j++) {
1012
			if(key && key_equal(key, options.identity_keys[j])) {
1013
				debug2("key %s (%p) duplicate of %s (%p). Cleared.",
1014
					options.identity_files[j],
1015
					options.identity_keys[j],
1016
					options.identity_files[i], key);
1017
1018
				key_free(options.identity_keys[j]);
1019
				options.identity_keys[j] = NULL;
1020
			}
1021
		}
1022
1006
		id = xmalloc(sizeof(*id));
1023
		id = xmalloc(sizeof(*id));
1007
		memset(id, 0, sizeof(*id));
1024
		memset(id, 0, sizeof(*id));
1008
		id->key = key;
1025
		id->key = key;

Return to bug 684