| rpm4compat.h | | rpm4compat.h | |
| /* | | /* | |
| * Copyright © 2008 Per Øyvind Karlsen <peroyvind@mandriva.org> | | * Copyright © 2008 Per Øyvind Karlsen <peroyvind@mandriva.org> | |
| * | | * | |
|
| * $Id: rpm4compat.h,v 2.10.2.1 2008/07/18 13:05:34 bero Exp $ | | * $Id: rpm4compat.h,v 2.23.2.1 2009/05/14 10:53:07 pkarlsen Exp $ | |
| */ | | */ | |
| | | | |
| #ifndef H_RPM4COMPAT | | #ifndef H_RPM4COMPAT | |
| #define H_RPM4COMPAT 1 | | #define H_RPM4COMPAT 1 | |
| | | | |
| #define RPM_NULL_TYPE 0 | | #define RPM_NULL_TYPE 0 | |
| #define RPM_CHAR_TYPE RPM_UINT8_TYPE | | #define RPM_CHAR_TYPE RPM_UINT8_TYPE | |
| #define RPM_INT8_TYPE RPM_UINT8_TYPE | | #define RPM_INT8_TYPE RPM_UINT8_TYPE | |
| #define RPM_INT16_TYPE RPM_UINT16_TYPE | | #define RPM_INT16_TYPE RPM_UINT16_TYPE | |
| #define RPM_INT32_TYPE RPM_UINT32_TYPE | | #define RPM_INT32_TYPE RPM_UINT32_TYPE | |
| | | | |
| skipping to change at line 39 | | skipping to change at line 39 | |
| | | | |
| #define RPMBUILD_ISSOURCE RPMFILE_SOURCE | | #define RPMBUILD_ISSOURCE RPMFILE_SOURCE | |
| #define RPMBUILD_ISPATCH RPMFILE_PATCH | | #define RPMBUILD_ISPATCH RPMFILE_PATCH | |
| #define RPMBUILD_ISICON RPMFILE_ICON | | #define RPMBUILD_ISICON RPMFILE_ICON | |
| #define RPMBUILD_ISNO RPMFILE_MISSINGOK | | #define RPMBUILD_ISNO RPMFILE_MISSINGOK | |
| | | | |
| #define buildRestrictions sourceHeader | | #define buildRestrictions sourceHeader | |
| | | | |
| #include <fcntl.h> | | #include <fcntl.h> | |
| #include <unistd.h> | | #include <unistd.h> | |
|
| #include <stdint.h> | | | |
| #include <stdio.h> | | #include <stdio.h> | |
| | | | |
|
| #define WITH_DB | | | |
| #define _RPMPS_INTERNAL | | | |
| #define _RPMEVR_INTERNAL | | | |
| #define _RPMTAG_INTERNAL | | #define _RPMTAG_INTERNAL | |
|
| | | #define _RPMEVR_INTERNAL | |
| | | #define _RPMPS_INTERNAL | |
| | | | |
| #include <rpm/rpmio.h> | | #include <rpm/rpmio.h> | |
|
| #include <rpm/rpmlib.h> | | #include <rpm/rpmcb.h> | |
| | | #include <rpm/rpmiotypes.h> | |
| | | #include <rpm/rpmmacro.h> | |
| | | #include <rpm/rpmpgp.h> | |
| | | | |
| | | #include <rpm/rpmtypes.h> | |
| | | #include <rpm/rpmtag.h> | |
| #include <rpm/rpmevr.h> | | #include <rpm/rpmevr.h> | |
| #include <rpm/pkgio.h> | | #include <rpm/pkgio.h> | |
|
| #include <rpm/rpmcb.h> | | | |
| #include <rpm/rpmds.h> | | #include <rpm/rpmds.h> | |
| #include <rpm/rpmts.h> | | #include <rpm/rpmts.h> | |
|
| #include <rpm/rpmmacro.h> | | | |
| #include <rpm/rpmpgp.h> | | | |
| #include <rpm/rpmurl.h> | | | |
| #include <rpm/rpmcli.h> | | #include <rpm/rpmcli.h> | |
|
| | | #include <rpm/rpmps.h> | |
| | | | |
| enum hMagic { | | enum hMagic { | |
| HEADER_MAGIC_NO = 0, | | HEADER_MAGIC_NO = 0, | |
| HEADER_MAGIC_YES = 1 | | HEADER_MAGIC_YES = 1 | |
| }; | | }; | |
| | | | |
|
| typedef uint32_t * hTAG_t; | | typedef rpmuint32_t * hTAG_t; | |
| typedef uint32_t * hTYP_t; | | typedef rpmuint32_t * hTYP_t; | |
| typedef const void * hPTR_t; | | typedef const void * hPTR_t; | |
|
| typedef uint32_t * hCNT_t; | | typedef rpmuint32_t * hCNT_t; | |
| typedef uint32_t int_32; | | typedef rpmuint32_t int_32; | |
| typedef uint32_t uint_32; | | typedef rpmuint32_t uint_32; | |
| typedef uint16_t uint_16; | | typedef rpmuint16_t uint_16; | |
| typedef uint16_t int_16; | | typedef rpmuint16_t int_16; | |
| typedef uint8_t int_8; | | typedef rpmuint8_t int_8; | |
| typedef uint8_t byte; | | typedef rpmuint8_t byte; | |
| | | | |
| typedef union hRET_s { | | typedef union hRET_s { | |
| const void * ptr; | | const void * ptr; | |
| const char ** argv; | | const char ** argv; | |
| const char * str; | | const char * str; | |
|
| uint32_t * ui32p; | | rpmuint32_t * ui32p; | |
| uint16_t * ui16p; | | rpmuint16_t * ui16p; | |
| uint32_t * i32p; | | rpmuint32_t * i32p; | |
| uint16_t * i16p; | | rpmuint16_t * i16p; | |
| uint8_t * i8p; | | rpmuint8_t * i8p; | |
| } * hRET_t; | | } * hRET_t; | |
| | | | |
| typedef enum pgpVSFlags_e rpmVSFlags_e; | | typedef enum pgpVSFlags_e rpmVSFlags_e; | |
| | | | |
|
| | | enum rpm_machtable_e { | |
| | | RPM_MACHTABLE_INSTARCH = 0, /*!< Install platform architecture. | |
| | | */ | |
| | | RPM_MACHTABLE_INSTOS = 1, /*!< Install platform operating sys | |
| | | tem. */ | |
| | | RPM_MACHTABLE_BUILDARCH = 2, /*!< Build platform architecture. * | |
| | | / | |
| | | RPM_MACHTABLE_BUILDOS = 3 /*!< Build platform operating syste | |
| | | m. */ | |
| | | }; | |
| | | #define RPM_MACHTABLE_COUNT 4 /*!< No. of arch/os tables. */ | |
| | | | |
| | | typedef enum urltype_e { | |
| | | URL_IS_UNKNOWN = 0, /*!< unknown (aka a file) */ | |
| | | URL_IS_DASH = 1, /*!< stdin/stdout */ | |
| | | URL_IS_PATH = 2, /*!< file://... */ | |
| | | URL_IS_FTP = 3, /*!< ftp://... */ | |
| | | URL_IS_HTTP = 4, /*!< http://... */ | |
| | | URL_IS_HTTPS = 5, /*!< https://... */ | |
| | | URL_IS_HKP = 6 /*!< hkp://... */ | |
| | | } urltype; | |
| | | | |
| | | urltype urlPath(const char * url, /*@out@*/ const char ** pathp); | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void **
p, hCNT_t c) { | | static inline int headerGetEntry(Header h, int_32 tag, hTYP_t type, void **
p, hCNT_t c) { | |
|
| HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | | HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | |
| int rc; | | int rc; | |
| | | | |
| /* Always ensure to initialize */ | | /* Always ensure to initialize */ | |
| *(void **)p = NULL; | | *(void **)p = NULL; | |
| he->tag = (rpmTag)tag; | | he->tag = (rpmTag)tag; | |
| rc = headerGet(h, he, 0); | | rc = headerGet(h, he, 0); | |
| if (rc) { | | if (rc) { | |
| if (type) *type = he->t; | | if (type) *type = he->t; | |
| if (p) *(void **) p = he->p.ptr; | | if (p) *(void **) p = he->p.ptr; | |
| if (c) *c = he->c; | | if (c) *c = he->c; | |
| } | | } | |
| | | | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| static inline int headerGetRawEntry(Header h, int_32 tag, hTYP_t type, void
* p, hCNT_t c) { | | static inline int headerGetRawEntry(Header h, int_32 tag, hTYP_t type, void
* p, hCNT_t c) { | |
|
| HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | | HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | |
| int rc; | | int rc; | |
| | | | |
| he->tag = (rpmTag)tag; | | he->tag = (rpmTag)tag; | |
| he->t = *(rpmTagType*)type; | | he->t = *(rpmTagType*)type; | |
| he->p.str = (const char*)p; | | he->p.str = (const char*)p; | |
| he->c = *(rpmTagCount*)c; | | he->c = *(rpmTagCount*)c; | |
| | | | |
| rc = headerGet(h, he, tag); | | rc = headerGet(h, he, tag); | |
| | | | |
| if (rc) { | | if (rc) { | |
| if (type) *type = he->t; | | if (type) *type = he->t; | |
| if (p) *(void **) p = he->p.ptr; | | if (p) *(void **) p = he->p.ptr; | |
| if (c) *c = he->c; | | if (c) *c = he->c; | |
| } | | } | |
| | | | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
| static inline void rpmfiBuildFNames(Header h, rpmTag tagN, const char *** f
np, rpmTagCount * fcp) { | | static inline void rpmfiBuildFNames(Header h, rpmTag tagN, const char *** f
np, rpmTagCount * fcp) { | |
|
| HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | | HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | |
| | | | |
| rpmTag dirNameTag = (rpmTag)0; | | rpmTag dirNameTag = (rpmTag)0; | |
| rpmTag dirIndexesTag = (rpmTag)0; | | rpmTag dirIndexesTag = (rpmTag)0; | |
| rpmTagData baseNames; | | rpmTagData baseNames; | |
| rpmTagData dirNames; | | rpmTagData dirNames; | |
| rpmTagData dirIndexes; | | rpmTagData dirIndexes; | |
| rpmTagData fileNames; | | rpmTagData fileNames; | |
| rpmTagCount count; | | rpmTagCount count; | |
| size_t size; | | size_t size; | |
| char * t; | | char * t; | |
| | | | |
| skipping to change at line 203 | | skipping to change at line 227 | |
| dirIndexes.ptr = _free(dirIndexes.ptr); | | dirIndexes.ptr = _free(dirIndexes.ptr); | |
| | | | |
| if (fnp) | | if (fnp) | |
| *fnp = fileNames.argv; | | *fnp = fileNames.argv; | |
| else | | else | |
| fileNames.ptr = _free(fileNames.ptr); | | fileNames.ptr = _free(fileNames.ptr); | |
| if (fcp) *fcp = count; | | if (fcp) *fcp = count; | |
| } | | } | |
| | | | |
| static inline int headerAddEntry(Header h, int_32 tag, int_32 type, const v
oid * p, int_32 c) { | | static inline int headerAddEntry(Header h, int_32 tag, int_32 type, const v
oid * p, int_32 c) { | |
|
| HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | | HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | |
| | | | |
| he->tag = (rpmTag)tag; | | he->tag = (rpmTag)tag; | |
| he->t = (rpmTagType)type; | | he->t = (rpmTagType)type; | |
| he->p.str = (const char*)p; | | he->p.str = (const char*)p; | |
| he->c = (rpmTagCount)c; | | he->c = (rpmTagCount)c; | |
| return headerPut(h, he, 0); | | return headerPut(h, he, 0); | |
| } | | } | |
| | | | |
|
| | | static inline int headerAddOrAppendEntry(Header h, int_32 tag, int_32 type, | |
| | | const void * p, int_32 c) { | |
| | | HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | |
| | | | |
| | | he->tag = (rpmTag)tag; | |
| | | he->t = (rpmTagType)type; | |
| | | he->p.str = (const char*)p; | |
| | | he->c = (rpmTagCount)c; | |
| | | he->append = 1; | |
| | | return headerPut(h, he, 0); | |
| | | } | |
| | | | |
| | | static inline int headerAppendEntry(Header h, int_32 tag, int_32 type, cons | |
| | | t void * p, int_32 c) { | |
| | | | |
| | | return headerAddOrAppendEntry(h, tag, type, p, c); | |
| | | } | |
| | | | |
| static inline int headerRemoveEntry(Header h, int_32 tag) { | | static inline int headerRemoveEntry(Header h, int_32 tag) { | |
|
| HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | | HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | |
| | | | |
| he->tag = (rpmTag)tag; | | he->tag = (rpmTag)tag; | |
| return headerDel(h, he, 0); | | return headerDel(h, he, 0); | |
| } | | } | |
| | | | |
| static inline int headerModifyEntry(Header h, int_32 tag, int_32 type, cons
t void * p, int_32 c) { | | static inline int headerModifyEntry(Header h, int_32 tag, int_32 type, cons
t void * p, int_32 c) { | |
|
| HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | | HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | |
| | | | |
| he->tag = (rpmTag)tag; | | he->tag = (rpmTag)tag; | |
| he->t = (rpmTagType)type; | | he->t = (rpmTagType)type; | |
| he->p.str = (const char*)p; | | he->p.str = (const char*)p; | |
| he->c = (rpmTagCount)c; | | he->c = (rpmTagCount)c; | |
| return headerMod(h, he, 0); | | return headerMod(h, he, 0); | |
| | | | |
| } | | } | |
| | | | |
| static inline int headerNextIterator(HeaderIterator hi, hTAG_t tag, hTYP_t
type, hPTR_t * p, hCNT_t c) { | | static inline int headerNextIterator(HeaderIterator hi, hTAG_t tag, hTYP_t
type, hPTR_t * p, hCNT_t c) { | |
|
| HE_t he = (HE_s*)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | | HE_t he = (HE_t)memset(alloca(sizeof(*he)), 0, sizeof(*he)); | |
| | | int rc = headerNext(hi, he, 0); | |
| | | | |
|
| he->tag = *(rpmTag*)tag; | | if (rc) { | |
| (void) type; | | if (tag) *tag = he->tag; | |
| (void) p; | | if (type) *type = he->t; | |
| (void) c; | | if (p) *(void **) p = he->p.ptr; | |
| return headerNext(hi, he, 0); | | if (c) *c = he->c; | |
| | | } | |
| | | | |
| | | return rc; | |
| } | | } | |
| | | | |
| static inline HeaderIterator headerFreeIterator(HeaderIterator hi) { | | static inline HeaderIterator headerFreeIterator(HeaderIterator hi) { | |
| return headerFini(hi); | | return headerFini(hi); | |
| } | | } | |
| | | | |
| static inline HeaderIterator headerInitIterator(Header h){ | | static inline HeaderIterator headerInitIterator(Header h){ | |
| return headerInit(h); | | return headerInit(h); | |
| } | | } | |
| | | | |
|
| static inline void * headerFreeData(const void * data, rpmTagType type) { | | static inline void * headerFreeData(const void * data, __attribute__((unuse
d)) rpmTagType type) { | |
| if (data) | | if (data) | |
| free((void *)data); | | free((void *)data); | |
| return NULL; | | return NULL; | |
| } | | } | |
| | | | |
|
| static inline int headerWrite(void * _fd, Header h, enum hMagic magicp) { | | static inline int headerWrite(void * _fd, Header h, __attribute__((unused))
enum hMagic magicp) { | |
| const char item[] = "Header"; | | const char item[] = "Header"; | |
| const char * msg = NULL; | | const char * msg = NULL; | |
|
| (void) magicp; | | | |
| rpmRC rc = rpmpkgWrite(item, (FD_t)_fd, h, &msg); | | rpmRC rc = rpmpkgWrite(item, (FD_t)_fd, h, &msg); | |
| if (rc != RPMRC_OK) { | | if (rc != RPMRC_OK) { | |
| rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerWrite", item, msg)
; | | rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerWrite", item, msg)
; | |
| rc = RPMRC_FAIL; | | rc = RPMRC_FAIL; | |
| } | | } | |
| msg = (const char*)_free(msg); | | msg = (const char*)_free(msg); | |
| return rc; | | return rc; | |
| } | | } | |
| | | | |
|
| static inline Header headerRead(void * _fd, enum hMagic magicp) { | | static inline Header headerRead(void * _fd, __attribute__((unused)) enum hM
agic magicp) { | |
| const char item[] = "Header"; | | const char item[] = "Header"; | |
| Header h = NULL; | | Header h = NULL; | |
| const char * msg = NULL; | | const char * msg = NULL; | |
|
| (void) magicp; | | | |
| rpmRC rc = rpmpkgRead(item, (FD_t)_fd, &h, &msg); | | rpmRC rc = rpmpkgRead(item, (FD_t)_fd, &h, &msg); | |
| switch (rc) { | | switch (rc) { | |
| default: | | default: | |
| rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", ite
m, msg); | | rpmlog(RPMLOG_ERR, "%s: %s: %s\n", "headerRead", ite
m, msg); | |
| case RPMRC_NOTFOUND: | | case RPMRC_NOTFOUND: | |
| h = NULL; | | h = NULL; | |
| case RPMRC_OK: | | case RPMRC_OK: | |
| break; | | break; | |
| } | | } | |
| msg = (const char*)_free(msg); | | msg = (const char*)_free(msg); | |
| return h; | | return h; | |
| } | | } | |
| | | | |
|
| static inline int rpmMachineScore(int type, const char * name) { | | static inline char * headerFormat(Header h, const char * fmt, errmsg_t * er | |
| | | rmsg) { | |
| | | return headerSprintf(h, fmt, NULL, NULL, errmsg); | |
| | | } | |
| | | | |
| | | static inline int rpmMachineScore(__attribute__((unused)) int type, const c | |
| | | har * name) { | |
| char * platform = rpmExpand(name, "-%{_target_vendor}-%{_target_os}%
{?_gnu}", NULL); | | char * platform = rpmExpand(name, "-%{_target_vendor}-%{_target_os}%
{?_gnu}", NULL); | |
| int score = rpmPlatformScore(platform, NULL, 0); | | int score = rpmPlatformScore(platform, NULL, 0); | |
| | | | |
| _free(platform); | | _free(platform); | |
| return score; | | return score; | |
| } | | } | |
| | | | |
| static inline rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char *
pkt, ssize_t pktlen) { | | static inline rpmRC rpmtsImportPubkey(const rpmts ts, const unsigned char *
pkt, ssize_t pktlen) { | |
| return rpmcliImportPubkey(ts, pkt, pktlen); | | return rpmcliImportPubkey(ts, pkt, pktlen); | |
| } | | } | |
| | | | |
|
| | | static inline rpmuint64_t rpmProblemGetLong(rpmProblem prob){ | |
| | | return rpmProblemGetDiskNeed(prob); | |
| | | } | |
| | | | |
| | | static inline off_t fdSize(FD_t fd){ | |
| | | struct stat sb; | |
| | | Fstat(fd, &sb); | |
| | | return sb.st_size; | |
| | | } | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| } | | } | |
| | | | |
| static inline rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * E
VR, int_32 Flags){ | | static inline rpmds rpmdsSingle(rpmTag tagN, const char * N, const char * E
VR, int_32 Flags){ | |
| return rpmdsSingle(tagN, N, EVR, (evrFlags)Flags); | | return rpmdsSingle(tagN, N, EVR, (evrFlags)Flags); | |
| } | | } | |
| #endif | | #endif | |
| | | | |
| #endif /* rpm4compat.h */ | | #endif /* rpm4compat.h */ | |
| | | | |
End of changes. 28 change blocks. |
| 42 lines changed or deleted | | 106 lines changed or added | |
|
| rpmcli.h | | rpmcli.h | |
| #ifndef H_RPMCLI | | #ifndef H_RPMCLI | |
| #define H_RPMCLI | | #define H_RPMCLI | |
| | | | |
| /** \ingroup rpmcli rpmbuild | | /** \ingroup rpmcli rpmbuild | |
| * \file lib/rpmcli.h | | * \file lib/rpmcli.h | |
| */ | | */ | |
| | | | |
|
| #include "popt.h" | | #include <popt.h> | |
| #include "argv.h" | | #include <rpmmacro.h> | |
| #include "rpmcb.h" | | #include <rpmtypes.h> | |
| #include "rpmmacro.h" | | #include <rpmtag.h> | |
| #include "rpmurl.h" | | #include <rpmps.h> | |
| #include "rpmlib.h" | | #include <rpmrc.h> | |
| #include "rpmps.h" | | #include <rpmfi.h> /* XXX rpmfileAttrs */ | |
| #include "rpmte.h" | | #include <rpmts.h> /* XXX rpmdepFlags */ | |
| #include "rpmts.h" | | | |
| | | /** | |
| | | * Table of query format extensions. | |
| | | * @note Chains *headerCompoundFormats -> *headerDefaultFormats. | |
| | | */ | |
| | | /*@-redecl@*/ | |
| | | /*@unchecked@*/ | |
| | | extern headerSprintfExtension rpmHeaderFormats; | |
| | | /*@=redecl@*/ | |
| | | | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| * Should version 3 packages be produced? | | * Should version 3 packages be produced? | |
| */ | | */ | |
| /*@-redecl@*/ | | /*@-redecl@*/ | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
| extern int _noDirTokens; | | extern int _noDirTokens; | |
| /*@=redecl@*/ | | /*@=redecl@*/ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| | | | |
| skipping to change at line 314 | | skipping to change at line 322 | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| * Common query/verify source interface, called once for each CLI arg. | | * Common query/verify source interface, called once for each CLI arg. | |
| * | | * | |
| * This routine uses: | | * This routine uses: | |
| * - qva->qva_mi rpm database iterator | | * - qva->qva_mi rpm database iterator | |
| * - qva->qva_showPackage query/verify display routine | | * - qva->qva_showPackage query/verify display routine | |
| * | | * | |
| * @param qva parsed query/verify options | | * @param qva parsed query/verify options | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param arg name of source to query/verify | | * @param arg name of source to query/verify | |
|
| * @return showPackage() result, 1 if rpmdbInitIterator() is NU
LL | | * @return showPackage() result, 1 if rpmmiInit() is NULL | |
| */ | | */ | |
| int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg) | | int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg) | |
| /*@globals rpmGlobalMacroContext, h_errno, | | /*@globals rpmGlobalMacroContext, h_errno, | |
| fileSystem, internalState @*/ | | fileSystem, internalState @*/ | |
| /*@modifies qva, ts, rpmGlobalMacroContext, | | /*@modifies qva, ts, rpmGlobalMacroContext, | |
| fileSystem, internalState @*/; | | fileSystem, internalState @*/; | |
| | | | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| * Display results of package query. | | * Display results of package query. | |
| * @todo Devise a meaningful return code. | | * @todo Devise a meaningful return code. | |
| | | | |
| skipping to change at line 341 | | skipping to change at line 349 | |
| /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/ | | /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/ | |
| /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState
@*/; | | /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState
@*/; | |
| | | | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| * Iterate over query/verify arg list. | | * Iterate over query/verify arg list. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param qva parsed query/verify options | | * @param qva parsed query/verify options | |
| * @param argv query argument(s) (or NULL) | | * @param argv query argument(s) (or NULL) | |
| * @return 0 on success, else no. of failures | | * @return 0 on success, else no. of failures | |
| */ | | */ | |
|
| int rpmcliArgIter(rpmts ts, QVA_t qva, /*@null@*/ ARGV_t argv) | | int rpmcliArgIter(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) | |
| /*@globals rpmGlobalMacroContext, h_errno, | | /*@globals rpmGlobalMacroContext, h_errno, | |
| fileSystem, internalState @*/ | | fileSystem, internalState @*/ | |
| /*@modifies ts, qva, rpmGlobalMacroContext, | | /*@modifies ts, qva, rpmGlobalMacroContext, | |
| fileSystem, internalState @*/; | | fileSystem, internalState @*/; | |
| | | | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| * Display package information. | | * Display package information. | |
| * @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. U
nion? | | * @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. U
nion? | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param qva parsed query/verify options | | * @param qva parsed query/verify options | |
| | | | |
| skipping to change at line 430 | | skipping to change at line 438 | |
| | | | |
| /*@-redecl@*/ | | /*@-redecl@*/ | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
| extern int rpmcliPackagesTotal; | | extern int rpmcliPackagesTotal; | |
| /*@=redecl@*/ | | /*@=redecl@*/ | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
| extern int rpmcliHashesCurrent; | | extern int rpmcliHashesCurrent; | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
| extern int rpmcliHashesTotal; | | extern int rpmcliHashesTotal; | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
|
| extern uint64_t rpmcliProgressCurrent; | | extern rpmuint64_t rpmcliProgressCurrent; | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
|
| extern uint64_t rpmcliProgressTotal; | | extern rpmuint64_t rpmcliProgressTotal; | |
| | | | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| * The rpm CLI generic transaction callback handler. | | * The rpm CLI generic transaction callback handler. | |
| * @todo Remove headerSprintf() from the progress callback. | | * @todo Remove headerSprintf() from the progress callback. | |
| * @warning This function's args have changed, so the function cannot be | | * @warning This function's args have changed, so the function cannot be | |
| * used portably | | * used portably | |
| * @deprecated Transaction callback arguments need to change, so don't rely
on | | * @deprecated Transaction callback arguments need to change, so don't rely
on | |
| * this routine in the rpmcli API. | | * this routine in the rpmcli API. | |
| * | | * | |
| * @param arg per-callback private data (e.g. an rpm header) | | * @param arg per-callback private data (e.g. an rpm header) | |
| * @param what callback identifier | | * @param what callback identifier | |
| * @param amount per-callback progress info | | * @param amount per-callback progress info | |
| * @param total per-callback progress info | | * @param total per-callback progress info | |
| * @param key opaque header key (e.g. file name or PyObject) | | * @param key opaque header key (e.g. file name or PyObject) | |
| * @param data private data (e.g. rpmInstallInterfaceFlags) | | * @param data private data (e.g. rpmInstallInterfaceFlags) | |
| * @return per-callback data (e.g. an opened FD_t) | | * @return per-callback data (e.g. an opened FD_t) | |
| */ | | */ | |
| /*@null@*/ | | /*@null@*/ | |
| void * rpmShowProgress(/*@null@*/ const void * arg, | | void * rpmShowProgress(/*@null@*/ const void * arg, | |
| const rpmCallbackType what, | | const rpmCallbackType what, | |
|
| const uint64_t amount, | | const rpmuint64_t amount, | |
| const uint64_t total, | | const rpmuint64_t total, | |
| /*@null@*/ fnpyKey key, | | /*@null@*/ fnpyKey key, | |
| /*@null@*/ void * data) | | /*@null@*/ void * data) | |
| /*@globals rpmcliHashesCurrent, | | /*@globals rpmcliHashesCurrent, | |
| rpmcliProgressCurrent, rpmcliProgressTotal, | | rpmcliProgressCurrent, rpmcliProgressTotal, | |
|
| h_errno, fileSystem, internalState @*/ | | h_errno, rpmGlobalMacroContext, fileSystem, internalState @* | |
| /*@modifies rpmcliHashesCurrent, | | / | |
| | | /*@modifies arg, rpmcliHashesCurrent, | |
| rpmcliProgressCurrent, rpmcliProgressTotal, | | rpmcliProgressCurrent, rpmcliProgressTotal, | |
|
| fileSystem, internalState @*/; | | rpmGlobalMacroContext, fileSystem, internalState @*/; | |
| | | | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| * Install source rpm package. | | * Install source rpm package. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param arg source rpm file name | | * @param arg source rpm file name | |
| * @retval *specFilePtr (installed) spec file name | | * @retval *specFilePtr (installed) spec file name | |
| * @retval *cookie | | * @retval *cookie | |
| * @return 0 on success | | * @return 0 on success | |
| */ | | */ | |
| int rpmInstallSource(rpmts ts, const char * arg, | | int rpmInstallSource(rpmts ts, const char * arg, | |
| | | | |
| skipping to change at line 555 | | skipping to change at line 563 | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param ia control args/bits | | * @param ia control args/bits | |
| * @param argv array of package names (NULL terminated) | | * @param argv array of package names (NULL terminated) | |
| * @return 0 on success | | * @return 0 on success | |
| */ | | */ | |
| int rpmErase(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv) | | int rpmErase(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv) | |
| /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/ | | /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/ | |
| /*@modifies ts, ia, rpmGlobalMacroContext, | | /*@modifies ts, ia, rpmGlobalMacroContext, | |
| fileSystem, internalState @*/; | | fileSystem, internalState @*/; | |
| | | | |
|
| /** | | | |
| * A rollback transaction id element. | | | |
| */ | | | |
| /*@-fielduse@*/ | | | |
| typedef /*@abstract@*/ struct IDT_s * IDT; | | | |
| #if !defined(SWIG) | | | |
| struct IDT_s { | | | |
| int done; /*!< package processed? */ | | | |
| unsigned int instance; /*!< installed package transaction id. */ | | | |
| /*@owned@*/ /*@null@*/ | | | |
| const char * key; /*! removed package file name. */ | | | |
| Header h; /*!< removed package header. */ | | | |
| union { | | | |
| uint32_t u32; /*!< install/remove transaction id */ | | | |
| } val; | | | |
| }; | | | |
| #endif | | | |
| /*@=fielduse@*/ | | | |
| | | | |
| /** | | | |
| * A rollback transaction id index. | | | |
| */ | | | |
| typedef /*@abstract@*/ struct IDTindex_s * IDTX; | | | |
| #if !defined(SWIG) | | | |
| struct IDTindex_s { | | | |
| int delta; /*!< no. elements to realloc as a chunk. */ | | | |
| int size; /*!< size of id index element. */ | | | |
| int alloced; /*!< current number of elements allocated. * | | | |
| / | | | |
| int nidt; /*!< current number of elements initialized. | | | |
| */ | | | |
| /*@only@*/ /*@null@*/ | | | |
| IDT idt; /*!< id index elements. */ | | | |
| }; | | | |
| #endif | | | |
| | | | |
| /** | | | |
| * Destroy id index. | | | |
| * @param idtx id index | | | |
| * @return NULL always | | | |
| */ | | | |
| /*@null@*/ | | | |
| IDTX IDTXfree(/*@only@*/ /*@null@*/ IDTX idtx) | | | |
| /*@modifies idtx @*/; | | | |
| | | | |
| /** | | | |
| * Create id index. | | | |
| * @return new id index | | | |
| */ | | | |
| /*@only@*/ | | | |
| IDTX IDTXnew(void) | | | |
| /*@*/; | | | |
| | | | |
| /** | | | |
| * Insure that index has room for "need" elements. | | | |
| * @param idtx id index | | | |
| * @param need additional no. of elements needed | | | |
| * @return id index (with room for "need" elements) | | | |
| */ | | | |
| /*@only@*/ /*@null@*/ | | | |
| IDTX IDTXgrow(/*@only@*/ /*@null@*/ IDTX idtx, int need) | | | |
| /*@modifies idtx @*/; | | | |
| | | | |
| /** | | | |
| * Sort tag (instance,value) pairs. | | | |
| * @param idtx id index | | | |
| * @return id index | | | |
| */ | | | |
| /*@only@*/ /*@null@*/ | | | |
| IDTX IDTXsort(/*@only@*/ /*@null@*/ IDTX idtx) | | | |
| /*@modifies idtx @*/; | | | |
| | | | |
| /** | | | |
| * Load tag (instance,value) pairs from rpm databse, and return sorted id i | | | |
| ndex. | | | |
| * @param ts transaction set | | | |
| * @param tag rpm tag | | | |
| * @param rbtid rollback goal | | | |
| * @return id index | | | |
| */ | | | |
| /*@only@*/ /*@null@*/ | | | |
| IDTX IDTXload(rpmts ts, rpmTag tag, uint32_t rbtid) | | | |
| /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState | | | |
| @*/ | | | |
| /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @* | | | |
| /; | | | |
| | | | |
| /** | | | |
| * Load tag (instance,value) pairs from packages, and return sorted id inde | | | |
| x. | | | |
| * @param ts transaction set | | | |
| * @param globstr glob expression | | | |
| * @param tag rpm tag | | | |
| * @param rbtid rollback goal | | | |
| * @return id index | | | |
| */ | | | |
| /*@only@*/ /*@null@*/ | | | |
| IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag, uint32_t rbtid) | | | |
| /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState | | | |
| @*/ | | | |
| /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ | | | |
| ; | | | |
| | | | |
| /** \ingroup rpmcli | | | |
| * Rollback transactions, erasing new, reinstalling old, package(s). | | | |
| * @param ts transaction set | | | |
| * @param ia mode flags and parameters | | | |
| * @param argv array of arguments (NULL terminated) | | | |
| * @return 0 on success | | | |
| */ | | | |
| int rpmRollback(rpmts ts, QVA_t ia, /*@null@*/ const char ** argv) | | | |
| /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno, | | | |
| fileSystem, internalState @*/ | | | |
| /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext, | | | |
| fileSystem, internalState @*/; | | | |
| | | | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| */ | | */ | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
| extern struct poptOption rpmInstallPoptTable[]; | | extern struct poptOption rpmInstallPoptTable[]; | |
| | | | |
| /*@}*/ | | /*@}*/ | |
| /* ==================================================================== */ | | /* ==================================================================== */ | |
| /** \name RPMDB */ | | /** \name RPMDB */ | |
| /*@{*/ | | /*@{*/ | |
| | | | |
| | | | |
| skipping to change at line 744 | | skipping to change at line 644 | |
| /** \ingroup rpmcli | | /** \ingroup rpmcli | |
| * Command line option information. | | * Command line option information. | |
| */ | | */ | |
| #if !defined(SWIG) | | #if !defined(SWIG) | |
| struct rpmQVKArguments_s { | | struct rpmQVKArguments_s { | |
| rpmQVSources qva_source; /*!< Identify CLI arg type. */ | | rpmQVSources qva_source; /*!< Identify CLI arg type. */ | |
| int qva_sourceCount;/*!< Exclusive option check (>1 is error). *
/ | | int qva_sourceCount;/*!< Exclusive option check (>1 is error). *
/ | |
| rpmQueryFlags qva_flags; /*!< Bit(s) to control operation. */ | | rpmQueryFlags qva_flags; /*!< Bit(s) to control operation. */ | |
| rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */ | | rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */ | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
|
| rpmdbMatchIterator qva_mi; /*!< Match iterator on selected headers. */ | | rpmmi qva_mi; /*!< Match iterator on selected headers. */ | |
| /*@refccounted@*/ /*@relnull@*/ | | /*@refccounted@*/ /*@relnull@*/ | |
| rpmgi qva_gi; /*!< Generalized iterator on args. */ | | rpmgi qva_gi; /*!< Generalized iterator on args. */ | |
| rpmRC qva_rc; /*!< Current return code. */ | | rpmRC qva_rc; /*!< Current return code. */ | |
| | | | |
| /*@null@*/ | | /*@null@*/ | |
| QVF_t qva_showPackage; /*!< Function to display iterator matches. *
/ | | QVF_t qva_showPackage; /*!< Function to display iterator matches. *
/ | |
| int qva_showOK; /*!< No. of successes. */ | | int qva_showOK; /*!< No. of successes. */ | |
| int qva_showFAIL; /*!< No. of failures. */ | | int qva_showFAIL; /*!< No. of failures. */ | |
| /*@null@*/ | | /*@null@*/ | |
| QSpecF_t qva_specQuery; /*!< Function to query spec file. */ | | QSpecF_t qva_specQuery; /*!< Function to query spec file. */ | |
| | | | |
| skipping to change at line 782 | | skipping to change at line 682 | |
| - 'K' from --checksig, -K | | - 'K' from --checksig, -K | |
| - 'R' from --resign | | - 'R' from --resign | |
| */ | | */ | |
| char qva_char; /*!< (unused) always ' ' */ | | char qva_char; /*!< (unused) always ' ' */ | |
| | | | |
| /* install/erase mode arguments */ | | /* install/erase mode arguments */ | |
| rpmdepFlags depFlags; | | rpmdepFlags depFlags; | |
| rpmtransFlags transFlags; | | rpmtransFlags transFlags; | |
| rpmprobFilterFlags probFilter; | | rpmprobFilterFlags probFilter; | |
| rpmInstallInterfaceFlags installInterfaceFlags; | | rpmInstallInterfaceFlags installInterfaceFlags; | |
|
| uint32_t arbtid; /*!< from --arbgoal */ | | rpmuint32_t arbtid; /*!< from --arbgoal */ | |
| uint32_t rbtid; /*!< from --rollback */ | | rpmuint32_t rbtid; /*!< from --rollback */ | |
| uint32_t *rbtidExcludes; /*!< from --rollback */ | | rpmuint32_t *rbtidExcludes; /*!< from --rollback */ | |
| int numrbtidExcludes; /*!< from --rollback */ | | int numrbtidExcludes; /*!< from --rollback */ | |
| int noDeps; | | int noDeps; | |
| int incldocs; | | int incldocs; | |
| int no_rollback_links; | | int no_rollback_links; | |
| /*@owned@*/ /*@relnull@*/ | | /*@owned@*/ /*@relnull@*/ | |
| rpmRelocation relocations; | | rpmRelocation relocations; | |
| int nrelocations; | | int nrelocations; | |
| | | | |
| /* database mode arguments */ | | /* database mode arguments */ | |
| int init; /*!< from --initdb */ | | int init; /*!< from --initdb */ | |
| | | | |
End of changes. 11 change blocks. |
| 138 lines changed or deleted | | 31 lines changed or added | |
|
| rpmpgp.h | | rpmpgp.h | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| #if defined(_RPMPGP_INTERNAL) | | #if defined(_RPMPGP_INTERNAL) | |
| #include <rpmsw.h> | | #include <rpmsw.h> | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Values parsed from OpenPGP signature/pubkey packet(s). | | * Values parsed from OpenPGP signature/pubkey packet(s). | |
| */ | | */ | |
| struct pgpDigParams_s { | | struct pgpDigParams_s { | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
| const char * userid; | | const char * userid; | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
|
| const uint8_t * hash; | | const rpmuint8_t * hash; | |
| const char * params[4]; | | const char * params[4]; | |
|
| uint8_t tag; | | rpmuint8_t tag; | |
| | | | |
|
| uint8_t version; /*!< version number. */ | | rpmuint8_t version; /*!< version number. */ | |
| uint8_t time[4]; /*!< time that the key was created. */ | | rpmuint8_t time[4]; /*!< time that the key was created. | |
| uint8_t pubkey_algo; /*!< public key algorithm. */ | | */ | |
| | | rpmuint8_t pubkey_algo; /*!< public key algorithm. */ | |
| | | | |
|
| uint8_t hash_algo; | | rpmuint8_t hash_algo; | |
| uint8_t sigtype; | | rpmuint8_t sigtype; | |
| size_t hashlen; | | size_t hashlen; | |
|
| uint8_t signhash16[2]; | | rpmuint8_t signhash16[2]; | |
| uint8_t signid[8]; | | rpmuint8_t signid[8]; | |
| uint8_t saved; | | rpmuint8_t saved; | |
| #define PGPDIG_SAVED_TIME (1 << 0) | | #define PGPDIG_SAVED_TIME (1 << 0) | |
| #define PGPDIG_SAVED_ID (1 << 1) | | #define PGPDIG_SAVED_ID (1 << 1) | |
| | | | |
| }; | | }; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Container for values parsed from an OpenPGP signature and public key. | | * Container for values parsed from an OpenPGP signature and public key. | |
| */ | | */ | |
| struct pgpDig_s { | | struct pgpDig_s { | |
| struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ | | struct rpmioItem_s _item; /*!< usage mutex and pool identifier. */ | |
| struct pgpDigParams_s signature; | | struct pgpDigParams_s signature; | |
| struct pgpDigParams_s pubkey; | | struct pgpDigParams_s pubkey; | |
| | | | |
|
| uint32_t sigtag; /*!< Package signature tag. */ | | rpmuint32_t sigtag; /*!< Package signature tag. */ | |
| uint32_t sigtype; /*!< Package signature data type. */ | | rpmuint32_t sigtype; /*!< Package signature data type. */ | |
| /*@relnull@*/ | | /*@relnull@*/ | |
| const void * sig; /*!< Package signature. */ | | const void * sig; /*!< Package signature. */ | |
|
| uint32_t siglen; /*!< Package signature length. */ | | rpmuint32_t siglen; /*!< Package signature length. */ | |
| | | | |
| pgpVSFlags vsflags; /*!< Digest/signature operation disa
blers. */ | | pgpVSFlags vsflags; /*!< Digest/signature operation disa
blers. */ | |
| struct rpmop_s dops; /*!< Digest operation statistics. */ | | struct rpmop_s dops; /*!< Digest operation statistics. */ | |
| struct rpmop_s sops; /*!< Signature operation statistics. */ | | struct rpmop_s sops; /*!< Signature operation statistics. */ | |
| | | | |
| int (*findPubkey) (void * _ts, /*@null@*/ void * _dig) | | int (*findPubkey) (void * _ts, /*@null@*/ void * _dig) | |
| /*@modifies *_ts, *_dig @*/;/*!< Find pubkey, i.e. rpmtsFindPubkey()
. */ | | /*@modifies *_ts, *_dig @*/;/*!< Find pubkey, i.e. rpmtsFindPubkey()
. */ | |
| /*@null@*/ | | /*@null@*/ | |
| void * _ts; /*!< Find pubkey argument, i.e. rpmt
s. */ | | void * _ts; /*!< Find pubkey argument, i.e. rpmt
s. */ | |
| | | | |
|
| uint8_t ** ppkts; | | rpmuint8_t ** ppkts; | |
| int npkts; | | int npkts; | |
| size_t nbytes; /*!< No. bytes of plain text. */ | | size_t nbytes; /*!< No. bytes of plain text. */ | |
| | | | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
| DIGEST_CTX sha1ctx; /*!< (dsa) sha1 hash context. */ | | DIGEST_CTX sha1ctx; /*!< (dsa) sha1 hash context. */ | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
| DIGEST_CTX hdrsha1ctx; /*!< (dsa) header sha1 hash context. */ | | DIGEST_CTX hdrsha1ctx; /*!< (dsa) header sha1 hash context. */ | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
| void * sha1; /*!< (dsa) V3 signature hash. */ | | void * sha1; /*!< (dsa) V3 signature hash. */ | |
| size_t sha1len; /*!< (dsa) V3 signature hash length. */ | | size_t sha1len; /*!< (dsa) V3 signature hash length. */ | |
| | | | |
| skipping to change at line 179 | | skipping to change at line 179 | |
| * dependent on the public key algorithm used. | | * dependent on the public key algorithm used. | |
| * | | * | |
| * Algorithm Specific Fields for RSA encryption | | * Algorithm Specific Fields for RSA encryption | |
| * - multiprecision integer (MPI) of RSA encrypted value m**e mod n. | | * - multiprecision integer (MPI) of RSA encrypted value m**e mod n. | |
| * | | * | |
| * Algorithm Specific Fields for Elgamal encryption: | | * Algorithm Specific Fields for Elgamal encryption: | |
| * - MPI of Elgamal (Diffie-Hellman) value g**k mod p. | | * - MPI of Elgamal (Diffie-Hellman) value g**k mod p. | |
| * - MPI of Elgamal (Diffie-Hellman) value m * y**k mod p. | | * - MPI of Elgamal (Diffie-Hellman) value m * y**k mod p. | |
| */ | | */ | |
| typedef struct pgpPktPubkey_s { | | typedef struct pgpPktPubkey_s { | |
|
| uint8_t version; /*!< version number (generate 3, accept 2). | | rpmuint8_t version; /*!< version number (generate 3, acc | |
| */ | | ept 2). */ | |
| uint8_t keyid[8]; /*!< key ID of the public key for session. */ | | rpmuint8_t keyid[8]; /*!< key ID of the public key for session. * | |
| uint8_t algo; /*!< public key algorithm used. */ | | / | |
| | | rpmuint8_t algo; /*!< public key algorithm used. */ | |
| } pgpPktPubkey; | | } pgpPktPubkey; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.2.1. Signature Types | | * 5.2.1. Signature Types | |
| * | | * | |
| * There are a number of possible meanings for a signature, which are | | * There are a number of possible meanings for a signature, which are | |
| * specified in a signature type octet in any given signature. | | * specified in a signature type octet in any given signature. | |
| */ | | */ | |
| /*@-typeuse@*/ | | /*@-typeuse@*/ | |
| typedef enum pgpSigType_e { | | typedef enum pgpSigType_e { | |
| | | | |
| skipping to change at line 339 | | skipping to change at line 339 | |
| } pgpCompressAlgo; | | } pgpCompressAlgo; | |
| /*@=typeuse@*/ | | /*@=typeuse@*/ | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Compression (string, value) pairs. | | * Compression (string, value) pairs. | |
| */ | | */ | |
| /*@observer@*/ /*@unchecked@*/ /*@unused@*/ | | /*@observer@*/ /*@unchecked@*/ /*@unused@*/ | |
| extern struct pgpValTbl_s pgpCompressionTbl[]; | | extern struct pgpValTbl_s pgpCompressionTbl[]; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
|
| * 9.4. Hash Algorithms | | | |
| * | | | |
| \verbatim | | | |
| ID Algorithm Text Name | | | |
| -- --------- ---- ---- | | | |
| 1 - MD5 "MD5" | | | |
| 2 - SHA-1 "SHA1" | | | |
| 3 - RIPE-MD/160 "RIPEMD160" | | | |
| 4 - Reserved for double-width SHA (experimental) | | | |
| 5 - MD2 "MD2" | | | |
| 6 - Reserved for TIGER/192 "TIGER192" | | | |
| 7 - Reserved for HAVAL (5 pass, 160-bit) "HAVAL-5-160" | | | |
| 100 to 110 - Private/Experimental algorithm. | | | |
| \endverbatim | | | |
| * | | | |
| * Implementations MUST implement SHA-1. Implementations SHOULD | | | |
| * implement MD5. | | | |
| * @todo Add SHA256. | | | |
| */ | | | |
| typedef enum pgpHashAlgo_e { | | | |
| PGPHASHALGO_ERROR = -1, | | | |
| PGPHASHALGO_NONE = 0, | | | |
| PGPHASHALGO_MD5 = 1, /*!< MD5 */ | | | |
| PGPHASHALGO_SHA1 = 2, /*!< SHA-1 */ | | | |
| PGPHASHALGO_RIPEMD160 = 3, /*!< RIPEMD-160 */ | | | |
| PGPHASHALGO_MD2 = 5, /*!< MD2 */ | | | |
| PGPHASHALGO_TIGER192 = 6, /*!< TIGER-192 */ | | | |
| PGPHASHALGO_HAVAL_5_160 = 7, /*!< HAVAL-5-160 */ | | | |
| PGPHASHALGO_SHA256 = 8, /*!< SHA-256 */ | | | |
| PGPHASHALGO_SHA384 = 9, /*!< SHA-384 */ | | | |
| PGPHASHALGO_SHA512 = 10, /*!< SHA-512 */ | | | |
| PGPHASHALGO_SHA224 = 11, /*!< SHA-224 */ | | | |
| | | | |
| PGPHASHALGO_MD4 = 104, /*!< (private) MD4 */ | | | |
| PGPHASHALGO_RIPEMD128 = 105, /*!< (private) RIPEMD-128 */ | | | |
| PGPHASHALGO_CRC32 = 106, /*!< (private) CRC-32 */ | | | |
| PGPHASHALGO_ADLER32 = 107, /*!< (private) ADLER-32 */ | | | |
| PGPHASHALGO_CRC64 = 108, /*!< (private) CRC-64 */ | | | |
| PGPHASHALGO_JLU32 = 109, /*!< (private) Jenkins lookup3.c */ | | | |
| | | | |
| PGPHASHALGO_RIPEMD256 = 111, /*!< (private) RIPEMD-256 */ | | | |
| PGPHASHALGO_RIPEMD320 = 112, /*!< (private) RIPEMD-320 */ | | | |
| PGPHASHALGO_SALSA10 = 113, /*!< (private) SALSA-10 */ | | | |
| PGPHASHALGO_SALSA20 = 114, /*!< (private) SALSA-20 */ | | | |
| | | | |
| } pgpHashAlgo; | | | |
| | | | |
| /** \ingroup rpmpgp | | | |
| * Hash (string, value) pairs. | | * Hash (string, value) pairs. | |
| */ | | */ | |
| /*@observer@*/ /*@unchecked@*/ /*@unused@*/ | | /*@observer@*/ /*@unchecked@*/ /*@unused@*/ | |
| extern struct pgpValTbl_s pgpHashTbl[]; | | extern struct pgpValTbl_s pgpHashTbl[]; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.2.2. Version 3 Signature Packet Format | | * 5.2.2. Version 3 Signature Packet Format | |
| * | | * | |
| * The body of a version 3 Signature Packet contains: | | * The body of a version 3 Signature Packet contains: | |
| * - One-octet version number (3). | | * - One-octet version number (3). | |
| | | | |
| skipping to change at line 414 | | skipping to change at line 366 | |
| * - One or more multi-precision integers comprising the signature. | | * - One or more multi-precision integers comprising the signature. | |
| * | | * | |
| * Algorithm Specific Fields for RSA signatures: | | * Algorithm Specific Fields for RSA signatures: | |
| * - multiprecision integer (MPI) of RSA signature value m**d. | | * - multiprecision integer (MPI) of RSA signature value m**d. | |
| * | | * | |
| * Algorithm Specific Fields for DSA signatures: | | * Algorithm Specific Fields for DSA signatures: | |
| * - MPI of DSA value r. | | * - MPI of DSA value r. | |
| * - MPI of DSA value s. | | * - MPI of DSA value s. | |
| */ | | */ | |
| typedef struct pgpPktSigV3_s { | | typedef struct pgpPktSigV3_s { | |
|
| uint8_t version; /*!< version number (3). */ | | rpmuint8_t version; /*!< version number (3). */ | |
| uint8_t hashlen; /*!< length of following hashed material. MUST be 5. | | rpmuint8_t hashlen; /*!< length of following hashed material. MU | |
| */ | | ST be 5. */ | |
| uint8_t sigtype; /*!< signature type. */ | | rpmuint8_t sigtype; /*!< signature type. */ | |
| uint8_t time[4]; /*!< 4 byte creation time. */ | | rpmuint8_t time[4]; /*!< 4 byte creation time. */ | |
| uint8_t signid[8]; /*!< key ID of signer. */ | | rpmuint8_t signid[8]; /*!< key ID of signer. */ | |
| uint8_t pubkey_algo; /*!< public key algorithm. */ | | rpmuint8_t pubkey_algo; /*!< public key algorithm. */ | |
| uint8_t hash_algo; /*!< hash algorithm. */ | | rpmuint8_t hash_algo; /*!< hash algorithm. */ | |
| uint8_t signhash16[2]; /*!< left 16 bits of signed hash value. */ | | rpmuint8_t signhash16[2]; /*!< left 16 bits of signed hash value. */ | |
| } * pgpPktSigV3; | | } * pgpPktSigV3; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.2.3. Version 4 Signature Packet Format | | * 5.2.3. Version 4 Signature Packet Format | |
| * | | * | |
| * The body of a version 4 Signature Packet contains: | | * The body of a version 4 Signature Packet contains: | |
| * - One-octet version number (4). | | * - One-octet version number (4). | |
| * - One-octet signature type. | | * - One-octet signature type. | |
| * - One-octet public key algorithm. | | * - One-octet public key algorithm. | |
| * - One-octet hash algorithm. | | * - One-octet hash algorithm. | |
| | | | |
| skipping to change at line 446 | | skipping to change at line 398 | |
| * - Hashed subpacket data. (zero or more subpackets) | | * - Hashed subpacket data. (zero or more subpackets) | |
| * - Two-octet scalar octet count for following unhashed subpacket | | * - Two-octet scalar octet count for following unhashed subpacket | |
| * data. Note that this is the length in octets of all of the | | * data. Note that this is the length in octets of all of the | |
| * unhashed subpackets; a pointer incremented by this number will | | * unhashed subpackets; a pointer incremented by this number will | |
| * skip over the unhashed subpackets. | | * skip over the unhashed subpackets. | |
| * - Unhashed subpacket data. (zero or more subpackets) | | * - Unhashed subpacket data. (zero or more subpackets) | |
| * - Two-octet field holding left 16 bits of signed hash value. | | * - Two-octet field holding left 16 bits of signed hash value. | |
| * - One or more multi-precision integers comprising the signature. | | * - One or more multi-precision integers comprising the signature. | |
| */ | | */ | |
| typedef struct pgpPktSigV4_s { | | typedef struct pgpPktSigV4_s { | |
|
| uint8_t version; /*!< version number (4). */ | | rpmuint8_t version; /*!< version number (4). */ | |
| uint8_t sigtype; /*!< signature type. */ | | rpmuint8_t sigtype; /*!< signature type. */ | |
| uint8_t pubkey_algo; /*!< public key algorithm. */ | | rpmuint8_t pubkey_algo; /*!< public key algorithm. */ | |
| uint8_t hash_algo; /*!< hash algorithm. */ | | rpmuint8_t hash_algo; /*!< hash algorithm. */ | |
| uint8_t hashlen[2]; /*!< length of following hashed material. */ | | rpmuint8_t hashlen[2]; /*!< length of following hashed material. */ | |
| } * pgpPktSigV4; | | } * pgpPktSigV4; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.2.3.1. Signature Subpacket Specification | | * 5.2.3.1. Signature Subpacket Specification | |
| * | | * | |
| * The subpacket fields consist of zero or more signature subpackets. | | * The subpacket fields consist of zero or more signature subpackets. | |
| * Each set of subpackets is preceded by a two-octet scalar count of the | | * Each set of subpackets is preceded by a two-octet scalar count of the | |
| * length of the set of subpackets. | | * length of the set of subpackets. | |
| * | | * | |
| * Each subpacket consists of a subpacket header and a body. The header | | * Each subpacket consists of a subpacket header and a body. The header | |
| | | | |
| skipping to change at line 635 | | skipping to change at line 587 | |
| * The body of this packet consists of: | | * The body of this packet consists of: | |
| * - A one-octet version number. The only currently defined version | | * - A one-octet version number. The only currently defined version | |
| * is 4. | | * is 4. | |
| * - A one-octet number describing the symmetric algorithm used. | | * - A one-octet number describing the symmetric algorithm used. | |
| * - A string-to-key (S2K) specifier, length as defined above. | | * - A string-to-key (S2K) specifier, length as defined above. | |
| * - Optionally, the encrypted session key itself, which is decrypted | | * - Optionally, the encrypted session key itself, which is decrypted | |
| * with the string-to-key object. | | * with the string-to-key object. | |
| * | | * | |
| */ | | */ | |
| typedef struct pgpPktSymkey_s { | | typedef struct pgpPktSymkey_s { | |
|
| uint8_t version; /*!< version number (4). */ | | rpmuint8_t version; /*!< version number (4). */ | |
| uint8_t symkey_algo; | | rpmuint8_t symkey_algo; | |
| uint8_t s2k[1]; | | rpmuint8_t s2k[1]; | |
| } pgpPktSymkey; | | } pgpPktSymkey; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.4. One-Pass Signature Packets (Tag 4) | | * 5.4. One-Pass Signature Packets (Tag 4) | |
| * | | * | |
| * The One-Pass Signature packet precedes the signed data and contains | | * The One-Pass Signature packet precedes the signed data and contains | |
| * enough information to allow the receiver to begin calculating any | | * enough information to allow the receiver to begin calculating any | |
| * hashes needed to verify the signature. It allows the Signature | | * hashes needed to verify the signature. It allows the Signature | |
| * Packet to be placed at the end of the message, so that the signer can | | * Packet to be placed at the end of the message, so that the signer can | |
| * compute the entire signed message in one pass. | | * compute the entire signed message in one pass. | |
| | | | |
| skipping to change at line 670 | | skipping to change at line 622 | |
| * another One-Pass Signature packet that describes another | | * another One-Pass Signature packet that describes another | |
| * signature to be applied to the same message data. | | * signature to be applied to the same message data. | |
| * | | * | |
| * Note that if a message contains more than one one-pass signature, | | * Note that if a message contains more than one one-pass signature, | |
| * then the signature packets bracket the message; that is, the first | | * then the signature packets bracket the message; that is, the first | |
| * signature packet after the message corresponds to the last one-pass | | * signature packet after the message corresponds to the last one-pass | |
| * packet and the final signature packet corresponds to the first one- | | * packet and the final signature packet corresponds to the first one- | |
| * pass packet. | | * pass packet. | |
| */ | | */ | |
| typedef struct pgpPktOnepass_s { | | typedef struct pgpPktOnepass_s { | |
|
| uint8_t version; /*!< version number (3). */ | | rpmuint8_t version; /*!< version number (3). */ | |
| uint8_t sigtype; /*!< signature type. */ | | rpmuint8_t sigtype; /*!< signature type. */ | |
| uint8_t hash_algo; /*!< hash algorithm. */ | | rpmuint8_t hash_algo; /*!< hash algorithm. */ | |
| uint8_t pubkey_algo; /*!< public key algorithm. */ | | rpmuint8_t pubkey_algo; /*!< public key algorithm. */ | |
| uint8_t signid[8]; /*!< key ID of signer. */ | | rpmuint8_t signid[8]; /*!< key ID of signer. */ | |
| uint8_t nested; | | rpmuint8_t nested; | |
| } * pgpPktOnepass; | | } * pgpPktOnepass; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.5.1. Key Packet Variants | | * 5.5.1. Key Packet Variants | |
| * | | * | |
| * 5.5.1.1. Public Key Packet (Tag 6) | | * 5.5.1.1. Public Key Packet (Tag 6) | |
| * | | * | |
| * A Public Key packet starts a series of packets that forms an OpenPGP | | * A Public Key packet starts a series of packets that forms an OpenPGP | |
| * key (sometimes called an OpenPGP certificate). | | * key (sometimes called an OpenPGP certificate). | |
| * | | * | |
| | | | |
| skipping to change at line 751 | | skipping to change at line 703 | |
| * V3 key that has the same key ID as any other key because the key ID | | * V3 key that has the same key ID as any other key because the key ID | |
| * is simply the low 64 bits of the public modulus. Secondly, because | | * is simply the low 64 bits of the public modulus. Secondly, because | |
| * the fingerprint of a V3 key hashes the key material, but not its | | * the fingerprint of a V3 key hashes the key material, but not its | |
| * length, which increases the opportunity for fingerprint collisions. | | * length, which increases the opportunity for fingerprint collisions. | |
| * Third, there are minor weaknesses in the MD5 hash algorithm that make | | * Third, there are minor weaknesses in the MD5 hash algorithm that make | |
| * developers prefer other algorithms. See below for a fuller discussion | | * developers prefer other algorithms. See below for a fuller discussion | |
| * of key IDs and fingerprints. | | * of key IDs and fingerprints. | |
| * | | * | |
| */ | | */ | |
| typedef struct pgpPktKeyV3_s { | | typedef struct pgpPktKeyV3_s { | |
|
| uint8_t version; /*!< version number (3). */ | | rpmuint8_t version; /*!< version number (3). */ | |
| uint8_t time[4]; /*!< time that the key was created. */ | | rpmuint8_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. */ | | rpmuint8_t valid[2]; /*!< time in days that this key is valid. */ | |
| | | rpmuint8_t pubkey_algo; /*!< public key algorithm. */ | |
| } * pgpPktKeyV3; | | } * pgpPktKeyV3; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * The version 4 format is similar to the version 3 format except for | | * The version 4 format is similar to the version 3 format except for | |
| * the absence of a validity period. This has been moved to the | | * the absence of a validity period. This has been moved to the | |
| * signature packet. In addition, fingerprints of version 4 keys are | | * signature packet. In addition, fingerprints of version 4 keys are | |
| * calculated differently from version 3 keys, as described in section | | * calculated differently from version 3 keys, as described in section | |
| * "Enhanced Key Formats." | | * "Enhanced Key Formats." | |
| * | | * | |
| * A version 4 packet contains: | | * A version 4 packet contains: | |
| | | | |
| skipping to change at line 789 | | skipping to change at line 741 | |
| * - MPI of DSA public key value y (= g**x where x is secret). | | * - MPI of DSA public key value y (= g**x where x is secret). | |
| * | | * | |
| * Algorithm Specific Fields for Elgamal public keys: | | * Algorithm Specific Fields for Elgamal public keys: | |
| * - MPI of Elgamal prime p; | | * - MPI of Elgamal prime p; | |
| * - MPI of Elgamal group generator g; | | * - MPI of Elgamal group generator g; | |
| * - MPI of Elgamal public key value y (= g**x where x is | | * - MPI of Elgamal public key value y (= g**x where x is | |
| * secret). | | * secret). | |
| * | | * | |
| */ | | */ | |
| typedef struct pgpPktKeyV4_s { | | typedef struct pgpPktKeyV4_s { | |
|
| uint8_t version; /*!< version number (4). */ | | rpmuint8_t version; /*!< version number (4). */ | |
| uint8_t time[4]; /*!< time that the key was created. */ | | rpmuint8_t time[4]; /*!< time that the key was created. | |
| uint8_t pubkey_algo; /*!< public key algorithm. */ | | */ | |
| | | rpmuint8_t pubkey_algo; /*!< public key algorithm. */ | |
| } * pgpPktKeyV4; | | } * pgpPktKeyV4; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.5.3. Secret Key Packet Formats | | * 5.5.3. Secret Key Packet Formats | |
| * | | * | |
| * The Secret Key and Secret Subkey packets contain all the data of the | | * The Secret Key and Secret Subkey packets contain all the data of the | |
| * Public Key and Public Subkey packets, with additional algorithm- | | * Public Key and Public Subkey packets, with additional algorithm- | |
| * specific secret key data appended, in encrypted form. | | * specific secret key data appended, in encrypted form. | |
| * | | * | |
| * The packet contains: | | * The packet contains: | |
| | | | |
| skipping to change at line 888 | | skipping to change at line 840 | |
| * | | * | |
| * ZIP-compressed packets are compressed with raw RFC 1951 DEFLATE | | * ZIP-compressed packets are compressed with raw RFC 1951 DEFLATE | |
| * blocks. Note that PGP V2.6 uses 13 bits of compression. If an | | * blocks. Note that PGP V2.6 uses 13 bits of compression. If an | |
| * implementation uses more bits of compression, PGP V2.6 cannot | | * implementation uses more bits of compression, PGP V2.6 cannot | |
| * decompress it. | | * decompress it. | |
| * | | * | |
| * ZLIB-compressed packets are compressed with RFC 1950 ZLIB-style | | * ZLIB-compressed packets are compressed with RFC 1950 ZLIB-style | |
| * blocks. | | * blocks. | |
| */ | | */ | |
| typedef struct pgpPktCdata_s { | | typedef struct pgpPktCdata_s { | |
|
| uint8_t compressalgo; | | rpmuint8_t compressalgo; | |
| uint8_t data[1]; | | rpmuint8_t data[1]; | |
| } pgpPktCdata; | | } pgpPktCdata; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.7. Symmetrically Encrypted Data Packet (Tag 9) | | * 5.7. Symmetrically Encrypted Data Packet (Tag 9) | |
| * | | * | |
| * The Symmetrically Encrypted Data packet contains data encrypted with | | * The Symmetrically Encrypted Data packet contains data encrypted with | |
| * a symmetric-key algorithm. When it has been decrypted, it will | | * a symmetric-key algorithm. When it has been decrypted, it will | |
| * typically contain other packets (often literal data packets or | | * typically contain other packets (often literal data packets or | |
| * compressed data packets). | | * compressed data packets). | |
| * | | * | |
| | | | |
| skipping to change at line 927 | | skipping to change at line 879 | |
| * respectively. After encrypting the first 10 octets, the CFB state is | | * respectively. After encrypting the first 10 octets, the CFB state is | |
| * resynchronized if the cipher block size is 8 octets or less. The | | * resynchronized if the cipher block size is 8 octets or less. The | |
| * last 8 octets of ciphertext are passed through the cipher and the | | * last 8 octets of ciphertext are passed through the cipher and the | |
| * block boundary is reset. | | * block boundary is reset. | |
| * | | * | |
| * The repetition of 16 bits in the 80 bits of random data prefixed to | | * The repetition of 16 bits in the 80 bits of random data prefixed to | |
| * the message allows the receiver to immediately check whether the | | * the message allows the receiver to immediately check whether the | |
| * session key is incorrect. | | * session key is incorrect. | |
| */ | | */ | |
| typedef struct pgpPktEdata_s { | | typedef struct pgpPktEdata_s { | |
|
| uint8_t data[1]; | | rpmuint8_t data[1]; | |
| } pgpPktEdata; | | } pgpPktEdata; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.8. Marker Packet (Obsolete Literal Packet) (Tag 10) | | * 5.8. Marker Packet (Obsolete Literal Packet) (Tag 10) | |
| * | | * | |
| * An experimental version of PGP used this packet as the Literal | | * An experimental version of PGP used this packet as the Literal | |
| * packet, but no released version of PGP generated Literal packets with | | * packet, but no released version of PGP generated Literal packets with | |
| * this tag. With PGP 5.x, this packet has been re-assigned and is | | * this tag. With PGP 5.x, this packet has been re-assigned and is | |
| * reserved for use as the Marker packet. | | * reserved for use as the Marker packet. | |
| * | | * | |
| | | | |
| skipping to change at line 978 | | skipping to change at line 930 | |
| * - A four-octet number that indicates the modification date of the | | * - A four-octet number that indicates the modification date of the | |
| * file, or the creation time of the packet, or a zero that | | * file, or the creation time of the packet, or a zero that | |
| * indicates the present time. | | * indicates the present time. | |
| * - The remainder of the packet is literal data. | | * - The remainder of the packet is literal data. | |
| * | | * | |
| * Text data is stored with <CR><LF> text endings (i.e. network-normal | | * Text data is stored with <CR><LF> text endings (i.e. network-normal | |
| * line endings). These should be converted to native line endings by | | * line endings). These should be converted to native line endings by | |
| * the receiving software. | | * the receiving software. | |
| */ | | */ | |
| typedef struct pgpPktLdata_s { | | typedef struct pgpPktLdata_s { | |
|
| uint8_t format; | | rpmuint8_t format; | |
| uint8_t filenamelen; | | rpmuint8_t filenamelen; | |
| uint8_t filename[1]; | | rpmuint8_t filename[1]; | |
| } pgpPktLdata; | | } pgpPktLdata; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.10. Trust Packet (Tag 12) | | * 5.10. Trust Packet (Tag 12) | |
| * | | * | |
| * The Trust packet is used only within keyrings and is not normally | | * The Trust packet is used only within keyrings and is not normally | |
| * exported. Trust packets contain data that record the user's | | * exported. Trust packets contain data that record the user's | |
| * specifications of which key holders are trustworthy introducers, | | * specifications of which key holders are trustworthy introducers, | |
| * along with other information that implementing software uses for | | * along with other information that implementing software uses for | |
| * trust information. | | * trust information. | |
| * | | * | |
| * Trust packets SHOULD NOT be emitted to output streams that are | | * Trust packets SHOULD NOT be emitted to output streams that are | |
| * transferred to other users, and they SHOULD be ignored on any input | | * transferred to other users, and they SHOULD be ignored on any input | |
| * other than local keyring files. | | * other than local keyring files. | |
| */ | | */ | |
| typedef struct pgpPktTrust_s { | | typedef struct pgpPktTrust_s { | |
|
| uint8_t flag; | | rpmuint8_t flag; | |
| } pgpPktTrust; | | } pgpPktTrust; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * 5.11. User ID Packet (Tag 13) | | * 5.11. User ID Packet (Tag 13) | |
| * | | * | |
| * A User ID packet consists of data that is intended to represent the | | * A User ID packet consists of data that is intended to represent the | |
| * name and email address of the key holder. By convention, it includes | | * name and email address of the key holder. By convention, it includes | |
| * an RFC 822 mail name, but there are no restrictions on its content. | | * an RFC 822 mail name, but there are no restrictions on its content. | |
| * The packet length in the header specifies the length of the user id. | | * The packet length in the header specifies the length of the user id. | |
| * If it is text, it is encoded in UTF-8. | | * If it is text, it is encoded in UTF-8. | |
| * | | * | |
| */ | | */ | |
| typedef struct pgpPktUid_s { | | typedef struct pgpPktUid_s { | |
|
| uint8_t userid[1]; | | rpmuint8_t userid[1]; | |
| } pgpPktUid; | | } pgpPktUid; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| */ | | */ | |
| union pgpPktPre_u { | | union pgpPktPre_u { | |
| pgpPktPubkey pubkey; /*!< 5.1. Public-Key Encrypted Session Key *
/ | | pgpPktPubkey pubkey; /*!< 5.1. Public-Key Encrypted Session Key *
/ | |
| pgpPktSig sig; /*!< 5.2. Signature */ | | pgpPktSig sig; /*!< 5.2. Signature */ | |
| pgpPktSymkey symkey; /*!< 5.3. Symmetric-Key Encrypted Session-Ke
y */ | | pgpPktSymkey symkey; /*!< 5.3. Symmetric-Key Encrypted Session-Ke
y */ | |
| pgpPktOnepass onepass; /*!< 5.4. One-Pass Signature */ | | pgpPktOnepass onepass; /*!< 5.4. One-Pass Signature */ | |
| pgpPktKey key; /*!< 5.5. Key Material */ | | pgpPktKey key; /*!< 5.5. Key Material */ | |
| | | | |
| skipping to change at line 1077 | | skipping to change at line 1029 | |
| PGPARMORKEY_CHARSET = 5 /*!< Charset: */ | | PGPARMORKEY_CHARSET = 5 /*!< Charset: */ | |
| } pgpArmorKey; | | } pgpArmorKey; | |
| /*@=typeuse@*/ | | /*@=typeuse@*/ | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Armor key (string, value) pairs. | | * Armor key (string, value) pairs. | |
| */ | | */ | |
| /*@observer@*/ /*@unchecked@*/ /*@unused@*/ | | /*@observer@*/ /*@unchecked@*/ /*@unused@*/ | |
| extern struct pgpValTbl_s pgpArmorKeyTbl[]; | | extern struct pgpValTbl_s pgpArmorKeyTbl[]; | |
| | | | |
|
| /** \ingroup rpmpgp | | | |
| * Bit(s) to control digest operation. | | | |
| */ | | | |
| typedef enum rpmDigestFlags_e { | | | |
| RPMDIGEST_NONE = 0 | | | |
| } rpmDigestFlags; | | | |
| | | | |
| /*@-fcnuse@*/ | | /*@-fcnuse@*/ | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| #endif | | #endif | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return (native-endian) integer from big-endian representation. | | * Return (native-endian) integer from big-endian representation. | |
| * @param s pointer to big-endian integer | | * @param s pointer to big-endian integer | |
| * @param nbytes no. of bytes | | * @param nbytes no. of bytes | |
| * @return native-endian integer | | * @return native-endian integer | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
|
| unsigned int pgpGrab(const uint8_t * s, size_t nbytes) | | unsigned int pgpGrab(const rpmuint8_t * s, size_t nbytes) | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| unsigned int i = 0; | | unsigned int i = 0; | |
| size_t nb = (nbytes <= sizeof(i) ? nbytes : sizeof(i)); | | size_t nb = (nbytes <= sizeof(i) ? nbytes : sizeof(i)); | |
| while (nb--) | | while (nb--) | |
| i = (i << 8) | *s++; | | i = (i << 8) | *s++; | |
| return i; | | return i; | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return length of an OpenPGP packet. | | * Return length of an OpenPGP packet. | |
| * @param s pointer to packet | | * @param s pointer to packet | |
| * @retval *lenp no. of bytes in packet | | * @retval *lenp no. of bytes in packet | |
| * @return no. of bytes in length prefix | | * @return no. of bytes in length prefix | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
|
| unsigned int pgpLen(const uint8_t * s, /*@out@*/ unsigned int * lenp) | | unsigned int pgpLen(const rpmuint8_t * s, /*@out@*/ unsigned int * lenp) | |
| /*@modifies *lenp @*/ | | /*@modifies *lenp @*/ | |
| { | | { | |
|
| if (*s < (uint8_t)192) { | | if (*s < (rpmuint8_t)192) { | |
| *lenp = (unsigned int) *s++; | | *lenp = (unsigned int) *s++; | |
| return 1; | | return 1; | |
|
| } else if (*s < (uint8_t)255) { | | } else if (*s < (rpmuint8_t)255) { | |
| *lenp = (unsigned int) ((((unsigned)s[0]) - 192) << 8) + (unsigned)s
[1] + 192; | | *lenp = (unsigned int) ((((unsigned)s[0]) - 192) << 8) + (unsigned)s
[1] + 192; | |
| return 2; | | return 2; | |
| } else { | | } else { | |
| *lenp = pgpGrab(s+1, 4); | | *lenp = pgpGrab(s+1, 4); | |
| return 5; | | return 5; | |
| } | | } | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return no. of bits in a multiprecision integer. | | * Return no. of bits in a multiprecision integer. | |
| * @param p pointer to multiprecision integer | | * @param p pointer to multiprecision integer | |
| * @return no. of bits | | * @return no. of bits | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
|
| unsigned int pgpMpiBits(const uint8_t * p) | | unsigned int pgpMpiBits(const rpmuint8_t * p) | |
| /*@requires maxRead(p) >= 1 @*/ | | /*@requires maxRead(p) >= 1 @*/ | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| return (unsigned int) ((p[0] << 8) | p[1]); | | return (unsigned int) ((p[0] << 8) | p[1]); | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return no. of bytes in a multiprecision integer. | | * Return no. of bytes in a multiprecision integer. | |
| * @param p pointer to multiprecision integer | | * @param p pointer to multiprecision integer | |
| * @return no. of bytes | | * @return no. of bytes | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
|
| unsigned int pgpMpiLen(const uint8_t * p) | | unsigned int pgpMpiLen(const rpmuint8_t * p) | |
| /*@requires maxRead(p) >= 1 @*/ | | /*@requires maxRead(p) >= 1 @*/ | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| return (2 + ((pgpMpiBits(p)+7)>>3)); | | return (2 + ((pgpMpiBits(p)+7)>>3)); | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Convert to hex. | | * Convert to hex. | |
| * @param t target buffer (returned) | | * @param t target buffer (returned) | |
| * @param s source bytes | | * @param s source bytes | |
| * @param nbytes no. of bytes | | * @param nbytes no. of bytes | |
| * @return target buffer | | * @return target buffer | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
|
| char * pgpHexCvt(/*@returned@*/ char * t, const uint8_t * s, size_t nbytes) | | char * pgpHexCvt(/*@returned@*/ char * t, const rpmuint8_t * s, size_t nbyt
es) | |
| /*@modifies *t @*/ | | /*@modifies *t @*/ | |
| { | | { | |
| static char hex[] = "0123456789abcdef"; | | static char hex[] = "0123456789abcdef"; | |
| while (nbytes-- > 0) { | | while (nbytes-- > 0) { | |
| unsigned int i; | | unsigned int i; | |
| i = (unsigned int) *s++; | | i = (unsigned int) *s++; | |
| *t++ = hex[ (i >> 4) & 0xf ]; | | *t++ = hex[ (i >> 4) & 0xf ]; | |
| *t++ = hex[ (i ) & 0xf ]; | | *t++ = hex[ (i ) & 0xf ]; | |
| } | | } | |
| *t = '\0'; | | *t = '\0'; | |
| | | | |
| skipping to change at line 1184 | | skipping to change at line 1129 | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return hex formatted representation of bytes. | | * Return hex formatted representation of bytes. | |
| * @todo Remove static buffer. | | * @todo Remove static buffer. | |
| * @param p bytes | | * @param p bytes | |
| * @param plen no. of bytes | | * @param plen no. of bytes | |
| * @return hex formatted string | | * @return hex formatted string | |
| */ | | */ | |
| /*@unused@*/ static inline /*@observer@*/ | | /*@unused@*/ static inline /*@observer@*/ | |
|
| char * pgpHexStr(const uint8_t * p, size_t plen) | | char * pgpHexStr(const rpmuint8_t * p, size_t plen) | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| static char prbuf[8*BUFSIZ]; /* XXX ick */ | | static char prbuf[8*BUFSIZ]; /* XXX ick */ | |
| char *t = prbuf; | | char *t = prbuf; | |
| t = pgpHexCvt(t, p, plen); | | t = pgpHexCvt(t, p, plen); | |
| return prbuf; | | return prbuf; | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return hex formatted representation of a multiprecision integer. | | * Return hex formatted representation of a multiprecision integer. | |
| * @todo Remove static buffer. | | * @todo Remove static buffer. | |
| * @param p bytes | | * @param p bytes | |
| * @return hex formatted string | | * @return hex formatted string | |
| */ | | */ | |
| /*@unused@*/ static inline /*@observer@*/ | | /*@unused@*/ static inline /*@observer@*/ | |
|
| const char * pgpMpiStr(const uint8_t * p) | | const char * pgpMpiStr(const rpmuint8_t * p) | |
| /*@requires maxRead(p) >= 3 @*/ | | /*@requires maxRead(p) >= 3 @*/ | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| static char prbuf[8*BUFSIZ]; /* XXX ick */ | | static char prbuf[8*BUFSIZ]; /* XXX ick */ | |
| char *t = prbuf; | | char *t = prbuf; | |
| sprintf(t, "[%4u]: ", pgpGrab(p, 2)); | | sprintf(t, "[%4u]: ", pgpGrab(p, 2)); | |
| t += strlen(t); | | t += strlen(t); | |
| t = pgpHexCvt(t, p+2, pgpMpiLen(p)-2); | | t = pgpHexCvt(t, p+2, pgpMpiLen(p)-2); | |
| return prbuf; | | return prbuf; | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return string representation of am OpenPGP value. | | * Return string representation of am OpenPGP value. | |
| * @param vs table of (string,value) pairs | | * @param vs table of (string,value) pairs | |
| * @param val byte value to lookup | | * @param val byte value to lookup | |
| * @return string value of byte | | * @return string value of byte | |
| */ | | */ | |
| /*@unused@*/ static inline /*@observer@*/ | | /*@unused@*/ static inline /*@observer@*/ | |
|
| const char * pgpValStr(pgpValTbl vs, uint8_t val) | | const char * pgpValStr(pgpValTbl vs, rpmuint8_t val) | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| do { | | do { | |
| if (vs->val == (int)val) | | if (vs->val == (int)val) | |
| break; | | break; | |
| } while ((++vs)->val != -1); | | } while ((++vs)->val != -1); | |
| return vs->str; | | return vs->str; | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| | | | |
| skipping to change at line 1255 | | skipping to change at line 1200 | |
| return vs->val; | | return vs->val; | |
| } | | } | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Print an OpenPGP value. | | * Print an OpenPGP value. | |
| * @param pre output prefix | | * @param pre output prefix | |
| * @param vs table of (string,value) pairs | | * @param vs table of (string,value) pairs | |
| * @param val byte value to print | | * @param val byte value to print | |
| */ | | */ | |
| /*@-exportlocal@*/ | | /*@-exportlocal@*/ | |
|
| void pgpPrtVal(const char * pre, pgpValTbl vs, uint8_t val) | | void pgpPrtVal(const char * pre, pgpValTbl vs, rpmuint8_t val) | |
| /*@globals fileSystem @*/ | | /*@globals fileSystem @*/ | |
| /*@modifies fileSystem @*/; | | /*@modifies fileSystem @*/; | |
| /*@=exportlocal@*/ | | /*@=exportlocal@*/ | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Print/parse an OpenPGP subtype packet. | | * Print/parse an OpenPGP subtype packet. | |
| * @param h packet | | * @param h packet | |
| * @param hlen packet length (no. of bytes) | | * @param hlen packet length (no. of bytes) | |
| * @param sigtype signature type | | * @param sigtype signature type | |
| * @return 0 on success | | * @return 0 on success | |
| */ | | */ | |
| /*@-exportlocal@*/ | | /*@-exportlocal@*/ | |
|
| int pgpPrtSubType(const uint8_t * h, size_t hlen, pgpSigType sigtype) | | int pgpPrtSubType(const rpmuint8_t * h, size_t hlen, pgpSigType sigtype) | |
| /*@globals fileSystem @*/ | | /*@globals fileSystem @*/ | |
| /*@modifies fileSystem @*/; | | /*@modifies fileSystem @*/; | |
| /*@=exportlocal@*/ | | /*@=exportlocal@*/ | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Print/parse an OpenPGP signature packet. | | * Print/parse an OpenPGP signature packet. | |
| * @param pp packet tag/ptr/len | | * @param pp packet tag/ptr/len | |
| * @return 0 on success | | * @return 0 on success | |
| */ | | */ | |
| /*@-exportlocal@*/ | | /*@-exportlocal@*/ | |
| | | | |
| skipping to change at line 1324 | | skipping to change at line 1269 | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Calculate OpenPGP public key fingerprint. | | * Calculate OpenPGP public key fingerprint. | |
| * @todo V3 non-RSA public keys not implemented. | | * @todo V3 non-RSA public keys not implemented. | |
| * @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY) | | * @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY) | |
| * @param pktlen OpenPGP packet length (no. of bytes) | | * @param pktlen OpenPGP packet length (no. of bytes) | |
| * @retval keyid publick key fingerprint | | * @retval keyid publick key fingerprint | |
| * @return 0 on sucess, else -1 | | * @return 0 on sucess, else -1 | |
| */ | | */ | |
| /*@-exportlocal@*/ | | /*@-exportlocal@*/ | |
|
| int pgpPubkeyFingerprint(const uint8_t * pkt, size_t pktlen, | | int pgpPubkeyFingerprint(const rpmuint8_t * pkt, size_t pktlen, | |
| /*@out@*/ uint8_t * keyid) | | /*@out@*/ rpmuint8_t * keyid) | |
| /*@modifies *keyid @*/; | | /*@modifies *keyid @*/; | |
| /*@=exportlocal@*/ | | /*@=exportlocal@*/ | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Extract OpenPGP public key fingerprint from base64 encoded packet. | | * Extract OpenPGP public key fingerprint from base64 encoded packet. | |
| * @todo V3 non-RSA public keys not implemented. | | * @todo V3 non-RSA public keys not implemented. | |
| * @param b64pkt base64 encoded openpgp packet | | * @param b64pkt base64 encoded openpgp packet | |
| * @retval keyid[8] public key fingerprint | | * @retval keyid[8] public key fingerprint | |
| * @return 8 (no. of bytes) on success, < 0 on error | | * @return 8 (no. of bytes) on success, < 0 on error | |
| */ | | */ | |
| int pgpExtractPubkeyFingerprint(const char * b64pkt, | | int pgpExtractPubkeyFingerprint(const char * b64pkt, | |
|
| /*@out@*/ uint8_t * keyid) | | /*@out@*/ rpmuint8_t * keyid) | |
| /*@modifies *keyid @*/; | | /*@modifies *keyid @*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return lenth of a OpenPGP packet. | | * Return lenth of a OpenPGP packet. | |
| * @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY) | | * @param pkt OpenPGP packet (i.e. PGPTAG_PUBLIC_KEY) | |
| * @param pleft OpenPGP packet length (no. of bytes) | | * @param pleft OpenPGP packet length (no. of bytes) | |
| * @retval pp packet tag/ptr/len | | * @retval pp packet tag/ptr/len | |
| * @return packet length, <0 on error. | | * @return packet length, <0 on error. | |
| */ | | */ | |
|
| int pgpPktLen(const uint8_t * pkt, size_t pleft, /*@out@*/ pgpPkt pp) | | int pgpPktLen(const rpmuint8_t * pkt, size_t pleft, /*@out@*/ pgpPkt pp) | |
| /*@modifies pp @*/; | | /*@modifies pp @*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Print/parse next OpenPGP packet. | | * Print/parse next OpenPGP packet. | |
| * @param pkt OpenPGP packet | | * @param pkt OpenPGP packet | |
| * @param pleft no. bytes remaining | | * @param pleft no. bytes remaining | |
| * @return -1 on error, otherwise this packet length | | * @return -1 on error, otherwise this packet length | |
| */ | | */ | |
| /*@-exportlocal@*/ | | /*@-exportlocal@*/ | |
|
| int pgpPrtPkt(const uint8_t * pkt, size_t pleft) | | int pgpPrtPkt(const rpmuint8_t * pkt, size_t pleft) | |
| /*@globals fileSystem, internalState @*/ | | /*@globals fileSystem, internalState @*/ | |
| /*@modifies fileSystem, internalState @*/; | | /*@modifies fileSystem, internalState @*/; | |
| /*@=exportlocal@*/ | | /*@=exportlocal@*/ | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Print/parse a OpenPGP packet(s). | | * Print/parse a OpenPGP packet(s). | |
| * @param pkts OpenPGP packet(s) | | * @param pkts OpenPGP packet(s) | |
| * @param pktlen OpenPGP packet(s) length (no. of bytes) | | * @param pktlen OpenPGP packet(s) length (no. of bytes) | |
| * @retval dig parsed output of signature/pubkey packet parameters | | * @retval dig parsed output of signature/pubkey packet parameters | |
| * @param printing should packets be printed? | | * @param printing should packets be printed? | |
| * @return -1 on error, 0 on success | | * @return -1 on error, 0 on success | |
| */ | | */ | |
|
| int pgpPrtPkts(const uint8_t * pkts, size_t pktlen, pgpDig dig, int printin
g) | | int pgpPrtPkts(const rpmuint8_t * pkts, size_t pktlen, pgpDig dig, int prin
ting) | |
| /*@globals fileSystem, internalState @*/ | | /*@globals fileSystem, internalState @*/ | |
| /*@modifies dig, fileSystem, internalState @*/; | | /*@modifies dig, fileSystem, internalState @*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Parse armored OpenPGP packets from a file. | | * Parse armored OpenPGP packets from a file. | |
| * @param fn file name | | * @param fn file name | |
| * @retval pkt dearmored OpenPGP packet(s) | | * @retval pkt dearmored OpenPGP packet(s) | |
| * @retval pktlen dearmored OpenPGP packet(s) length in bytes | | * @retval pktlen dearmored OpenPGP packet(s) length in bytes | |
| * @return type of armor found | | * @return type of armor found | |
| */ | | */ | |
| pgpArmor pgpReadPkts(const char * fn, | | pgpArmor pgpReadPkts(const char * fn, | |
|
| /*@out@*/ uint8_t ** pkt, /*@out@*/ size_t * pktlen) | | /*@out@*/ rpmuint8_t ** pkt, /*@out@*/ size_t * pktlen) | |
| /*@globals h_errno, fileSystem, internalState @*/ | | /*@globals h_errno, fileSystem, internalState @*/ | |
| /*@modifies *pkt, *pktlen, fileSystem, internalState @*/; | | /*@modifies *pkt, *pktlen, fileSystem, internalState @*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Wrap a OpenPGP packets in ascii armor for transport. | | * Wrap a OpenPGP packets in ascii armor for transport. | |
| * @param atype type of armor | | * @param atype type of armor | |
| * @param s binary pkt data | | * @param s binary pkt data | |
| * @param ns binary pkt data length | | * @param ns binary pkt data length | |
| * @return formatted string | | * @return formatted string | |
| */ | | */ | |
|
| char * pgpArmorWrap(uint8_t atype, const unsigned char * s, size_t ns) | | char * pgpArmorWrap(rpmuint8_t atype, const unsigned char * s, size_t ns) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Convert a hash algorithm "foo" to the internal PGPHASHALGO_FOO number. | | * Convert a hash algorithm "foo" to the internal PGPHASHALGO_FOO number. | |
| * @param name name of hash algorithm | | * @param name name of hash algorithm | |
| * @param name_len length of name or 0 for strlen(name) | | * @param name_len length of name or 0 for strlen(name) | |
| * @return PGPHASHALGO_<name> or -1 in case of error | | * @return PGPHASHALGO_<name> or -1 in case of error | |
| */ | | */ | |
| pgpHashAlgo pgpHashAlgoStringToNumber(const char *name, size_t name_len) | | pgpHashAlgo pgpHashAlgoStringToNumber(const char *name, size_t name_len) | |
| /*@*/; | | /*@*/; | |
| | | | |
| skipping to change at line 1434 | | skipping to change at line 1379 | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Reference a signature parameters instance. | | * Reference a signature parameters instance. | |
| * @param dig signature parameters | | * @param dig signature parameters | |
| * @param msg | | * @param msg | |
| * @return new signature parameters reference | | * @return new signature parameters reference | |
| */ | | */ | |
| /*@unused@*/ /*@newref@*/ /*@null@*/ | | /*@unused@*/ /*@newref@*/ /*@null@*/ | |
| pgpDig pgpDigLink (/*@null@*/ pgpDig dig, /*@null@*/ const char * msg) | | pgpDig pgpDigLink (/*@null@*/ pgpDig dig, /*@null@*/ const char * msg) | |
| /*@modifies dig @*/; | | /*@modifies dig @*/; | |
| #define pgpDigLink(_dig, _msg) \ | | #define pgpDigLink(_dig, _msg) \ | |
|
| ((pgpDig)rpmioLinkPoolItem((rpmioItem)(_dig), _msg, __FILE__, __LINE
__)) | | ((pgpDig)rpmioLinkPoolItem((rpmioItem)(_dig), _msg, __FILE__, __LINE__)
) | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Destroy a container for parsed OpenPGP packates. | | * Destroy a container for parsed OpenPGP packates. | |
| * @param dig signature parameters container | | * @param dig signature parameters container | |
| * @return NULL on last dereference | | * @return NULL on last dereference | |
| */ | | */ | |
| /*@unused@*/ /*@null@*/ | | /*@unused@*/ /*@null@*/ | |
| pgpDig pgpDigFree(/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig) | | pgpDig pgpDigFree(/*@killref@*/ /*@only@*/ /*@null@*/ pgpDig dig) | |
| /*@modifies dig @*/; | | /*@modifies dig @*/; | |
| #define pgpDigFree(_dig, _msg) \ | | #define pgpDigFree(_dig, _msg) \ | |
| | | | |
| skipping to change at line 1486 | | skipping to change at line 1431 | |
| */ | | */ | |
| /*@exposed@*/ | | /*@exposed@*/ | |
| pgpDigParams pgpGetSignature(const pgpDig dig) | | pgpDigParams pgpGetSignature(const pgpDig dig) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Get signature tag. | | * Get signature tag. | |
| * @param dig signature parameters container | | * @param dig signature parameters container | |
| * @return signature tag | | * @return signature tag | |
| */ | | */ | |
|
| uint32_t pgpGetSigtag(const pgpDig dig) | | rpmuint32_t pgpGetSigtag(const pgpDig dig) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Get signature tag type. | | * Get signature tag type. | |
| * @param dig signature parameters container | | * @param dig signature parameters container | |
| * @return signature tag type | | * @return signature tag type | |
| */ | | */ | |
|
| uint32_t pgpGetSigtype(const pgpDig dig) | | rpmuint32_t pgpGetSigtype(const pgpDig dig) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Get signature tag data, i.e. from header. | | * Get signature tag data, i.e. from header. | |
| * @param dig signature parameters container | | * @param dig signature parameters container | |
| * @return signature tag data | | * @return signature tag data | |
| */ | | */ | |
| /*@observer@*/ /*@null@*/ | | /*@observer@*/ /*@null@*/ | |
| extern const void * pgpGetSig(const pgpDig dig) | | extern const void * pgpGetSig(const pgpDig dig) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Get signature tag data length, i.e. no. of bytes of data. | | * Get signature tag data length, i.e. no. of bytes of data. | |
| * @param dig signature parameters container | | * @param dig signature parameters container | |
| * @return signature tag data length | | * @return signature tag data length | |
| */ | | */ | |
|
| uint32_t pgpGetSiglen(const pgpDig dig) | | rpmuint32_t pgpGetSiglen(const pgpDig dig) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Set signature tag info, i.e. from header. | | * Set signature tag info, i.e. from header. | |
| * @param dig signature parameters container | | * @param dig signature parameters container | |
| * @param sigtag signature tag | | * @param sigtag signature tag | |
| * @param sigtype signature tag type | | * @param sigtype signature tag type | |
| * @param sig signature tag data | | * @param sig signature tag data | |
| * @param siglen signature tag data length | | * @param siglen signature tag data length | |
| * @return 0 always | | * @return 0 always | |
| */ | | */ | |
| int pgpSetSig(pgpDig dig, | | int pgpSetSig(pgpDig dig, | |
|
| uint32_t sigtag, uint32_t sigtype, | | rpmuint32_t sigtag, rpmuint32_t sigtype, | |
| /*@kept@*/ /*@null@*/ const void * sig, uint32_t siglen) | | /*@kept@*/ /*@null@*/ const void * sig, rpmuint32_t siglen) | |
| /*@modifies dig @*/; | | /*@modifies dig @*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return pgpDig container accumulator structure. | | * Return pgpDig container accumulator structure. | |
| * @param dig signature parameters container | | * @param dig signature parameters container | |
| * @param opx per-container accumulator index (aka rpmtsOpX) | | * @param opx per-container accumulator index (aka rpmtsOpX) | |
| * @return per-container accumulator pointer | | * @return per-container accumulator pointer | |
| */ | | */ | |
| /*@null@*/ | | /*@null@*/ | |
| void * pgpStatsAccumulator(pgpDig dig, int opx) | | void * pgpStatsAccumulator(pgpDig dig, int opx) | |
| | | | |
| skipping to change at line 1565 | | skipping to change at line 1510 | |
| int pgpFindPubkey(pgpDig dig) | | int pgpFindPubkey(pgpDig dig) | |
| /*@modifies dig @*/; | | /*@modifies dig @*/; | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Is buffer at beginning of an OpenPGP packet? | | * Is buffer at beginning of an OpenPGP packet? | |
| * @param p buffer | | * @param p buffer | |
| * @retval *tagp OpenPGP tag | | * @retval *tagp OpenPGP tag | |
| * @return 1 if an OpenPGP packet, 0 otherwise | | * @return 1 if an OpenPGP packet, 0 otherwise | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
|
| int pgpIsPkt(const uint8_t * p, /*@null@*/ pgpTag * tagp) | | int pgpIsPkt(const rpmuint8_t * p, /*@null@*/ pgpTag * tagp) | |
| /*@modifies *tagp @*/ | | /*@modifies *tagp @*/ | |
| { | | { | |
| unsigned int val = (unsigned int) *p++; | | unsigned int val = (unsigned int) *p++; | |
| pgpTag tag; | | pgpTag tag; | |
| int rc; | | int rc; | |
| | | | |
| /* XXX can't deal with these. */ | | /* XXX can't deal with these. */ | |
| if (!(val & 0x80)) | | if (!(val & 0x80)) | |
| return 0; | | return 0; | |
| | | | |
| | | | |
| skipping to change at line 1626 | | skipping to change at line 1571 | |
| #define CRC24_INIT 0xb704ce | | #define CRC24_INIT 0xb704ce | |
| #define CRC24_POLY 0x1864cfb | | #define CRC24_POLY 0x1864cfb | |
| | | | |
| /** \ingroup rpmpgp | | /** \ingroup rpmpgp | |
| * Return CRC of a buffer. | | * Return CRC of a buffer. | |
| * @param octets bytes | | * @param octets bytes | |
| * @param len no. of bytes | | * @param len no. of bytes | |
| * @return crc of buffer | | * @return crc of buffer | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
|
| unsigned int pgpCRC(const uint8_t * octets, size_t len) | | unsigned int pgpCRC(const rpmuint8_t * octets, size_t len) | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| unsigned int crc = CRC24_INIT; | | unsigned int crc = CRC24_INIT; | |
| int i; | | int i; | |
| | | | |
| while (len--) { | | while (len--) { | |
| crc ^= (*octets++) << 16; | | crc ^= (*octets++) << 16; | |
| for (i = 0; i < 8; i++) { | | for (i = 0; i < 8; i++) { | |
| crc <<= 1; | | crc <<= 1; | |
| if (crc & 0x1000000) | | if (crc & 0x1000000) | |
| crc ^= CRC24_POLY; | | crc ^= CRC24_POLY; | |
| } | | } | |
| } | | } | |
| return crc & 0xffffff; | | return crc & 0xffffff; | |
| } | | } | |
| | | | |
|
| /** \ingroup rpmpgp | | | |
| * Return digest algorithm identifier. | | | |
| * @param ctx digest context | | | |
| * @return digest hash algorithm identifier | | | |
| */ | | | |
| /*@observer@*/ | | | |
| pgpHashAlgo rpmDigestAlgo(DIGEST_CTX ctx) | | | |
| /*@*/; | | | |
| | | | |
| /** \ingroup rpmpgp | | | |
| * Return digest name. | | | |
| * @param ctx digest context | | | |
| * @return digest name | | | |
| */ | | | |
| /*@observer@*/ | | | |
| const char * rpmDigestName(DIGEST_CTX ctx) | | | |
| /*@*/; | | | |
| | | | |
| /** \ingroup rpmpgp | | | |
| * Return digest ASN1 oid string. | | | |
| * Values from PKCS#1 v2.1 (aka RFC-3447). | | | |
| * @param ctx digest context | | | |
| * @return digest ASN1 oid string | | | |
| */ | | | |
| /*@observer@*/ /*@null@*/ | | | |
| const char * rpmDigestASN1(DIGEST_CTX ctx) | | | |
| /*@*/; | | | |
| | | | |
| /** \ingroup rpmpgp | | | |
| * Duplicate a digest context. | | | |
| * @param octx existing digest context | | | |
| * @return duplicated digest context | | | |
| */ | | | |
| /*@only@*/ | | | |
| DIGEST_CTX rpmDigestDup(DIGEST_CTX octx) | | | |
| /*@*/; | | | |
| | | | |
| /** \ingroup rpmpgp | | | |
| * Initialize digest. | | | |
| * Set bit count to 0 and buffer to mysterious initialization constants. | | | |
| * @param hashalgo type of digest | | | |
| * @param flags bit(s) to control digest operation | | | |
| * @return digest context | | | |
| */ | | | |
| /*@only@*/ /*@null@*/ | | | |
| DIGEST_CTX rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags) | | | |
| /*@*/; | | | |
| | | | |
| /** \ingroup rpmpgp | | | |
| * Update context with next plain text buffer. | | | |
| * @param ctx digest context | | | |
| * @param data next data buffer | | | |
| * @param len no. bytes of data | | | |
| * @return 0 on success | | | |
| */ | | | |
| int rpmDigestUpdate(/*@null@*/ DIGEST_CTX ctx, const void * data, size_t le | | | |
| n) | | | |
| /*@modifies ctx @*/; | | | |
| | | | |
| /** \ingroup rpmpgp | | | |
| * Return digest and destroy context. | | | |
| * Final wrapup - pad to 64-byte boundary with the bit pattern | | | |
| * 1 0* (64-bit count of bits processed, MSB-first) | | | |
| * | | | |
| * @param ctx digest context | | | |
| * @retval *datap digest | | | |
| * @retval *lenp no. bytes of digest | | | |
| * @param asAscii return digest as ascii string? | | | |
| * @return 0 on success | | | |
| */ | | | |
| int rpmDigestFinal(/*@only@*/ /*@null@*/ DIGEST_CTX ctx, | | | |
| /*@null@*/ /*@out@*/ void * datap, | | | |
| /*@null@*/ /*@out@*/ size_t * lenp, int asAscii) | | | |
| /*@modifies *datap, *lenp @*/; | | | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| typedef int (*pgpImplSet_t) (/*@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigP
arams sigp) | | typedef int (*pgpImplSet_t) (/*@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigP
arams sigp) | |
| /*@modifies ctx, dig @*/; | | /*@modifies ctx, dig @*/; | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| typedef int (*pgpImplVerify_t) (pgpDig dig) | | typedef int (*pgpImplVerify_t) (pgpDig dig) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| typedef int (*pgpImplMpiItem_t) (const char * pre, pgpDig dig, int itemno, | | typedef int (*pgpImplMpiItem_t) (const char * pre, pgpDig dig, int itemno, | |
|
| const uint8_t * p, /*@null@*/ const uint8_t * pend) | | const rpmuint8_t * p, /*@null@*/ const rpmuint8_t * pend) | |
| /*@globals fileSystem @*/ | | /*@globals fileSystem @*/ | |
| /*@modifies dig, fileSystem @*/; | | /*@modifies dig, fileSystem @*/; | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| typedef void (*pgpImplClean_t) (void * impl) | | typedef void (*pgpImplClean_t) (void * impl) | |
| /*@modifies impl @*/; | | /*@modifies impl @*/; | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| | | | |
| skipping to change at line 1756 | | skipping to change at line 1627 | |
| typedef void * (*pgpImplInit_t) (void) | | typedef void * (*pgpImplInit_t) (void) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| typedef struct pgpImplVecs_s { | | typedef struct pgpImplVecs_s { | |
| pgpImplSet_t _pgpSetRSA; | | pgpImplSet_t _pgpSetRSA; | |
| pgpImplVerify_t _pgpVerifyRSA; | | pgpImplVerify_t _pgpVerifyRSA; | |
| pgpImplSet_t _pgpSetDSA; | | pgpImplSet_t _pgpSetDSA; | |
| pgpImplVerify_t _pgpVerifyDSA; | | pgpImplVerify_t _pgpVerifyDSA; | |
|
| | | pgpImplSet_t _pgpSetECDSA; | |
| | | pgpImplVerify_t _pgpVerifyECDSA; | |
| pgpImplMpiItem_t _pgpMpiItem; | | pgpImplMpiItem_t _pgpMpiItem; | |
| pgpImplClean_t _pgpClean; | | pgpImplClean_t _pgpClean; | |
| pgpImplFree_t _pgpFree; | | pgpImplFree_t _pgpFree; | |
| pgpImplInit_t _pgpInit; | | pgpImplInit_t _pgpInit; | |
| } pgpImplVecs_t; | | } pgpImplVecs_t; | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
| extern pgpImplVecs_t * pgpImplVecs; | | extern pgpImplVecs_t * pgpImplVecs; | |
| | | | |
| skipping to change at line 1807 | | skipping to change at line 1680 | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int pgpImplVerifyDSA(pgpDig dig) | | int pgpImplVerifyDSA(pgpDig dig) | |
| /*@*/ | | /*@*/ | |
| { | | { | |
| return (*pgpImplVecs->_pgpVerifyDSA) (dig); | | return (*pgpImplVecs->_pgpVerifyDSA) (dig); | |
| } | | } | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
|
| | | int pgpImplSetECDSA(/*@only@*/ DIGEST_CTX ctx, pgpDig dig, pgpDigParams sig | |
| | | p) | |
| | | /*@modifies ctx, dig @*/ | |
| | | { | |
| | | return (*pgpImplVecs->_pgpSetECDSA) (ctx, dig, sigp); | |
| | | } | |
| | | | |
| | | /** | |
| | | */ | |
| | | /*@unused@*/ static inline | |
| | | int pgpImplVerifyECDSA(pgpDig dig) | |
| | | /*@*/ | |
| | | { | |
| | | return (*pgpImplVecs->_pgpVerifyECDSA) (dig); | |
| | | } | |
| | | | |
| | | /** | |
| | | */ | |
| | | /*@unused@*/ static inline | |
| int pgpImplMpiItem(const char * pre, pgpDig dig, int itemno, | | int pgpImplMpiItem(const char * pre, pgpDig dig, int itemno, | |
|
| const uint8_t * p, /*@null@*/ const uint8_t * pend) | | const rpmuint8_t * p, /*@null@*/ const rpmuint8_t * pend) | |
| /*@modifies dig @*/ | | /*@modifies dig @*/ | |
| { | | { | |
| return (*pgpImplVecs->_pgpMpiItem) (pre, dig, itemno, p, pend); | | return (*pgpImplVecs->_pgpMpiItem) (pre, dig, itemno, p, pend); | |
| } | | } | |
| | | | |
| /** | | /** | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| void pgpImplClean(void * impl) | | void pgpImplClean(void * impl) | |
| /*@modifies impl @*/ | | /*@modifies impl @*/ | |
| | | | |
End of changes. 53 change blocks. |
| 216 lines changed or deleted | | 111 lines changed or added | |
|
| rpmts.h | | rpmts.h | |
| | | | |
| skipping to change at line 160 | | skipping to change at line 160 | |
| */ | | */ | |
| typedef enum tsStage_e { | | typedef enum tsStage_e { | |
| TSM_UNKNOWN = 0, | | TSM_UNKNOWN = 0, | |
| TSM_INSTALL = 7, | | TSM_INSTALL = 7, | |
| TSM_ERASE = 8, | | TSM_ERASE = 8, | |
| } tsmStage; | | } tsmStage; | |
| | | | |
| #if defined(_RPMTS_INTERNAL) | | #if defined(_RPMTS_INTERNAL) | |
| | | | |
| #include "rpmhash.h" /* XXX hashTable */ | | #include "rpmhash.h" /* XXX hashTable */ | |
|
| | | #include "rpmkeyring.h" | |
| #include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/ | | #include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/ | |
| | | | |
| /*@unchecked@*/ | | /*@unchecked@*/ | |
| /*@-exportlocal@*/ | | /*@-exportlocal@*/ | |
| extern int _cacheDependsRC; | | extern int _cacheDependsRC; | |
| /*@=exportlocal@*/ | | /*@=exportlocal@*/ | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| */ | | */ | |
| typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo; | | typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo; | |
| | | | |
| skipping to change at line 234 | | skipping to change at line 235 | |
| rpmCallbackData notifyData; /*!< Callback private data. */ | | rpmCallbackData notifyData; /*!< Callback private data. */ | |
| | | | |
| /*@null@*/ | | /*@null@*/ | |
| rpmPRCO PRCO; /*!< Current transaction dependencies. */ | | rpmPRCO PRCO; /*!< Current transaction dependencies. */ | |
| | | | |
| /*@refcounted@*/ /*@null@*/ | | /*@refcounted@*/ /*@null@*/ | |
| rpmps probs; /*!< Current problems in transaction. */ | | rpmps probs; /*!< Current problems in transaction. */ | |
| rpmprobFilterFlags ignoreSet; | | rpmprobFilterFlags ignoreSet; | |
| /*!< Bits to filter current problems. */ | | /*!< Bits to filter current problems. */ | |
| | | | |
|
| uint32_t filesystemCount; /*!< No. of mounted filesystems. */ | | rpmuint32_t filesystemCount;/*!< No. of mounted filesystems. */ | |
| /*@dependent@*/ /*@null@*/ | | /*@dependent@*/ /*@null@*/ | |
| const char ** filesystems; /*!< Mounted filesystem names. */ | | const char ** filesystems; /*!< Mounted filesystem names. */ | |
| /*@only@*/ /*@relnull@*/ | | /*@only@*/ /*@relnull@*/ | |
| rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */ | | rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */ | |
| | | | |
| /*@refcounted@*/ /*@null@*/ | | /*@refcounted@*/ /*@null@*/ | |
| rpmdb rdb; /*!< Install database handle. */ | | rpmdb rdb; /*!< Install database handle. */ | |
| int dbmode; /*!< Install database open mode. */ | | int dbmode; /*!< Install database open mode. */ | |
| /*@only@*/ | | /*@only@*/ | |
| hashTable ht; /*!< Fingerprint hash table. */ | | hashTable ht; /*!< Fingerprint hash table. */ | |
| | | | |
| skipping to change at line 293 | | skipping to change at line 294 | |
| | | | |
| int selinuxEnabled; /*!< Is SE linux enabled? */ | | int selinuxEnabled; /*!< Is SE linux enabled? */ | |
| int chrootDone; /*!< Has chroot(2) been been done? */ | | int chrootDone; /*!< Has chroot(2) been been done? */ | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
| const char * rootDir; /*!< Path to top of install tree. */ | | const char * rootDir; /*!< Path to top of install tree. */ | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
| const char * currDir; /*!< Current working directory. */ | | const char * currDir; /*!< Current working directory. */ | |
| /*@null@*/ | | /*@null@*/ | |
| FD_t scriptFd; /*!< Scriptlet stdout/stderr. */ | | FD_t scriptFd; /*!< Scriptlet stdout/stderr. */ | |
| int delta; /*!< Delta for reallocation. */ | | int delta; /*!< Delta for reallocation. */ | |
|
| uint32_t tid[2]; /*!< Transaction id. */ | | rpmuint32_t tid[2]; /*!< Transaction id. */ | |
| | | | |
|
| uint32_t color; /*!< Transaction color bits. */ | | rpmuint32_t color; /*!< Transaction color bits. */ | |
| uint32_t prefcolor; /*!< Preferred file color. */ | | rpmuint32_t prefcolor; /*!< Preferred file color. */ | |
| | | | |
| /*@observer@*/ /*@dependent@*/ /*@null@*/ | | /*@observer@*/ /*@dependent@*/ /*@null@*/ | |
| const char * fn; /*!< Current package fn. */ | | const char * fn; /*!< Current package fn. */ | |
| | | | |
|
| | | /*@refcounted@*/ /*@relnull@*/ | |
| | | rpmKeyring keyring; /*!< Keyring in use. */ | |
| /*@relnull@*/ | | /*@relnull@*/ | |
|
| uint8_t * pkpkt; /*!< Current pubkey packet. */ | | rpmuint8_t * pkpkt; /*!< Current pubkey packet. */ | |
| size_t pkpktlen; /*!< Current pubkey packet length. */ | | size_t pkpktlen; /*!< Current pubkey packet length. */ | |
|
| uint8_t pksignid[8]; /*!< Current pubkey fingerprint. */ | | rpmuint8_t pksignid[8]; /*!< Current pubkey fingerprint. */ | |
| | | | |
| struct rpmop_s ops[RPMTS_OP_MAX]; | | struct rpmop_s ops[RPMTS_OP_MAX]; | |
| | | | |
| /*@refcounted@*/ /*@relnull@*/ | | /*@refcounted@*/ /*@relnull@*/ | |
| pgpDig dig; /*!< Current signature/pubkey parame
ters. */ | | pgpDig dig; /*!< Current signature/pubkey parame
ters. */ | |
| | | | |
| /*@null@*/ | | /*@null@*/ | |
| Spec spec; /*!< Spec file control structure. */ | | Spec spec; /*!< Spec file control structure. */ | |
| | | | |
|
| uint32_t arbgoal; /*!< Autorollback goal */ | | rpmuint32_t arbgoal; /*!< Autorollback goal */ | |
| | | | |
| #if defined(__LCLINT__) | | #if defined(__LCLINT__) | |
| /*@refs@*/ | | /*@refs@*/ | |
| int nrefs; /*!< (unused) keep splint happy */ | | int nrefs; /*!< (unused) keep splint happy */ | |
| #endif | | #endif | |
| }; | | }; | |
| #endif /* _RPMTS_INTERNAL */ | | #endif /* _RPMTS_INTERNAL */ | |
| | | | |
| #ifdef __cplusplus | | #ifdef __cplusplus | |
| extern "C" { | | extern "C" { | |
| | | | |
| skipping to change at line 477 | | skipping to change at line 480 | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Return transaction database iterator. | | * Return transaction database iterator. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param rpmtag rpm tag | | * @param rpmtag rpm tag | |
| * @param keyp key data (NULL for sequential access) | | * @param keyp key data (NULL for sequential access) | |
| * @param keylen key data length (0 will use strlen(keyp)) | | * @param keylen key data length (0 will use strlen(keyp)) | |
| * @return NULL on failure | | * @return NULL on failure | |
| */ | | */ | |
| /*@only@*/ /*@null@*/ | | /*@only@*/ /*@null@*/ | |
|
| rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, | | rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, | |
| /*@null@*/ const void * keyp, size_t keylen) | | /*@null@*/ const void * keyp, size_t keylen) | |
| /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/ | | /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState
@*/ | |
| /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
; | | /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/
; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Retrieve pubkey from rpm database. | | * Retrieve pubkey from rpm database. | |
| * @param ts rpm transaction | | * @param ts rpm transaction | |
| * @param _dig container (NULL uses rpmtsDig(ts) instead). | | * @param _dig container (NULL uses rpmtsDig(ts) instead). | |
| * @return RPMRC_OK on success, RPMRC_NOKEY if not found | | * @return RPMRC_OK on success, RPMRC_NOKEY if not found | |
| */ | | */ | |
| | | | |
| skipping to change at line 580 | | skipping to change at line 583 | |
| * @param type transaction type | | * @param type transaction type | |
| */ | | */ | |
| void rpmtsSetType(rpmts ts, rpmTSType type) | | void rpmtsSetType(rpmts ts, rpmTSType type) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Return the autorollback goal. | | * Return the autorollback goal. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @return autorollback goal | | * @return autorollback goal | |
| */ | | */ | |
|
| uint32_t rpmtsARBGoal(rpmts ts) | | rpmuint32_t rpmtsARBGoal(rpmts ts) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Set autorollback goal. | | * Set autorollback goal. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param goal autorollback goal | | * @param goal autorollback goal | |
| */ | | */ | |
|
| void rpmtsSetARBGoal(rpmts ts, uint32_t goal) | | void rpmtsSetARBGoal(rpmts ts, rpmuint32_t goal) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Return current transaction set problems. | | * Return current transaction set problems. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @return current problem set (or NULL) | | * @return current problem set (or NULL) | |
| */ | | */ | |
| /*@null@*/ | | /*@null@*/ | |
| rpmps rpmtsProblems(rpmts ts) | | rpmps rpmtsProblems(rpmts ts) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| skipping to change at line 637 | | skipping to change at line 640 | |
| * @return NULL on last dereference | | * @return NULL on last dereference | |
| */ | | */ | |
| /*@null@*/ | | /*@null@*/ | |
| rpmts rpmtsFree(/*@killref@*/ /*@null@*/ rpmts ts) | | rpmts rpmtsFree(/*@killref@*/ /*@null@*/ rpmts ts) | |
| /*@globals fileSystem, internalState @*/ | | /*@globals fileSystem, internalState @*/ | |
| /*@modifies ts, fileSystem, internalState @*/; | | /*@modifies ts, fileSystem, internalState @*/; | |
| #define rpmtsFree(_ts) \ | | #define rpmtsFree(_ts) \ | |
| ((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__,
__LINE__)) | | ((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__,
__LINE__)) | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
|
| | | * Get transaction keyring. | |
| | | * @param ts transaction set | |
| | | * @param autoload Should keyring be loaded? (unimplmented) | |
| | | * @return transaction keyring | |
| | | */ | |
| | | void * rpmtsGetKeyring(rpmts ts, int autoload) | |
| | | /*@*/; | |
| | | | |
| | | /** \ingroup rpmts | |
| | | * Set transaction keyring. | |
| | | * @param ts transaction set | |
| | | * @param _keyring new transaction keyring | |
| | | * @return 0 on success | |
| | | */ | |
| | | int rpmtsSetKeyring(rpmts ts, void * _keyring) | |
| | | /*modifies ts, _keyring @*/; | |
| | | | |
| | | /** \ingroup rpmts | |
| * Get verify signatures flag(s). | | * Get verify signatures flag(s). | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @return verify signatures flags | | * @return verify signatures flags | |
| */ | | */ | |
| rpmVSFlags rpmtsVSFlags(rpmts ts) | | rpmVSFlags rpmtsVSFlags(rpmts ts) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Set verify signatures flag(s). | | * Set verify signatures flag(s). | |
| * @param ts transaction set | | * @param ts transaction set | |
| | | | |
| skipping to change at line 746 | | skipping to change at line 767 | |
| * @return previous chrootDone flag | | * @return previous chrootDone flag | |
| */ | | */ | |
| int rpmtsSetChrootDone(rpmts ts, int chrootDone) | | int rpmtsSetChrootDone(rpmts ts, int chrootDone) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Get transaction id, i.e. transaction time stamp. | | * Get transaction id, i.e. transaction time stamp. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @return transaction id | | * @return transaction id | |
| */ | | */ | |
|
| uint32_t rpmtsGetTid(rpmts ts) | | rpmuint32_t rpmtsGetTid(rpmts ts) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Set transaction id, i.e. transaction time stamp. | | * Set transaction id, i.e. transaction time stamp. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param tid new transaction id | | * @param tid new transaction id | |
| * @return previous transaction id | | * @return previous transaction id | |
| */ | | */ | |
|
| uint32_t rpmtsSetTid(rpmts ts, uint32_t tid) | | rpmuint32_t rpmtsSetTid(rpmts ts, rpmuint32_t tid) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Get OpenPGP packet parameters, i.e. signature/pubkey constants. | | * Get OpenPGP packet parameters, i.e. signature/pubkey constants. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @return signature/pubkey constants. | | * @return signature/pubkey constants. | |
| */ | | */ | |
| pgpDig rpmtsDig(rpmts ts) | | pgpDig rpmtsDig(rpmts ts) | |
| /*@globals fileSystem @*/ | | /*@globals fileSystem @*/ | |
| /*@modifies fileSystem @*/; | | /*@modifies fileSystem @*/; | |
| | | | |
| skipping to change at line 817 | | skipping to change at line 838 | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Update disk space info for a file. | | * Update disk space info for a file. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param dev mount point device | | * @param dev mount point device | |
| * @param fileSize file size | | * @param fileSize file size | |
| * @param prevSize previous file size (if upgrading) | | * @param prevSize previous file size (if upgrading) | |
| * @param fixupSize size difference (if | | * @param fixupSize size difference (if | |
| * @param _action file disposition | | * @param _action file disposition | |
| */ | | */ | |
| void rpmtsUpdateDSI(const rpmts ts, dev_t dev, | | void rpmtsUpdateDSI(const rpmts ts, dev_t dev, | |
|
| uint32_t fileSize, uint32_t prevSize, uint32_t fixupSize, | | rpmuint32_t fileSize, rpmuint32_t prevSize, rpmuint32_t fixu
pSize, | |
| int _action) | | int _action) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Check a transaction element for disk space problems. | | * Check a transaction element for disk space problems. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param te current transaction element | | * @param te current transaction element | |
| */ | | */ | |
| void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) | | void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| skipping to change at line 842 | | skipping to change at line 863 | |
| * used portably | | * used portably | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param te current transaction element | | * @param te current transaction element | |
| * @param what type of call back | | * @param what type of call back | |
| * @param amount current value | | * @param amount current value | |
| * @param total final value | | * @param total final value | |
| * @return callback dependent pointer | | * @return callback dependent pointer | |
| */ | | */ | |
| /*@null@*/ | | /*@null@*/ | |
| void * rpmtsNotify(rpmts ts, rpmte te, | | void * rpmtsNotify(rpmts ts, rpmte te, | |
|
| rpmCallbackType what, uint64_t amount, uint64_t total) | | rpmCallbackType what, rpmuint64_t amount, rpmuint64_t total
) | |
| /*@modifies te @*/; | | /*@modifies te @*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Return number of (ordered) transaction set elements. | | * Return number of (ordered) transaction set elements. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @return no. of transaction set elements | | * @return no. of transaction set elements | |
| */ | | */ | |
| int rpmtsNElements(rpmts ts) | | int rpmtsNElements(rpmts ts) | |
| /*@*/; | | /*@*/; | |
| | | | |
| | | | |
| skipping to change at line 982 | | skipping to change at line 1003 | |
| * @return previous dbmode | | * @return previous dbmode | |
| */ | | */ | |
| int rpmtsSetDBMode(rpmts ts, int dbmode) | | int rpmtsSetDBMode(rpmts ts, int dbmode) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Retrieve color bits of transaction set. | | * Retrieve color bits of transaction set. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @return color bits | | * @return color bits | |
| */ | | */ | |
|
| uint32_t rpmtsColor(rpmts ts) | | rpmuint32_t rpmtsColor(rpmts ts) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Retrieve prefered file color | | * Retrieve prefered file color | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @return color bits | | * @return color bits | |
| */ | | */ | |
|
| uint32_t rpmtsPrefColor(rpmts ts) | | rpmuint32_t rpmtsPrefColor(rpmts ts) | |
| /*@*/; | | /*@*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Set color bits of transaction set. | | * Set color bits of transaction set. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param color new color bits | | * @param color new color bits | |
| * @return previous color bits | | * @return previous color bits | |
| */ | | */ | |
|
| uint32_t rpmtsSetColor(rpmts ts, uint32_t color) | | rpmuint32_t rpmtsSetColor(rpmts ts, rpmuint32_t color) | |
| /*@modifies ts @*/; | | /*@modifies ts @*/; | |
| | | | |
| /** \ingroup rpmts | | /** \ingroup rpmts | |
| * Retrieve operation timestamp from a transaction set. | | * Retrieve operation timestamp from a transaction set. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param opx operation timestamp index | | * @param opx operation timestamp index | |
| * @return pointer to operation timestamp. | | * @return pointer to operation timestamp. | |
| */ | | */ | |
| /*@relnull@*/ | | /*@relnull@*/ | |
| rpmop rpmtsOp(rpmts ts, rpmtsOpX opx) | | rpmop rpmtsOp(rpmts ts, rpmtsOpX opx) | |
| | | | |
| skipping to change at line 1087 | | skipping to change at line 1108 | |
| * Print current transaction set contents. | | * Print current transaction set contents. | |
| * @param ts transaction set | | * @param ts transaction set | |
| * @param fp file handle (NULL uses stderr) | | * @param fp file handle (NULL uses stderr) | |
| * @return 0 always | | * @return 0 always | |
| */ | | */ | |
| /*@unused@*/ static inline | | /*@unused@*/ static inline | |
| int rpmtsPrint(/*@null@*/ rpmts ts, /*@null@*/ FILE * fp) | | int rpmtsPrint(/*@null@*/ rpmts ts, /*@null@*/ FILE * fp) | |
| /*@globals fileSystem @*/ | | /*@globals fileSystem @*/ | |
| /*@modifies ts, *fp, fileSystem @*/ | | /*@modifies ts, *fp, fileSystem @*/ | |
| { | | { | |
|
| uint32_t tid = rpmtsGetTid(ts); | | rpmuint32_t tid = rpmtsGetTid(ts); | |
| time_t ttid = tid; | | time_t ttid = tid; | |
| rpmtsi tsi; | | rpmtsi tsi; | |
| rpmte te; | | rpmte te; | |
| | | | |
| if (fp == NULL) | | if (fp == NULL) | |
| fp = stderr; | | fp = stderr; | |
| | | | |
| fprintf(fp, _("=== Transaction at %-24.24s (0x%08x):\n"), ctime(&ttid),
tid); | | fprintf(fp, _("=== Transaction at %-24.24s (0x%08x):\n"), ctime(&ttid),
tid); | |
| tsi = rpmtsiInit(ts); | | tsi = rpmtsiInit(ts); | |
| while ((te = rpmtsiNext(tsi, 0)) != NULL) | | while ((te = rpmtsiNext(tsi, 0)) != NULL) | |
| | | | |
End of changes. 20 change blocks. |
| 18 lines changed or deleted | | 39 lines changed or added | |
|