diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-05-12 10:44:07 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-05-12 10:44:07 +0300 |
commit | 84b29174e6a8da103e8afbffa48dc10958cc2e62 (patch) | |
tree | aadb277444328c5c24bf9a251a266d026005d942 /rpmio/thkp.c | |
parent | 2f890bda8b8685167433bf04c515d488555b1436 (diff) | |
download | rpm-84b29174e6a8da103e8afbffa48dc10958cc2e62.tar.gz rpm-84b29174e6a8da103e8afbffa48dc10958cc2e62.tar.bz2 rpm-84b29174e6a8da103e8afbffa48dc10958cc2e62.zip |
Rip old, bit-rotten librpmio test programs
Diffstat (limited to 'rpmio/thkp.c')
-rw-r--r-- | rpmio/thkp.c | 127 |
1 files changed, 0 insertions, 127 deletions
diff --git a/rpmio/thkp.c b/rpmio/thkp.c deleted file mode 100644 index 62a365d17..000000000 --- a/rpmio/thkp.c +++ /dev/null @@ -1,127 +0,0 @@ -#include "system.h" - -#include <popt.h> -#include <rpm/rpmmacro.h> -#include <rpm/rpmlog.h> -#include "rpmio/rpmio_internal.h" - -#include "debug.h" - -static int _debug = 0; -static int _printing = 0; - -#if 0 -#define HKPPATH "hkp://pgp.mit.edu:11371/pks/lookup?op=get&search=0xF5C75256" -#else -#if 0 -#define HKPPATH "hkp://pgp.mit.edu" -#else -#define HKPPATH "hkp://sks.keyserver.penguin.de" -#endif -#endif -static char * hkppath = HKPPATH; - -static unsigned int keyids[] = { -#if 0 - 0xc2b079fc, 0xf5c75256, - 0x94cd5742, 0xe418e3aa, - 0xb44269d0, 0x4f2a6fd2, - 0xda84cbd4, 0x30c9ecf8, - 0x29d5ba24, 0x8df56d05, - 0xa520e8f1, 0xcba29bf9, - 0x219180cd, 0xdb42a60e, - 0xfd372689, 0x897da07a, - 0xe1385d4e, 0x1cddbca9, - 0xb873641b, 0x2039b291, -#endif - 0x58e727c4, 0xc621be0f, - 0 -}; - -static int readKeys(const char * uri) -{ - unsigned int * kip; - const uint8_t * pkt; - size_t pktlen; - uint8_t keyid[8]; - char *fn = NULL; - pgpDig dig; - int rc; - int ec = 0; - - rpmInitCrypto(); - dig = pgpNewDig(); - for (kip = keyids; *kip; kip += 2) { - pgpArmor pa; - - rasprintf(&fn, "%s/pks/lookup?op=get&search=0x%08x%08x", uri, kip[0], kip[1]); -fprintf(stderr, "======================= %s\n", fn); - pkt = NULL; - pktlen = 0; - pa = pgpReadPkts(fn, &pkt, &pktlen); - free(fn); - if (pa == PGPARMOR_ERROR || pa == PGPARMOR_NONE - || pkt == NULL || pktlen <= 0) - { - ec++; - continue; - } - - rc = pgpPrtPkts(pkt, pktlen, dig, _printing); - if (rc) - ec++; -#if 0 -fprintf(stderr, "%s\n", pgpHexStr(pkt, pktlen)); -#endif - if (!pgpPubkeyFingerprint(pkt, pktlen, keyid)) -fprintf(stderr, "KEYID: %08x %08x\n", pgpGrab(keyid, 4), pgpGrab(keyid+4, 4)); - - - pgpCleanDig(dig); - - free((void *)pkt); - pkt = NULL; - } - dig = pgpFreeDig(dig); - - return ec; -} - -static struct poptOption optionsTable[] = { - { "print", 'p', POPT_ARG_VAL, &_printing, 1, NULL, NULL }, - { "noprint", 'n', POPT_ARG_VAL, &_printing, 0, NULL, NULL }, - { "debug", 'd', POPT_ARG_VAL, &_debug, -1, NULL, NULL }, - { "rpmiodebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_rpmio_debug, -1, - N_("debug rpmio I/O"), NULL}, - { "urldebug", '\0', POPT_ARG_VAL|POPT_ARGFLAG_DOC_HIDDEN, &_url_debug, -1, - N_("debug URL cache handling"), NULL}, - { "verbose", 'v', 0, 0, 'v', NULL, NULL }, - POPT_AUTOHELP - POPT_TABLEEND -}; - -int -main(int argc, char *argv[]) -{ - poptContext optCon = poptGetContext(argv[0], argc, (const char **) argv, optionsTable, 0); - int rc; - - while ((rc = poptGetNextOpt(optCon)) > 0) { - switch (rc) { - case 'v': - rpmIncreaseVerbosity(); - break; - default: - break; - } - } - - if (_debug) { - rpmIncreaseVerbosity(); - rpmIncreaseVerbosity(); - } - - readKeys(hkppath); - - return 0; -} |