usr.bin/ssh/auth.c
/* Returns 1 if key is revoked by revoked_keys_file, 0 otherwise */
Returns 1 if key is revoked by revoked_keys_file, 0 otherwise
Returns 1 if key is revoked by revoked_keys_file 0 otherwise
int
auth_key_is_revoked(Key *key)
{
	char *fp = NULL;
	int r;
	if (options.revoked_keys_file == NULL)
		return 0;
	if ((fp = sshkey_fingerprint(key, options.fingerprint_hash,
	    SSH_FP_DEFAULT)) == NULL) {
		r = SSH_ERR_ALLOC_FAIL;
		error("%s: fingerprint key: %s", __func__, ssh_err(r));
		goto out;
	}
	r = sshkey_check_revoked(key, options.revoked_keys_file);
	switch (r) {
	case 0:
		break; 
	case SSH_ERR_KEY_REVOKED:
		error("Authentication key %s %s revoked by file %s",
		    sshkey_type(key), fp, options.revoked_keys_file);
		goto out;
	default:
		error("Error checking authentication key %s %s in "
		    "revoked keys file %s: %s", sshkey_type(key), fp,
		    options.revoked_keys_file, ssh_err(r));
		goto out;
	}
	r = 0;
 out:
	free(fp);
	return r == 0 ? 0 : 1;
}
int auth_key_is_revoked ( Key * key ) { char * fp = NULL ; int r ; if ( options . revoked_keys_file == NULL ) return 0 ; if ( ( fp = sshkey_fingerprint ( key , options . fingerprint_hash , SSH_FP_DEFAULT ) ) == NULL ) { r = SSH_ERR_ALLOC_FAIL ; error ( " " , __func__ , ssh_err ( r ) ) ; goto out ; } r = sshkey_check_revoked ( key , options . revoked_keys_file ) ; switch ( r ) { case 0 : break ; case SSH_ERR_KEY_REVOKED : error ( " " , sshkey_type ( key ) , fp , options . revoked_keys_file ) ; goto out ; default : error ( " " " " , sshkey_type ( key ) , fp , options . revoked_keys_file , ssh_err ( r ) ) ; goto out ; } r = 0 ; out : free ( fp ) ; return r == 0 ? 0 : 1 ; }
Returns 1 if key is revoked by revoked_keys_file, 0 otherwise
Returns 1 if key is revoked by revoked_keys_file 0 otherwise
/* not revoked */ /* Success */