const char * buildURL = "%{_builddir}/%{?buildsubdir}/";
const char * fn = NULL;
const char * apkt = NULL;
- byte * pkt = NULL;
+ uint8_t * pkt = NULL;
ssize_t pktlen = 0;
int absolute = 0;
int rc = 1;
goto exit;
break;
case RPMTAG_PUBKEYS:
- if ((rc = pgpReadPkts(fn, (const byte **)&pkt, (size_t *)&pktlen)) <= 0) {
+ if ((rc = pgpReadPkts(fn, (const uint8_t **)&pkt, (size_t *)&pktlen)) <= 0) {
rpmlog(RPMLOG_ERR, _("%s: public key read failed.\n"), fn);
goto exit;
}
if (type != RPM_BIN_TYPE) {
val = xstrdup(_("(not a blob)"));
} else {
- unsigned char * pkt = (byte *) data;
+ unsigned char * pkt = (uint8_t *) data;
unsigned int pktlen = 0;
unsigned int v = *pkt;
pgpTag tag = 0;
static int rpmPlatform(const char * platform)
{
char *cpu = NULL, *vendor = NULL, *os = NULL, *gnu = NULL;
- byte * b = NULL;
+ uint8_t * b = NULL;
ssize_t blen = 0;
int init_platform = 0;
char * p, * pe;
int rpmWriteSignature(FD_t fd, Header sigh)
{
- static byte buf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+ static uint8_t buf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
int sigSize, pad;
int rc;
* @return 0 on success, 1 on failure
*/
static int makePGPSignature(const char * file, int32_t * sigTagp,
- byte ** pktp, int32_t * pktlenp,
+ uint8_t ** pktp, int32_t * pktlenp,
const char * passPhrase)
{
char * sigfile = alloca(1024);
* @return 0 on success, 1 on failure
*/
static int makeGPGSignature(const char * file, int32_t * sigTagp,
- byte ** pktp, int32_t * pktlenp,
+ uint8_t ** pktp, int32_t * pktlenp,
const char * passPhrase)
{
char * sigfile = alloca(strlen(file)+sizeof(".sig"));
{
Header h = NULL;
FD_t fd = NULL;
- byte * pkt;
+ uint8_t * pkt;
int32_t pktlen;
const char * fn = NULL;
const char * SHA1 = NULL;
const char * passPhrase)
{
struct stat st;
- byte * pkt;
+ uint8_t * pkt;
int32_t pktlen;
int ret = -1; /* assume failure. */
int32_t siglen = rpmtsSiglen(ts);
pgpDig dig = rpmtsDig(ts);
rpmRC res;
- byte * md5sum = NULL;
+ uint8_t * md5sum = NULL;
size_t md5len = 0;
*t = '\0';
#ifdef NOTYET /* XXX not for binary/text signatures as in packages. */
if (!(sigp->sigtype == PGPSIGTYPE_BINARY || sigp->sigtype == PGP_SIGTYPE_TEXT)) {
int nb = dig->nbytes + sigp->hashlen;
- byte trailer[6];
+ uint8_t trailer[6];
nb = htonl(nb);
trailer[0] = 0x4;
trailer[1] = 0xff;
if (sigp->version == 4) {
int nb = sigp->hashlen;
- byte trailer[6];
+ uint8_t trailer[6];
nb = htonl(nb);
trailer[0] = sigp->version;
trailer[1] = 0xff;
for (i = 0; i < rpmcnt; i++) {
dbiIndexSet set;
int stringvalued;
- byte bin[32];
+ uint8_t bin[32];
switch (dbi->dbi_rpmtag) {
case RPMTAG_FILEMD5S:
/* Convert from hex to binary. */
if (dbi->dbi_rpmtag == RPMTAG_FILEMD5S) {
const char * s;
- byte * t;
+ uint8_t * t;
s = rpmvals[i];
t = bin;
for (i = 0; i < rpmcnt; i++) {
dbiIndexSet set;
int stringvalued;
- byte bin[32];
- byte * t;
+ uint8_t bin[32];
+ uint8_t * t;
/*
* Include the tagNum in all indices. rpm-3.0.4 and earlier
} else {
if (lenp) *lenp = (2*digestlen) + 1;
if (datap) {
- const byte * s = (const byte *) digest;
+ const uint8_t * s = (const uint8_t *) digest;
static const char hex[] = "0123456789abcdef";
*datap = t = xmalloc((2*digestlen) + 1);
*/
struct pgpDigParams_s {
const char * userid;
- const byte * hash;
+ const uint8_t * hash;
const char * params[4];
- byte tag;
+ uint8_t tag;
- byte version; /*!< version number. */
- byte time[4]; /*!< time that the key was created. */
- byte pubkey_algo; /*!< public key algorithm. */
+ uint8_t version; /*!< version number. */
+ uint8_t time[4]; /*!< time that the key was created. */
+ uint8_t pubkey_algo; /*!< public key algorithm. */
- byte hash_algo;
- byte sigtype;
- byte hashlen;
- byte signhash16[2];
- byte signid[8];
- byte saved;
+ uint8_t hash_algo;
+ uint8_t sigtype;
+ uint8_t hashlen;
+ uint8_t signhash16[2];
+ uint8_t signid[8];
+ uint8_t saved;
#define PGPDIG_SAVED_TIME (1 << 0)
#define PGPDIG_SAVED_ID (1 << 1)
return op;
}
-int rpmioSlurp(const char * fn, byte ** bp, ssize_t * blenp)
+int rpmioSlurp(const char * fn, uint8_t ** bp, ssize_t * blenp)
{
static ssize_t blenmax = (32 * BUFSIZ);
ssize_t blen = 0;
- byte * b = NULL;
+ uint8_t * b = NULL;
ssize_t size;
FD_t fd;
int rc = 0;
* @return 0 on success
*/
int rpmioSlurp(const char * fn,
- byte ** bp, ssize_t * blenp);
+ uint8_t ** bp, ssize_t * blenp);
#ifdef __cplusplus
}
fprintf(stderr, " %s", s);
}
-static void pgpPrtHex(const char *pre, const byte *p, unsigned int plen)
+static void pgpPrtHex(const char *pre, const uint8_t *p, unsigned int plen)
{
if (!_print) return;
if (pre && *pre)
fprintf(stderr, " %s", pgpHexStr(p, plen));
}
-void pgpPrtVal(const char * pre, pgpValTbl vs, byte val)
+void pgpPrtVal(const char * pre, pgpValTbl vs, uint8_t val)
{
if (!_print) return;
if (pre && *pre)
/**
*/
static
-const char * pgpMpiHex(const byte *p)
+const char * pgpMpiHex(const uint8_t *p)
{
static char prbuf[2048];
char *t = prbuf;
* @return 0 on success
*/
static int pgpMpiSet(const char * pre, int lbits,
- void *dest, const byte * p, const byte * pend)
+ void *dest, const uint8_t * p, const uint8_t * pend)
{
unsigned int mbits = pgpMpiBits(p);
unsigned int nbits;
/**
* @return NULL on error
*/
-static SECItem *pgpMpiItem(PRArenaPool *arena, SECItem *item, const byte *p)
+static SECItem *pgpMpiItem(PRArenaPool *arena, SECItem *item, const uint8_t *p)
{
unsigned int nbytes = pgpMpiLen(p)-2;
return pgpNewPublicKey(dsaKey);
}
-int pgpPrtSubType(const byte *h, unsigned int hlen, pgpSigType sigtype)
+int pgpPrtSubType(const uint8_t *h, unsigned int hlen, pgpSigType sigtype)
{
- const byte *p = h;
+ const uint8_t *p = h;
unsigned plen;
int i;
#define DSA_SUBPRIME_LEN 20
#endif
-static int pgpPrtSigParams(pgpTag tag, byte pubkey_algo, byte sigtype,
- const byte *p, const byte *h, unsigned int hlen)
+static int pgpPrtSigParams(pgpTag tag, uint8_t pubkey_algo, uint8_t sigtype,
+ const uint8_t *p, const uint8_t *h, unsigned int hlen)
{
- const byte * pend = h + hlen;
+ const uint8_t * pend = h + hlen;
int i;
SECItem dsaraw;
unsigned char dsabuf[2*DSA_SUBPRIME_LEN];
return 0;
}
-int pgpPrtSig(pgpTag tag, const byte *h, unsigned int hlen)
+int pgpPrtSig(pgpTag tag, const uint8_t *h, unsigned int hlen)
{
- byte version = h[0];
- byte * p;
+ uint8_t version = h[0];
+ uint8_t * p;
unsigned plen;
int rc;
memcpy(_digp->signhash16, v->signhash16, sizeof(_digp->signhash16));
}
- p = ((byte *)v) + sizeof(*v);
+ p = ((uint8_t *)v) + sizeof(*v);
rc = pgpPrtSigParams(tag, v->pubkey_algo, v->sigtype, p, h, hlen);
} break;
case 4:
};
#endif
-static const byte * pgpPrtPubkeyParams(byte pubkey_algo,
- const byte *p, const byte *h, unsigned int hlen)
+static const uint8_t * pgpPrtPubkeyParams(uint8_t pubkey_algo,
+ const uint8_t *p, const uint8_t *h, unsigned int hlen)
{
int i;
return p;
}
-static const byte * pgpPrtSeckeyParams(byte pubkey_algo,
- const byte *p, const byte *h, unsigned int hlen)
+static const uint8_t * pgpPrtSeckeyParams(uint8_t pubkey_algo,
+ const uint8_t *p, const uint8_t *h, unsigned int hlen)
{
int i;
return p;
}
-int pgpPrtKey(pgpTag tag, const byte *h, unsigned int hlen)
+int pgpPrtKey(pgpTag tag, const uint8_t *h, unsigned int hlen)
{
- byte version = *h;
- const byte * p;
+ uint8_t version = *h;
+ const uint8_t * p;
unsigned plen;
time_t t;
int rc;
_digp->pubkey_algo = v->pubkey_algo;
}
- p = ((byte *)v) + sizeof(*v);
+ p = ((uint8_t *)v) + sizeof(*v);
p = pgpPrtPubkeyParams(v->pubkey_algo, p, h, hlen);
rc = 0;
} break;
_digp->pubkey_algo = v->pubkey_algo;
}
- p = ((byte *)v) + sizeof(*v);
+ p = ((uint8_t *)v) + sizeof(*v);
p = pgpPrtPubkeyParams(v->pubkey_algo, p, h, hlen);
if (!(tag == PGPTAG_PUBLIC_KEY || tag == PGPTAG_PUBLIC_SUBKEY))
p = pgpPrtSeckeyParams(v->pubkey_algo, p, h, hlen);
return rc;
}
-int pgpPrtUserID(pgpTag tag, const byte *h, unsigned int hlen)
+int pgpPrtUserID(pgpTag tag, const uint8_t *h, unsigned int hlen)
{
pgpPrtVal("", pgpTagTbl, tag);
if (_print)
return 0;
}
-int pgpPrtComment(pgpTag tag, const byte *h, unsigned int hlen)
+int pgpPrtComment(pgpTag tag, const uint8_t *h, unsigned int hlen)
{
int i = hlen;
return 0;
}
-int pgpPubkeyFingerprint(const byte * pkt, unsigned int pktlen,
- byte * keyid)
+int pgpPubkeyFingerprint(const uint8_t * pkt, unsigned int pktlen,
+ uint8_t * keyid)
{
- const byte *s = pkt;
+ const uint8_t *s = pkt;
DIGEST_CTX ctx;
- byte version;
+ uint8_t version;
int rc = -1; /* assume failure. */
if (pkt[0] != 0x99)
} break;
case 4:
{ pgpPktKeyV4 v = (pgpPktKeyV4) (pkt + 3);
- byte * SHA1 = NULL;
+ uint8_t * SHA1 = NULL;
int i;
s += sizeof(pkt[0]) + sizeof(pkt[1]) + sizeof(pkt[2]) + sizeof(*v);
return rc;
}
-int pgpExtractPubkeyFingerprint(const char * b64pkt, byte * keyid)
+int pgpExtractPubkeyFingerprint(const char * b64pkt, uint8_t * keyid)
{
- const byte * pkt;
+ const uint8_t * pkt;
size_t pktlen;
if (b64decode(b64pkt, (void **)&pkt, &pktlen))
return 8; /* no. of bytes of pubkey signid */
}
-int pgpPrtPkt(const byte *pkt, unsigned int pleft)
+int pgpPrtPkt(const uint8_t *pkt, unsigned int pleft)
{
unsigned int val = *pkt;
unsigned int pktlen;
pgpTag tag;
unsigned int plen;
- const byte *h;
+ const uint8_t *h;
unsigned int hlen = 0;
int rc = 0;
return dig;
}
-int pgpPrtPkts(const byte * pkts, unsigned int pktlen, pgpDig dig, int printing)
+int pgpPrtPkts(const uint8_t * pkts, unsigned int pktlen, pgpDig dig, int printing)
{
unsigned int val = *pkts;
- const byte *p;
+ const uint8_t *p;
unsigned int pleft;
int len;
return 0;
}
-pgpArmor pgpReadPkts(const char * fn, const byte ** pkt, size_t * pktlen)
+pgpArmor pgpReadPkts(const char * fn, const uint8_t ** pkt, size_t * pktlen)
{
- byte * b = NULL;
+ uint8_t * b = NULL;
ssize_t blen;
const char * enc = NULL;
const char * crcenc = NULL;
- byte * dec;
- byte * crcdec;
+ uint8_t * dec;
+ uint8_t * crcdec;
size_t declen;
size_t crclen;
uint32_t crcpkt, crc;
extern "C" {
#endif
-typedef unsigned char byte;
-
/**
*/
typedef struct DIGEST_CTX_s * DIGEST_CTX;
* - MPI of Elgamal (Diffie-Hellman) value m * y**k mod p.
*/
typedef struct pgpPktPubkey_s {
- byte version; /*!< version number (generate 3, accept 2). */
- byte keyid[8]; /*!< key ID of the public key for session key. */
- byte algo; /*!< public key algorithm used. */
+ uint8_t version; /*!< version number (generate 3, accept 2). */
+ uint8_t keyid[8]; /*!< key ID of the public key for session key. */
+ uint8_t algo; /*!< public key algorithm used. */
} pgpPktPubkey;
* - MPI of DSA value s.
*/
typedef struct pgpPktSigV3_s {
- byte version; /*!< version number (3). */
- byte hashlen; /*!< length of following hashed material. MUST be 5. */
- byte sigtype; /*!< signature type. */
- byte time[4]; /*!< 4 byte creation time. */
- byte signid[8]; /*!< key ID of signer. */
- byte pubkey_algo; /*!< public key algorithm. */
- byte hash_algo; /*!< hash algorithm. */
- byte signhash16[2]; /*!< left 16 bits of signed hash value. */
+ uint8_t version; /*!< version number (3). */
+ uint8_t hashlen; /*!< length of following hashed material. MUST be 5. */
+ uint8_t sigtype; /*!< signature type. */
+ uint8_t time[4]; /*!< 4 byte creation time. */
+ uint8_t signid[8]; /*!< key ID of signer. */
+ uint8_t pubkey_algo; /*!< public key algorithm. */
+ uint8_t hash_algo; /*!< hash algorithm. */
+ uint8_t signhash16[2]; /*!< left 16 bits of signed hash value. */
} * pgpPktSigV3;
/**
* - One or more multi-precision integers comprising the signature.
*/
typedef struct pgpPktSigV4_s {
- byte version; /*!< version number (4). */
- byte sigtype; /*!< signature type. */
- byte pubkey_algo; /*!< public key algorithm. */
- byte hash_algo; /*!< hash algorithm. */
- byte hashlen[2]; /*!< length of following hashed material. */
+ uint8_t version; /*!< version number (4). */
+ uint8_t sigtype; /*!< signature type. */
+ uint8_t pubkey_algo; /*!< public key algorithm. */
+ uint8_t hash_algo; /*!< hash algorithm. */
+ uint8_t hashlen[2]; /*!< length of following hashed material. */
} * pgpPktSigV4;
/**
*
*/
typedef struct pgpPktSymkey_s {
- byte version; /*!< version number (4). */
- byte symkey_algo;
- byte s2k[1];
+ uint8_t version; /*!< version number (4). */
+ uint8_t symkey_algo;
+ uint8_t s2k[1];
} pgpPktSymkey;
/**
* pass packet.
*/
typedef struct pgpPktOnepass_s {
- byte version; /*!< version number (3). */
- byte sigtype; /*!< signature type. */
- byte hash_algo; /*!< hash algorithm. */
- byte pubkey_algo; /*!< public key algorithm. */
- byte signid[8]; /*!< key ID of signer. */
- byte nested;
+ uint8_t version; /*!< version number (3). */
+ uint8_t sigtype; /*!< signature type. */
+ uint8_t hash_algo; /*!< hash algorithm. */
+ uint8_t pubkey_algo; /*!< public key algorithm. */
+ uint8_t signid[8]; /*!< key ID of signer. */
+ uint8_t nested;
} * pgpPktOnepass;
/**
*
*/
typedef struct pgpPktKeyV3_s {
- byte version; /*!< version number (3). */
- byte time[4]; /*!< time that the key was created. */
- byte valid[2]; /*!< time in days that this key is valid. */
- byte pubkey_algo; /*!< public key algorithm. */
+ uint8_t version; /*!< version number (3). */
+ uint8_t time[4]; /*!< time that the key was created. */
+ uint8_t valid[2]; /*!< time in days that this key is valid. */
+ uint8_t pubkey_algo; /*!< public key algorithm. */
} * pgpPktKeyV3;
/**
*
*/
typedef struct pgpPktKeyV4_s {
- byte version; /*!< version number (4). */
- byte time[4]; /*!< time that the key was created. */
- byte pubkey_algo; /*!< public key algorithm. */
+ uint8_t version; /*!< version number (4). */
+ uint8_t time[4]; /*!< time that the key was created. */
+ uint8_t pubkey_algo; /*!< public key algorithm. */
} * pgpPktKeyV4;
/**
* blocks.
*/
typedef struct pgpPktCdata_s {
- byte compressalgo;
- byte data[1];
+ uint8_t compressalgo;
+ uint8_t data[1];
} pgpPktCdata;
/*
* session key is incorrect.
*/
typedef struct pgpPktEdata_s {
- byte data[1];
+ uint8_t data[1];
} pgpPktEdata;
/*
* the receiving software.
*/
typedef struct pgpPktLdata_s {
- byte format;
- byte filenamelen;
- byte filename[1];
+ uint8_t format;
+ uint8_t filenamelen;
+ uint8_t filename[1];
} pgpPktLdata;
/*
* other than local keyring files.
*/
typedef struct pgpPktTrust_s {
- byte flag;
+ uint8_t flag;
} pgpPktTrust;
/*
*
*/
typedef struct pgpPktUid_s {
- byte userid[1];
+ uint8_t userid[1];
} pgpPktUid;
/**
* @return native-endian integer
*/
static inline
-unsigned int pgpGrab(const byte *s, int nbytes)
+unsigned int pgpGrab(const uint8_t *s, int nbytes)
{
unsigned int i = 0;
int nb = (nbytes <= sizeof(i) ? nbytes : sizeof(i));
* @return no. of bytes in length prefix
*/
static inline
-int pgpLen(const byte *s, unsigned int *lenp)
+int pgpLen(const uint8_t *s, unsigned int *lenp)
{
if (*s < 192) {
(*lenp) = *s++;
* @return no. of bits
*/
static inline
-unsigned int pgpMpiBits(const byte *p)
+unsigned int pgpMpiBits(const uint8_t *p)
{
return ((p[0] << 8) | p[1]);
}
* @return no. of bytes
*/
static inline
-unsigned int pgpMpiLen(const byte *p)
+unsigned int pgpMpiLen(const uint8_t *p)
{
return (2 + ((pgpMpiBits(p)+7)>>3));
}
* @return target buffer
*/
static inline
-char * pgpHexCvt(char *t, const byte *s, int nbytes)
+char * pgpHexCvt(char *t, const uint8_t *s, int nbytes)
{
static char hex[] = "0123456789abcdef";
while (nbytes-- > 0) {
* @return hex formatted string
*/
static inline
-char * pgpHexStr(const byte *p, unsigned int plen)
+char * pgpHexStr(const uint8_t *p, unsigned int plen)
{
static char prbuf[8*BUFSIZ]; /* XXX ick */
char *t = prbuf;
* @return hex formatted string
*/
static inline
-const char * pgpMpiStr(const byte *p)
+const char * pgpMpiStr(const uint8_t *p)
{
static char prbuf[8*BUFSIZ]; /* XXX ick */
char *t = prbuf;
* @return string value of byte
*/
static inline
-const char * pgpValStr(pgpValTbl vs, byte val)
+const char * pgpValStr(pgpValTbl vs, uint8_t val)
{
do {
if (vs->val == val)
* @param vs table of (string,value) pairs
* @param val byte value to print
*/
-void pgpPrtVal(const char * pre, pgpValTbl vs, byte val);
+void pgpPrtVal(const char * pre, pgpValTbl vs, uint8_t val);
/**
* Print/parse an OpenPGP subtype packet.
* @param sigtype signature type
* @return 0 on success
*/
-int pgpPrtSubType(const byte *h, unsigned int hlen, pgpSigType sigtype);
+int pgpPrtSubType(const uint8_t *h, unsigned int hlen, pgpSigType sigtype);
/**
* Print/parse an OpenPGP signature packet.
* @param hlen packet length (no. of bytes)
* @return 0 on success
*/
-int pgpPrtSig(pgpTag tag, const byte *h, unsigned int hlen);
+int pgpPrtSig(pgpTag tag, const uint8_t *h, unsigned int hlen);
/**
* Print/parse an OpenPGP key packet.
* @param hlen packet length (no. of bytes)
* @return 0 on success
*/
-int pgpPrtKey(pgpTag tag, const byte *h, unsigned int hlen);
+int pgpPrtKey(pgpTag tag, const uint8_t *h, unsigned int hlen);
/**
* Print/parse an OpenPGP userid packet.
* @param hlen packet length (no. of bytes)
* @return 0 on success
*/
-int pgpPrtUserID(pgpTag tag, const byte *h, unsigned int hlen);
+int pgpPrtUserID(pgpTag tag, const uint8_t *h, unsigned int hlen);
/**
* Print/parse an OpenPGP comment packet.
* @param hlen packet length (no. of bytes)
* @return 0 on success
*/
-int pgpPrtComment(pgpTag tag, const byte *h, unsigned int hlen);
+int pgpPrtComment(pgpTag tag, const uint8_t *h, unsigned int hlen);
/**
* Calculate OpenPGP public key fingerprint.
* @retval keyid publick key fingerprint
* @return 0 on sucess, else -1
*/
-int pgpPubkeyFingerprint(const byte * pkt, unsigned int pktlen,
- byte * keyid);
+int pgpPubkeyFingerprint(const uint8_t * pkt, unsigned int pktlen,
+ uint8_t * keyid);
/**
* Extract OpenPGP public key fingerprint from base64 encoded packet.
* @retval keyid[8] public key fingerprint
* @return 8 (no. of bytes) on success, < 0 on error
*/
-int pgpExtractPubkeyFingerprint(const char * b64pkt, byte * keyid);
+int pgpExtractPubkeyFingerprint(const char * b64pkt, uint8_t * keyid);
/**
* @param pleft no. bytes remaining
* @return -1 on error, otherwise this packet length
*/
-int pgpPrtPkt(const byte *pkt, unsigned int pleft);
+int pgpPrtPkt(const uint8_t *pkt, unsigned int pleft);
/**
* Print/parse a OpenPGP packet(s).
* @param printing should packets be printed?
* @return -1 on error, 0 on success
*/
-int pgpPrtPkts(const byte *pkts, unsigned int pktlen, pgpDig dig, int printing);
+int pgpPrtPkts(const uint8_t *pkts, unsigned int pktlen, pgpDig dig, int printing);
/**
* Parse armored OpenPGP packets from a file.
* @return type of armor found
*/
pgpArmor pgpReadPkts(const char * fn,
- const byte ** pkt, size_t * pktlen);
+ const uint8_t ** pkt, size_t * pktlen);
/**
* Wrap a OpenPGP packets in ascii armor for transport.
* @return 1 if an OpenPGP packet, 0 otherwise
*/
static inline
-int pgpIsPkt(const byte * p)
+int pgpIsPkt(const uint8_t * p)
{
unsigned int val = *p++;
pgpTag tag;
* @return crc of buffer
*/
static inline
-unsigned int pgpCRC(const byte *octets, size_t len)
+unsigned int pgpCRC(const uint8_t *octets, size_t len)
{
unsigned int crc = CRC24_INIT;
int i;
/* Now format the build ID bits in hex to print out. */
{
- const byte * id = (byte *)build_id->d_buf + build_id_offset;
+ const uint8_t * id = (uint8_t *)build_id->d_buf + build_id_offset;
char hex[build_id_size * 2 + 1];
pgpHexCvt(hex, id, build_id_size);
puts (hex);