Changeset View
Changeset View
Standalone View
Standalone View
b/g10/gpg.c
Context not available. | |||||
opt.lock_once = 1; | opt.lock_once = 1; | ||||
#endif /* __riscos__ */ | #endif /* __riscos__ */ | ||||
#if 1 | |||||
{ | |||||
KEYDB_HANDLE hd1, hd2; | |||||
KEYDB_SEARCH_DESC desc1, desc2; | |||||
KBNODE kb1, kb2; | |||||
keydb_add_resource ("~/neal/work/gpg/gnupg/g10/t-keydb-keyring.kbx", 0); | |||||
hd1 = keydb_new (); | |||||
hd2 = keydb_new (); | |||||
rc = classify_user_id ("2689 5E25 E844 6D44 A26D 8FAF 2F79 98F3 DBFC 6AD9", &desc1, 0); | |||||
if (rc) | |||||
{ | |||||
log_error ("Failed to convert DBFC6AD9\n"); | |||||
return 1; | |||||
} | |||||
classify_user_id ("8061 5870 F5BA D690 3336 86D0 F2AD 85AC 1E42 B367", &desc2, 0); | |||||
if (rc) | |||||
{ | |||||
log_error ("Failed to convert 1E42B367\n"); | |||||
return 1; | |||||
} | |||||
rc = keydb_search (hd1, &desc1, 1, NULL); | |||||
if (rc) | |||||
{ | |||||
log_error ("Failed to find for desc1\n"); | |||||
return 1; | |||||
} | |||||
rc = keydb_search (hd2, &desc2, 1, NULL); | |||||
if (rc) | |||||
{ | |||||
log_error ("Failed to find for desc2\n"); | |||||
return 1; | |||||
} | |||||
rc = keydb_get_keyblock (hd2, &kb2); | |||||
if (rc) | |||||
{ | |||||
log_error ("Failed to get keyblock for desc2 (%d)\n", rc); | |||||
return 1; | |||||
} | |||||
rc = keydb_get_keyblock (hd1, &kb1); | |||||
if (rc) | |||||
{ | |||||
log_error ("Failed to get keyblock for desc1 (%d)\n", rc); | |||||
return 1; | |||||
} | |||||
log_info ("desc1: %s\n", kb1->next->pkt->pkt.user_id->name); | |||||
log_info ("desc2: %s\n", kb2->next->pkt->pkt.user_id->name); | |||||
if (strcmp (kb1->next->pkt->pkt.user_id->name, | |||||
kb2->next->pkt->pkt.user_id->name) != 0) | |||||
{ | |||||
log_info("Looks good.\n"); | |||||
return 0; | |||||
} | |||||
else | |||||
{ | |||||
log_info("Same name (fail)!\n"); | |||||
return 1; | |||||
} | |||||
} | |||||
#endif | |||||
/* Please note that we may running SUID(ROOT), so be very CAREFUL | /* Please note that we may running SUID(ROOT), so be very CAREFUL | ||||
when adding any stuff between here and the call to | when adding any stuff between here and the call to | ||||
Context not available. |