1996-09-29 10:29:09 +08:00
|
|
|
#ifndef H_SIGNATURE
|
|
|
|
|
1996-02-19 10:32:11 +08:00
|
|
|
/* signature.h - generate and verify signatures */
|
|
|
|
|
1996-07-08 06:19:32 +08:00
|
|
|
#include "header.h"
|
|
|
|
|
|
|
|
/**************************************************/
|
|
|
|
/* */
|
|
|
|
/* Signature types */
|
|
|
|
/* */
|
|
|
|
/* These are what goes in the Lead */
|
|
|
|
/* */
|
|
|
|
/**************************************************/
|
|
|
|
|
1996-02-19 10:32:11 +08:00
|
|
|
#define RPMSIG_NONE 0 /* Do not change! */
|
|
|
|
#define RPMSIG_BAD 2 /* Returned for unknown types */
|
1996-07-08 06:19:32 +08:00
|
|
|
/* The following types are no longer generated */
|
|
|
|
#define RPMSIG_PGP262_1024 1 /* No longer generated */
|
|
|
|
#define RPMSIG_MD5 3
|
|
|
|
#define RPMSIG_MD5_PGP 4
|
1996-02-19 10:32:11 +08:00
|
|
|
|
1996-07-08 06:19:32 +08:00
|
|
|
/* These are the new-style signatures. They are Header structures. */
|
|
|
|
/* Inside them we can put any number of any type of signature we like. */
|
1996-06-20 11:10:17 +08:00
|
|
|
|
1996-07-08 06:19:32 +08:00
|
|
|
#define RPMSIG_HEADERSIG 5 /* New Header style signature */
|
|
|
|
|
|
|
|
/**************************************************/
|
|
|
|
/* */
|
|
|
|
/* Prototypes */
|
|
|
|
/* */
|
|
|
|
/**************************************************/
|
|
|
|
|
1996-11-19 02:02:36 +08:00
|
|
|
Header rpmNewSignature(void);
|
1996-07-08 06:19:32 +08:00
|
|
|
|
|
|
|
/* If an old-style signature is found, we emulate a new style one */
|
1996-11-19 02:02:36 +08:00
|
|
|
int rpmReadSignature(int fd, Header *header, short sig_type);
|
|
|
|
int rpmWriteSignature(int fd, Header header);
|
1996-02-19 10:32:11 +08:00
|
|
|
|
1996-07-08 06:19:32 +08:00
|
|
|
/* Generate a signature of data in file, insert in header */
|
1996-11-19 02:02:36 +08:00
|
|
|
int rpmAddSignature(Header header, char *file,
|
|
|
|
int_32 sigTag, char *passPhrase);
|
1996-07-08 06:19:32 +08:00
|
|
|
|
|
|
|
/******************************************************************/
|
1996-02-19 10:32:11 +08:00
|
|
|
|
|
|
|
/* Return type of signature in effect for building */
|
1996-11-19 02:02:36 +08:00
|
|
|
int rpmLookupSignatureType(void);
|
1996-02-20 23:06:47 +08:00
|
|
|
|
|
|
|
/* Utility to read a pass phrase from the user */
|
1996-11-19 02:02:36 +08:00
|
|
|
char *rpmGetPassPhrase(char *prompt);
|
1996-09-29 10:29:09 +08:00
|
|
|
|
|
|
|
#endif
|