rpm  5.4.15
rpmhkp.h
Go to the documentation of this file.
1 #ifndef RPMHKP_H
2 #define RPMHKP_H
3 
8 #include <rpmiotypes.h>
9 #include <rpmio.h>
10 
11 typedef /*@abstract@*/ /*@refcounted@*/ struct rpmhkp_s * rpmhkp;
12 
13 /*@unchecked@*/
14 extern int _rpmhkp_debug;
15 
16 /*@unchecked@*/
17 extern rpmhkp _rpmhkpI;
18 
19 #if defined(_RPMHKP_INTERNAL)
20 #include <rpmbf.h>
21 struct _filter_s {
22  rpmbf bf;
23  size_t n;
24  double e;
25  size_t m;
26  size_t k;
27 };
28 extern struct _filter_s _rpmhkp_awol;
29 extern struct _filter_s _rpmhkp_crl;
30 
31 extern int _rpmhkp_lvl;
32 
33 struct rpmhkp_s {
34  struct rpmioItem_s _item;
35  rpmuint8_t * pkt;
36  size_t pktlen;
37  rpmuint8_t ** pkts;
38  int npkts;
39 
40  int pubx;
41  int uidx;
42  int subx;
43  int sigx;
44 
45  rpmuint8_t keyid[8];
46  rpmuint8_t subid[8];
47  rpmuint8_t signid[8]; /* XXX replaces ts->pksignid */
48  rpmuint8_t goop[6];
49 
50  rpmuint32_t tvalid;
51  int uvalidx;
52 
53  rpmbf awol;
54  rpmbf crl;
55 
56 #if defined(__LCLINT__)
57 /*@refs@*/
58  int nrefs;
59 #endif
60 };
61 #endif /* _RPMHKP_INTERNAL */
62 
63 #ifdef __cplusplus
64 extern "C" {
65 #endif
66 
72 /*@unused@*/ /*@null@*/
73 rpmhkp rpmhkpUnlink (/*@killref@*/ /*@only@*/ /*@null@*/ rpmhkp hkp)
74  /*@modifies hkp @*/;
75 #define rpmhkpUnlink(_hkp) \
76  ((rpmhkp)rpmioUnlinkPoolItem((rpmioItem)(_hkp), __FUNCTION__, __FILE__, __LINE__))
77 
83 /*@unused@*/ /*@newref@*/ /*@null@*/
84 rpmhkp rpmhkpLink (/*@null@*/ rpmhkp hkp)
85  /*@modifies hkp @*/;
86 #define rpmhkpLink(_hkp) \
87  ((rpmhkp)rpmioLinkPoolItem((rpmioItem)(_hkp), __FUNCTION__, __FILE__, __LINE__))
88 
94 /*@null@*/
95 rpmhkp rpmhkpFree(/*@killref@*/ /*@null@*/rpmhkp hkp)
96  /*@globals fileSystem @*/
97  /*@modifies hkp, fileSystem @*/;
98 #define rpmhkpFree(_hkp) \
99  ((rpmhkp)rpmioFreePoolItem((rpmioItem)(_hkp), __FUNCTION__, __FILE__, __LINE__))
100 
107 /*@newref@*/ /*@null@*/
108 rpmhkp rpmhkpNew(/*@null@*/ const rpmuint8_t * keyid, uint32_t flags)
109  /*@globals fileSystem, internalState @*/
110  /*@modifies fileSystem, internalState @*/;
111 
117 rpmhkp rpmhkpLookup(const char * keyname)
118  /*@*/;
119 
126 rpmRC rpmhkpValidate(/*@null@*/ rpmhkp hkp, /*@null@*/ const char * keyname)
127  /*@*/;
128 
129 #if defined(_RPMHKP_INTERNAL)
130 
138 int rpmhkpLoadKey(rpmhkp hkp, pgpDig dig,
139  int keyx, rpmuint8_t pubkey_algo)
140  /*@*/;
141 
149 int rpmhkpLoadSignature(/*@null@*/ rpmhkp hkp, pgpDig dig, pgpPkt pp)
150  /*@*/;
151 
160 int rpmhkpFindKey(rpmhkp hkp, pgpDig dig,
161  const rpmuint8_t * signid, rpmuint8_t pubkey_algo)
162  /*@*/;
163 
170 void _rpmhkpDumpDigParams(const char * msg, pgpDigParams sigp,
171  /*@null@*/ FILE * fp)
172  /*@*/;
173 
180 void _rpmhkpDumpDig(const char * msg, pgpDig dig,
181  /*@null@*/ FILE * fp)
182  /*@*/;
183 
191 int rpmhkpUpdate(/*@null@*/ DIGEST_CTX ctx, const void * data, size_t len)
192  /*@*/;
193 #endif /* _RPMHKP_INTERNAL */
194 
199 void _rpmhkpPrintStats(/*@null@*/ FILE * fp)
200  /*@*/;
201 
202 #ifdef __cplusplus
203 }
204 #endif
205 
206 #endif /* RPMHKP_H */
void _rpmhkpDumpDig(const char *msg, pgpDig dig, FILE *fp)
Definition: rpmhkp.c:1164
int rpmhkpFindKey(rpmhkp hkp, pgpDig dig, const rpmuint8_t *signid, rpmuint8_t pubkey_algo)
Definition: rpmhkp.c:404
const char const char size_t len
Definition: bson.h:823
void _rpmhkpPrintStats(FILE *fp)
Display hkp usage statistics.
Definition: rpmhkp.c:1111
struct pgpDigParams_s * pgpDigParams
Definition: rpmiotypes.h:101
struct rpmbf_s * rpmbf
Definition: rpmbf.h:17
#define rpmhkpUnlink(_hkp)
Definition: rpmhkp.h:75
struct _filter_s _rpmhkp_crl
Definition: rpmhkp.c:25
#define rpmhkpLink(_hkp)
Definition: rpmhkp.h:86
unsigned int rpmuint32_t
Definition: rpmiotypes.h:28
unsigned char rpmuint8_t
Private int typedefs to avoid C99 portability issues.
Definition: rpmiotypes.h:26
int rpmhkpUpdate(DIGEST_CTX ctx, const void *data, size_t len)
Definition: rpmhkp.c:562
const char const bson * data
Definition: mongo.h:463
struct pgpPkt_s * pgpPkt
Definition: rpmiotypes.h:93
void _rpmhkpDumpDigParams(const char *msg, pgpDigParams sigp, FILE *fp)
Definition: rpmhkp.c:1141
Digest private data.
Definition: digest.c:130
rpmhkp _rpmhkpI
Definition: rpmhkp.c:22
struct pgpDig_s * pgpDig
Definition: rpmiotypes.h:97
struct _filter_s _rpmhkp_awol
Definition: rpmhkp.c:24
#define rpmhkpFree(_hkp)
Definition: rpmhkp.h:98
const char const bson int mongo_write_concern int flags
Definition: mongo.h:485
rpmRC rpmhkpValidate(rpmhkp hkp, const char *keyname)
Retrieve/Validate binding and certification signatures on a pubkey.
Definition: rpmhkp.c:901
enum rpmRC_e rpmRC
RPM return codes.
rpmhkp rpmhkpNew(const rpmuint8_t *keyid, uint32_t flags)
Create a new hkp handle.
Definition: rpmhkp.c:112
int rpmhkpLoadKey(rpmhkp hkp, pgpDig dig, int keyx, rpmuint8_t pubkey_algo)
Definition: rpmhkp.c:363
rpmhkp rpmhkpLookup(const char *keyname)
Retrieve a pubkey from a SKS server.
Definition: rpmhkp.c:318
struct rpmhkp_s * rpmhkp
Definition: rpmhkp.h:11
int _rpmhkp_debug
Definition: rpmhkp.c:19
int rpmhkpLoadSignature(rpmhkp hkp, pgpDig dig, pgpPkt pp)
Definition: rpmhkp.c:461
int _rpmhkp_lvl
Definition: rpmhkp.c:65