diff options
author | Julian Andres Klode <jak@debian.org> | 2020-01-14 12:57:54 +0000 |
---|---|---|
committer | Julian Andres Klode <jak@debian.org> | 2020-01-14 12:57:54 +0000 |
commit | 5db3a38926aa820546c411dd9f49f57eea24cd9e (patch) | |
tree | b794739c375d7c984c4190be44b9ed678e9bf0da /apt-pkg/contrib/hashes.h | |
parent | cfeae24843e8357c7e8d2ff3b23ee81cac330017 (diff) | |
parent | 8c1a37e12790a23f3b132899485e011f9134b483 (diff) |
Merge branch 'pu/gcrypt2' into 'master'
Use Libgcrypt for hashing purposes
See merge request apt-team/apt!89
Diffstat (limited to 'apt-pkg/contrib/hashes.h')
-rw-r--r-- | apt-pkg/contrib/hashes.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index e9b8a0519..dad50c564 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -171,12 +171,14 @@ class PrivateHashes; class Hashes { PrivateHashes * const d; +APT_IGNORE_DEPRECATED_PUSH /* TODO: those will disappear in the future as it is hard to add new ones this way. * Use Add* to build the results and get them via GetHashStringList() instead */ - MD5Summation MD5; - SHA1Summation SHA1; - SHA256Summation SHA256; - SHA512Summation SHA512; + MD5Summation MD5 APT_PKG_590("Remove"); + SHA1Summation SHA1 APT_PKG_590("Remove"); + SHA256Summation SHA256 APT_PKG_590("Remove"); + SHA512Summation SHA512 APT_PKG_590("Remove"); +APT_IGNORE_DEPRECATED_POP public: static const int UntilEOF = 0; @@ -184,6 +186,10 @@ class Hashes bool Add(const unsigned char * const Data, unsigned long long const Size) APT_NONNULL(2); inline bool Add(const char * const Data) APT_NONNULL(2) {return Add(reinterpret_cast<unsigned char const *>(Data),strlen(Data));}; + inline bool Add(const char *const Data, unsigned long long const Size) APT_NONNULL(2) + { + return Add(reinterpret_cast<unsigned char const *>(Data), Size); + }; inline bool Add(const unsigned char * const Beg,const unsigned char * const End) APT_NONNULL(2,3) {return Add(Beg,End-Beg);}; @@ -194,6 +200,9 @@ class Hashes HashStringList GetHashStringList(); + /** Get a specific hash. It is an error to use a hash that was not hashes */ + HashString GetHashString(SupportedHashes hash); + /** create a Hashes object to calculate all supported hashes * * If ALL is too much, you can limit which Hashes are calculated |