rpm
5.4.15
|
#include "system.h"
#include "rpmio_internal.h"
#include <rpmbc.h>
#include "crc.h"
#include "arirang.h"
#include "blake.h"
#include "blake2-rpm.h"
#include "bmw.h"
#include "chi.h"
#include "cubehash.h"
#include "echo.h"
#include "edon-r.h"
#include "fugue.h"
#include "groestl.h"
#include "hamsi.h"
#include "jh.h"
#include "keccak.h"
#include "lane.h"
#include "luffa.h"
#include "md2.h"
#include "md6.h"
#include "radiogatun.h"
#include "shabal.h"
#include "shavite3.h"
#include "simd.h"
#include "salsa10.h"
#include "salsa20.h"
#include "skein.h"
#include "tib3.h"
#include "tiger.h"
#include "debug.h"
#include "lookup3.c"
Go to the source code of this file.
Data Structures | |
struct | DIGEST_CTX_s |
Digest private data. More... | |
Macros | |
#define | DPRINTF(_a) |
#define | _JLU3_jlu32l |
#define | HMAC_IPAD 0x36 |
#define | HMAC_OPAD 0x5c |
Functions | |
static void | ctxFini (void *_ctx) |
static DIGEST_CTX | ctxGetPool (rpmioPool pool) |
pgpHashAlgo | rpmDigestAlgo (DIGEST_CTX ctx) |
Return digest algorithm identifier. More... | |
rpmDigestFlags | rpmDigestF (DIGEST_CTX ctx) |
Return digest flags. More... | |
const char * | rpmDigestName (DIGEST_CTX ctx) |
Return digest name. More... | |
const char * | rpmDigestASN1 (DIGEST_CTX ctx) |
Return digest ASN1 oid string. More... | |
DIGEST_CTX | rpmDigestDup (DIGEST_CTX octx) |
Duplicate a digest context. More... | |
static int | noopReset (void *param) |
static int | md6_Update (void *param, const byte *_data, size_t _len) |
DIGEST_CTX | rpmDigestInit (pgpHashAlgo hashalgo, rpmDigestFlags flags) |
Initialize digest context. More... | |
int | rpmDigestUpdate (DIGEST_CTX ctx, const void *data, size_t len) |
Update context with next plain text buffer. More... | |
int | rpmDigestFinal (DIGEST_CTX ctx, void *datap, size_t *lenp, int asAscii) |
Return digest and destroy context. More... | |
int | rpmHmacInit (DIGEST_CTX ctx, const void *key, size_t keylen) |
Compute key material and add to digest context. More... | |
Variables | |
int | _ctx_debug = 0 |
rpmioPool | _ctxPool |
#define DPRINTF | ( | _a | ) |
Definition at line 118 of file digest.c.
Referenced by rpmDigestFinal(), rpmDigestInit(), rpmDigestUpdate(), and rpmHmacInit().
#define HMAC_IPAD 0x36 |
Definition at line 996 of file digest.c.
Referenced by rpmHmacInit().
#define HMAC_OPAD 0x5c |
Definition at line 997 of file digest.c.
Referenced by rpmDigestFinal().
|
static |
Definition at line 151 of file digest.c.
References _free(), DIGEST_CTX_s::asn1, DIGEST_CTX_s::blocksize, DIGEST_CTX_s::Digest, DIGEST_CTX_s::digestsize, DIGEST_CTX_s::flags, DIGEST_CTX_s::hashalgo, DIGEST_CTX_s::name, DIGEST_CTX_s::param, DIGEST_CTX_s::paramsize, DIGEST_CTX_s::Reset, DIGEST_CTX_s::salt, and DIGEST_CTX_s::Update.
Referenced by ctxGetPool().
|
static |
Definition at line 176 of file digest.c.
References _ctx_debug, _ctxPool, DIGEST_CTX_s::_item, ANNOTATE_BENIGN_RACE, ctxFini(), rpmioGetPool(), and rpmioNewPool().
Referenced by rpmDigestDup(), and rpmDigestInit().
|
static |
Definition at line 241 of file digest.c.
Referenced by rpmDigestInit().
|
static |
Definition at line 235 of file digest.c.
Referenced by rpmDigestInit().
pgpHashAlgo rpmDigestAlgo | ( | DIGEST_CTX | ctx | ) |
Return digest algorithm identifier.
ctx | digest context |
Definition at line 191 of file digest.c.
References DIGEST_CTX_s::hashalgo, and PGPHASHALGO_NONE.
Referenced by fdFiniDigest(), fdStealDigest(), rpmbcSetDSA(), rpmbcSetECDSA(), rpmbcSetELG(), rpmbcSetRSA(), verifyDSA(), verifyECDSA(), and verifyRSA().
const char* rpmDigestASN1 | ( | DIGEST_CTX | ctx | ) |
Return digest ASN1 oid string.
Values from PKCS#1 v2.1 (aka RFC-3447).
ctx | digest context |
Definition at line 206 of file digest.c.
References DIGEST_CTX_s::asn1.
Referenced by rpmbcSetRSA().
DIGEST_CTX rpmDigestDup | ( | DIGEST_CTX | octx | ) |
Duplicate a digest context.
octx | existing digest context |
Definition at line 212 of file digest.c.
References DIGEST_CTX_s::asn1, DIGEST_CTX_s::blocksize, ctxGetPool(), DIGEST_CTX_s::Digest, DIGEST_CTX_s::digestsize, DRD_xmalloc, DIGEST_CTX_s::flags, DIGEST_CTX_s::hashalgo, DIGEST_CTX_s::name, DIGEST_CTX_s::param, DIGEST_CTX_s::paramsize, DIGEST_CTX_s::Reset, rpmioLinkPoolItem(), DIGEST_CTX_s::salt, and DIGEST_CTX_s::Update.
Referenced by verifyDSA(), verifyECDSA(), verifyMD5(), verifyRSA(), verifySHA1(), and writeRPM().
rpmDigestFlags rpmDigestF | ( | DIGEST_CTX | ctx | ) |
Return digest flags.
ctx | digest context |
Definition at line 196 of file digest.c.
References DIGEST_CTX_s::flags, and RPMDIGEST_NONE.
int rpmDigestFinal | ( | DIGEST_CTX | ctx, |
void * | datap, | ||
size_t * | lenp, | ||
int | asAscii | ||
) |
Return digest and destroy context.
ctx | digest context |
*datap | digest |
*lenp | no. bytes of digest |
asAscii | return digest as ascii string? |
Definition at line 1000 of file digest.c.
References _free(), DIGEST_CTX_s::blocksize, DIGEST_CTX_s::Digest, DIGEST_CTX_s::digestsize, DPRINTF, DRD_xmalloc, DIGEST_CTX_s::hashalgo, HMAC_OPAD, i, DIGEST_CTX_s::name, DIGEST_CTX_s::param, RPMDIGEST_NONE, rpmDigestFinal(), rpmDigestInit(), rpmDigestUpdate(), rpmioFreePoolItem(), and DIGEST_CTX_s::salt.
Referenced by _tagGenerate(), digestFormat(), dodigest(), fdFini(), fdFiniDigest(), makeHDRSignature(), mongo_cmd_authenticate(), mongo_pass_digest(), pgpDigFini(), pgpPubkeyFingerprint(), rpmbcSetDSA(), rpmbcSetECDSA(), rpmbcSetELG(), rpmbcSetRSA(), rpmcliImportPubkey(), rpmdcParseZeroInstall(), rpmDigestFinal(), rpmhkpVerifyHash(), rpmHmacInit(), rpmrepoRfileDigest(), unsatisfiedDepend(), verifyMD5(), and verifySHA1().
DIGEST_CTX rpmDigestInit | ( | pgpHashAlgo | hashalgo, |
rpmDigestFlags | flags | ||
) |
Initialize digest context.
Set bit count to 0 and buffer to mysterious initialization constants.
hashalgo | type of digest |
flags | bit(s) to control digest operation |
Definition at line 247 of file digest.c.
References __adler32(), __adler32_combine(), __crc32(), __crc32_combine(), __crc64(), __crc64_combine(), DIGEST_CTX_s::asn1, DIGEST_CTX_s::blocksize, sum32Param::combine, sum64Param::combine, ctxGetPool(), d, DIGEST_CTX_s::Digest, DIGEST_CTX_s::digestsize, DPRINTF, DRD_xcalloc, DIGEST_CTX_s::flags, flags, DIGEST_CTX_s::hashalgo, L, md6_Update(), DIGEST_CTX_s::name, noopReset(), DIGEST_CTX_s::param, DIGEST_CTX_s::paramsize, PGPHASHALGO_ADLER32, PGPHASHALGO_ARIRANG_224, PGPHASHALGO_ARIRANG_256, PGPHASHALGO_ARIRANG_384, PGPHASHALGO_ARIRANG_512, PGPHASHALGO_BLAKE2B, PGPHASHALGO_BLAKE2BP, PGPHASHALGO_BLAKE2S, PGPHASHALGO_BLAKE2SP, PGPHASHALGO_BLAKE_224, PGPHASHALGO_BLAKE_256, PGPHASHALGO_BLAKE_384, PGPHASHALGO_BLAKE_512, PGPHASHALGO_BMW_224, PGPHASHALGO_BMW_256, PGPHASHALGO_BMW_384, PGPHASHALGO_BMW_512, PGPHASHALGO_CHI_224, PGPHASHALGO_CHI_256, PGPHASHALGO_CHI_384, PGPHASHALGO_CHI_512, PGPHASHALGO_CRC32, PGPHASHALGO_CRC64, PGPHASHALGO_CUBEHASH_224, PGPHASHALGO_CUBEHASH_256, PGPHASHALGO_CUBEHASH_384, PGPHASHALGO_CUBEHASH_512, PGPHASHALGO_ECHO_224, PGPHASHALGO_ECHO_256, PGPHASHALGO_ECHO_384, PGPHASHALGO_ECHO_512, PGPHASHALGO_EDONR_224, PGPHASHALGO_EDONR_256, PGPHASHALGO_EDONR_384, PGPHASHALGO_EDONR_512, PGPHASHALGO_FUGUE_224, PGPHASHALGO_FUGUE_256, PGPHASHALGO_FUGUE_384, PGPHASHALGO_FUGUE_512, PGPHASHALGO_GROESTL_224, PGPHASHALGO_GROESTL_256, PGPHASHALGO_GROESTL_384, PGPHASHALGO_GROESTL_512, PGPHASHALGO_HAMSI_224, PGPHASHALGO_HAMSI_256, PGPHASHALGO_HAMSI_384, PGPHASHALGO_HAMSI_512, PGPHASHALGO_HAVAL_5_160, PGPHASHALGO_JH_224, PGPHASHALGO_JH_256, PGPHASHALGO_JH_384, PGPHASHALGO_JH_512, PGPHASHALGO_JLU32, PGPHASHALGO_KECCAK_224, PGPHASHALGO_KECCAK_256, PGPHASHALGO_KECCAK_384, PGPHASHALGO_KECCAK_512, PGPHASHALGO_LANE_224, PGPHASHALGO_LANE_256, PGPHASHALGO_LANE_384, PGPHASHALGO_LANE_512, PGPHASHALGO_LUFFA_224, PGPHASHALGO_LUFFA_256, PGPHASHALGO_LUFFA_384, PGPHASHALGO_LUFFA_512, PGPHASHALGO_MD2, PGPHASHALGO_MD4, PGPHASHALGO_MD5, PGPHASHALGO_MD6_224, PGPHASHALGO_MD6_256, PGPHASHALGO_MD6_384, PGPHASHALGO_MD6_512, PGPHASHALGO_RG32_256, PGPHASHALGO_RG64_256, PGPHASHALGO_RIPEMD128, PGPHASHALGO_RIPEMD160, PGPHASHALGO_RIPEMD256, PGPHASHALGO_RIPEMD320, PGPHASHALGO_SALSA10, PGPHASHALGO_SALSA20, PGPHASHALGO_SHA1, PGPHASHALGO_SHA224, PGPHASHALGO_SHA256, PGPHASHALGO_SHA384, PGPHASHALGO_SHA512, PGPHASHALGO_SHABAL_224, PGPHASHALGO_SHABAL_256, PGPHASHALGO_SHABAL_384, PGPHASHALGO_SHABAL_512, PGPHASHALGO_SHAVITE3_224, PGPHASHALGO_SHAVITE3_256, PGPHASHALGO_SHAVITE3_384, PGPHASHALGO_SHAVITE3_512, PGPHASHALGO_SIMD_224, PGPHASHALGO_SIMD_256, PGPHASHALGO_SIMD_384, PGPHASHALGO_SIMD_512, PGPHASHALGO_SKEIN_1024, PGPHASHALGO_SKEIN_224, PGPHASHALGO_SKEIN_256, PGPHASHALGO_SKEIN_384, PGPHASHALGO_SKEIN_512, PGPHASHALGO_TIB3_224, PGPHASHALGO_TIB3_256, PGPHASHALGO_TIB3_384, PGPHASHALGO_TIB3_512, PGPHASHALGO_TIGER192, DIGEST_CTX_s::Reset, rpmioFreePoolItem(), rpmioLinkPoolItem(), DIGEST_CTX_s::salt, sum32Digest(), sum32Reset(), sum32Update(), sum64Digest(), sum64Reset(), sum64Update(), sum32Param::update, sum64Param::update, and DIGEST_CTX_s::Update.
Referenced by _tagGenerate(), digestFormat(), dodigest(), fdInitDigest(), hBlobDigest(), makeHDRSignature(), mongo_cmd_authenticate(), mongo_pass_digest(), pgpPubkeyFingerprint(), readFile(), rpmcliImportPubkey(), rpmdcParseZeroInstall(), rpmDigestFinal(), rpmhkpHashKey(), rpmHmacInit(), rpmnsProbeSignature(), rpmrepoRfileDigest(), and unsatisfiedDepend().
const char* rpmDigestName | ( | DIGEST_CTX | ctx | ) |
Return digest name.
ctx | digest context |
Definition at line 201 of file digest.c.
References DIGEST_CTX_s::name.
Referenced by rpmhkpVerifyHash(), verifyDSA(), verifyECDSA(), verifyMD5(), verifyRSA(), and verifySHA1().
int rpmDigestUpdate | ( | DIGEST_CTX | ctx, |
const void * | data, | ||
size_t | len | ||
) |
Update context with next plain text buffer.
ctx | digest context |
data | next data buffer |
len | no. bytes of data |
Definition at line 986 of file digest.c.
References DPRINTF, DIGEST_CTX_s::name, DIGEST_CTX_s::param, and DIGEST_CTX_s::Update.
Referenced by _tagGenerate(), digestFormat(), dodigest(), fdUpdateDigests(), hBlobDigest(), makeHDRSignature(), mongo_cmd_authenticate(), mongo_pass_digest(), pgpPubkeyFingerprint(), readFile(), rpmbcExportSignature(), rpmcliImportPubkey(), rpmdcParseZeroInstall(), rpmDigestFinal(), rpmhkpUpdate(), rpmHmacInit(), rpmnsProbeSignature(), rpmrepoRfileDigest(), unsatisfiedDepend(), verifyDSA(), verifyECDSA(), and verifyRSA().
int rpmHmacInit | ( | DIGEST_CTX | ctx, |
const void * | key, | ||
size_t | keylen | ||
) |
Compute key material and add to digest context.
ctx | digest context |
key | HMAC key (NULL does digest instead) |
keylen | HMAC key length(bytes) (0 uses strlen(key)) |
Definition at line 1062 of file digest.c.
References _free(), DIGEST_CTX_s::blocksize, DPRINTF, DRD_xcalloc, DIGEST_CTX_s::hashalgo, HMAC_IPAD, i, DIGEST_CTX_s::name, RPMDIGEST_NONE, rpmDigestFinal(), rpmDigestInit(), rpmDigestUpdate(), and DIGEST_CTX_s::salt.
Referenced by dodigest(), fdInitHmac(), and rpmdcParseZeroInstall().
int _ctx_debug = 0 |
Definition at line 113 of file digest.c.
Referenced by ctxGetPool().
rpmioPool _ctxPool |
Definition at line 174 of file digest.c.
Referenced by ctxGetPool(), and rpmioClean().