From 9de95b4400754855467554906be88d9da400c582 Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Mon, 27 Jul 2015 00:37:22 -0400 Subject: Cleared "auto_ptr is deprecated" warning. Switch to unique_ptr when C++11 is in effect --- oaep.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'oaep.cpp') diff --git a/oaep.cpp b/oaep.cpp index 7c1a7ba6..f293b7e5 100644 --- a/oaep.cpp +++ b/oaep.cpp @@ -20,6 +20,12 @@ void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputL { CRYPTOPP_ASSERT (inputLength <= MaxUnpaddedLength(oaepBlockLen)); +#if defined(CRYPTOPP_CXX11) + std::unique_ptr pHash(NewHash()); +#else + std::auto_ptr pHash(NewHash()); +#endif + // convert from bit length to byte length if (oaepBlockLen % 8 != 0) { @@ -28,7 +34,6 @@ void OAEP_Base::Pad(RandomNumberGenerator &rng, const byte *input, size_t inputL } oaepBlockLen /= 8; - std::auto_ptr pHash(NewHash()); const size_t hLen = pHash->DigestSize(); const size_t seedLen = hLen, dbLen = oaepBlockLen-seedLen; byte *const maskedSeed = oaepBlock; -- cgit v1.2.1