mirror of
https://github.com/OpenVPN/openvpn3.git
synced 2024-09-20 12:12:15 +02:00
aec6ba3b71
Signed-off-by: Arne Schwabe <arne@openvpn.net>
20 lines
622 B
C++
20 lines
622 B
C++
#include "test_common.h"
|
|
|
|
#include <openvpn/common/file.hpp>
|
|
#include <openvpn/ssl/sslchoose.hpp>
|
|
#include <openvpn/crypto/cryptoalgs.hpp>
|
|
#include <openvpn/crypto/hashstr.hpp>
|
|
|
|
using namespace openvpn;
|
|
|
|
TEST(crypto, hashstr) {
|
|
const std::string content = read_text_utf8(UNITTEST_SOURCE_DIR "/input/1984.txt");
|
|
|
|
DigestFactory::Ptr digest_factory(new CryptoDigestFactory<SSLLib::CryptoAPI>());
|
|
HashString hash(*digest_factory, CryptoAlgs::MD5);
|
|
hash.update(content);
|
|
const std::string actual = hash.final_hex();
|
|
const std::string expected = "2bea7a83bf94971af26372126ebba7e3";
|
|
ASSERT_EQ (actual, expected);
|
|
}
|