forked from rpm-software-management/rpm
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrpmvs.h
82 lines (63 loc) · 1.74 KB
/
rpmvs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef _RPMVS_H
#define _RPMVS_H
#include <rpm/rpmtypes.h>
#include <rpm/rpmts.h> /* for rpmVSFlags */
#include "lib/header_internal.h"
/* siginfo range bits */
enum {
RPMSIG_HEADER = (1 << 0),
RPMSIG_PAYLOAD = (1 << 1),
};
struct rpmsinfo_s {
/* static data */
int type;
int disabler;
int range;
/* parsed data */
int hashalgo;
int sigalgo;
int alt;
int id;
int wrapped;
int strength;
unsigned int keyid;
union {
pgpDigParams sig;
char *dig;
};
char *descr;
DIGEST_CTX ctx;
/* verify results */
rpmRC rc;
char *msg;
};
/**
* Signature/digest verification callback prototype.
* Useful eg for customizing verification output and results.
*
* @param sinfo signature/digest info
* @param cbdata callback data
* @return 1 to continue, 0 to stop verification
*/
typedef int (*rpmsinfoCb)(struct rpmsinfo_s *sinfo, void *cbdata);
#ifdef __cplusplus
extern "C" {
#endif
const char *rpmsinfoDescr(struct rpmsinfo_s *sinfo);
char *rpmsinfoMsg(struct rpmsinfo_s *sinfo);
struct rpmvs_s *rpmvsCreate(int vfylevel, rpmVSFlags vsflags, rpmKeyring keyring);
void rpmvsInit(struct rpmvs_s *vs, hdrblob blob, rpmDigestBundle bundle);
rpmVSFlags rpmvsFlags(struct rpmvs_s *vs);
struct rpmvs_s *rpmvsFree(struct rpmvs_s *sis);
void rpmvsAppendTag(struct rpmvs_s *sis, hdrblob blob, rpmTagVal tag);
void rpmvsInitRange(struct rpmvs_s *sis, int range);
void rpmvsFiniRange(struct rpmvs_s *sis, int range);
int rpmvsRange(struct rpmvs_s *vs);
int rpmvsVerify(struct rpmvs_s *sis, int type,
rpmsinfoCb cb, void *cbdata);
rpmRC rpmpkgRead(struct rpmvs_s *vs, FD_t fd,
hdrblob *sigblobp, hdrblob *blobp, char **emsg);
#ifdef __cplusplus
}
#endif
#endif /* _RPMVS_H */