#include <gnome-keyring.h>
#include <glib.h>
#include <stdio.h>

/* Compile: gcc `pkg-config --cflags --libs gnome-keyring-1` gkcrack.c -o gkcrack */

/* typedef enum {
	GNOME_KEYRING_RESULT_OK,
	GNOME_KEYRING_RESULT_DENIED,
	GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON,
	GNOME_KEYRING_RESULT_ALREADY_UNLOCKED,
	GNOME_KEYRING_RESULT_NO_SUCH_KEYRING,
	GNOME_KEYRING_RESULT_BAD_ARGUMENTS,
	GNOME_KEYRING_RESULT_IO_ERROR,
	GNOME_KEYRING_RESULT_CANCELLED,
	GNOME_KEYRING_RESULT_KEYRING_ALREADY_EXISTS,
	GNOME_KEYRING_RESULT_NO_MATCH
} GnomeKeyringResult; */

int main(int argc, char **argv)
{
	int i;

	g_set_application_name("gkcrack");

	for(i = 0; i < 1000; i++) {
		GnomeKeyringResult r1 = gnome_keyring_lock_all_sync();
		GnomeKeyringResult r2 = gnome_keyring_unlock_sync("openwall", "openwall1");
		printf("%d\n", (int)r2);	
	}

	return 0;
}