diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-02-26 12:57:46 +0100 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-02-26 16:31:20 +0100 |
commit | f53a120320cd09d572658d424badc5485f1b9182 (patch) | |
tree | 41d00b0c22825066c544b40924e62c31dbc81fa7 /apt-pkg/contrib/hashes.h | |
parent | 97bd7e492bad1ef50f2659faef61b409ffe67311 (diff) |
hashes: Remove deprecated functions
This keeps the members in the class, but makes them private. We
want to migrate to libgcrypt eventually, since we already use
libgcrypt through gpgv anyway.
Diffstat (limited to 'apt-pkg/contrib/hashes.h')
-rw-r--r-- | apt-pkg/contrib/hashes.h | 43 |
1 files changed, 6 insertions, 37 deletions
diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index 28bfd3459..9ef2945d7 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -53,8 +53,6 @@ class HashString // get hash type used std::string HashType() const { return Type; }; std::string HashValue() const { return Hash; }; - APT_DEPRECATED_MSG("method was const-ified") std::string HashType() { return Type; }; - APT_DEPRECATED_MSG("method was const-ified") std::string HashValue() { return Hash; }; // verify the given filename against the currently loaded hash bool VerifyFile(std::string filename) const; @@ -182,19 +180,17 @@ class PrivateHashes; class Hashes { PrivateHashes * const d; - - public: - /* those will disappear in the future as it is hard to add new ones this way. + /* 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 */ - APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") MD5Summation MD5; - APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA1Summation SHA1; - APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA256Summation SHA256; - APT_DEPRECATED_MSG("Use general .Add* and .GetHashStringList methods instead of hardcoding specific hashes") SHA512Summation SHA512; + MD5Summation MD5; + SHA1Summation SHA1; + SHA256Summation SHA256; + SHA512Summation SHA512; + public: static const int UntilEOF = 0; bool Add(const unsigned char * const Data, unsigned long long const Size) APT_NONNULL(2); - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool Add(const unsigned char * const Data, unsigned long long const Size, unsigned int const Hashes) 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 unsigned char * const Beg,const unsigned char * const End) APT_NONNULL(2,3) @@ -203,13 +199,10 @@ class Hashes enum SupportedHashes { MD5SUM = (1 << 0), SHA1SUM = (1 << 1), SHA256SUM = (1 << 2), SHA512SUM = (1 << 3) }; bool AddFD(int const Fd,unsigned long long Size = 0); - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(int const Fd,unsigned long long Size, unsigned int const Hashes); bool AddFD(FileFd &Fd,unsigned long long Size = 0); - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(FileFd &Fd,unsigned long long Size, unsigned int const Hashes); HashStringList GetHashStringList(); -APT_IGNORE_DEPRECATED_PUSH /** create a Hashes object to calculate all supported hashes * * If ALL is too much, you can limit which Hashes are calculated @@ -221,30 +214,6 @@ APT_IGNORE_DEPRECATED_PUSH /** @param Hashes is a list of hashes */ Hashes(HashStringList const &Hashes); virtual ~Hashes(); -APT_IGNORE_DEPRECATED_POP - - private: - APT_HIDDEN APT_PURE inline unsigned int boolsToFlag(bool const addMD5, bool const addSHA1, bool const addSHA256, bool const addSHA512) - { - unsigned int hashes = ~0; - if (addMD5 == false) hashes &= ~MD5SUM; - if (addSHA1 == false) hashes &= ~SHA1SUM; - if (addSHA256 == false) hashes &= ~SHA256SUM; - if (addSHA512 == false) hashes &= ~SHA512SUM; - return hashes; - } - - public: -APT_IGNORE_DEPRECATED_PUSH - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(int const Fd, unsigned long long Size, bool const addMD5, - bool const addSHA1, bool const addSHA256, bool const addSHA512) { - return AddFD(Fd, Size, boolsToFlag(addMD5, addSHA1, addSHA256, addSHA512)); - }; - APT_DEPRECATED_MSG("Construct accordingly instead of choosing hashes while adding") bool AddFD(FileFd &Fd, unsigned long long Size, bool const addMD5, - bool const addSHA1, bool const addSHA256, bool const addSHA512) { - return AddFD(Fd, Size, boolsToFlag(addMD5, addSHA1, addSHA256, addSHA512)); - }; -APT_IGNORE_DEPRECATED_POP }; #endif |