Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions include/tscore/HashMD5.h

This file was deleted.

23 changes: 18 additions & 5 deletions include/tscore/INK_MD5.h → include/tscore/MD5.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,34 @@

#pragma once

#include "tscore/ink_code.h"
#include "tscore/ink_defs.h"
#include "tscore/CryptoHash.h"
#include <openssl/evp.h>

class MD5Context : public ats::CryptoContextBase
{
protected:
MD5_CTX _ctx;
EVP_MD_CTX *_ctx;

public:
MD5Context();
MD5Context()
{
_ctx = EVP_MD_CTX_new();
EVP_DigestInit_ex(_ctx, EVP_md5(), nullptr);
}
~MD5Context() { EVP_MD_CTX_free(_ctx); }
/// Update the hash with @a data of @a length bytes.
bool update(void const *data, int length) override;
bool
update(void const *data, int length) override
{
return EVP_DigestUpdate(_ctx, data, length);
}
/// Finalize and extract the @a hash.
bool finalize(CryptoHash &hash) override;
bool
finalize(CryptoHash &hash) override
{
return EVP_DigestFinal_ex(_ctx, hash.u8, nullptr);
}
};

typedef CryptoHash INK_MD5;
1 change: 0 additions & 1 deletion include/tscore/MMH.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#pragma once

#include "tscore/ink_code.h"
#include "tscore/ink_defs.h"
#include "tscore/CryptoHash.h"

Expand Down
1 change: 0 additions & 1 deletion include/tscore/SHA256.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

#pragma once

#include "tscore/ink_code.h"
#include "tscore/ink_defs.h"
#include "tscore/CryptoHash.h"
#include <openssl/evp.h>
Expand Down
42 changes: 0 additions & 42 deletions include/tscore/ink_code.h

This file was deleted.

1 change: 0 additions & 1 deletion mgmt/api/INKMgmtAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
*
***************************************************************************/
#include "tscore/ink_platform.h"
#include "tscore/ink_code.h"
#include "tscore/ink_memory.h"
#include "tscore/ParseRules.h"
#include <climits>
Expand Down
1 change: 0 additions & 1 deletion src/traffic_cache_tool/Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ traffic_cache_tool_traffic_cache_tool_SOURCES = \
traffic_cache_tool_traffic_cache_tool_LDADD = \
$(top_builddir)/src/tscore/.libs/ArgParser.o \
$(top_builddir)/src/tscore/.libs/ink_assert.o \
$(top_builddir)/src/tscore/.libs/ink_code.o \
$(top_builddir)/src/tscore/.libs/ink_error.o \
$(top_builddir)/src/tscore/.libs/ink_file.o \
$(top_builddir)/src/tscore/.libs/ink_memory.o \
Expand Down
5 changes: 3 additions & 2 deletions src/tscore/CryptoHash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@
#include <new>
#include "tscore/ink_assert.h"
#include "tscore/ink_platform.h"
#include "tscore/ink_code.h"
#include "tscore/CryptoHash.h"
#include "tscore/SHA256.h"

#if TS_ENABLE_FIPS == 1
CryptoContext::HashType CryptoContext::Setting = CryptoContext::SHA256;
#else
#include "tscore/INK_MD5.h"
#include "tscore/MD5.h"
#include "tscore/MMH.h"
CryptoContext::HashType CryptoContext::Setting = CryptoContext::MD5;
#endif

ats::CryptoHash const ats::CRYPTO_HASH_ZERO; // default constructed is correct.

CryptoContext::CryptoContext()
{
switch (Setting) {
Expand Down
88 changes: 0 additions & 88 deletions src/tscore/HashMD5.cc

This file was deleted.

2 changes: 0 additions & 2 deletions src/tscore/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ libtscore_la_SOURCES = \
Extendible.cc \
Hash.cc \
HashFNV.cc \
HashMD5.cc \
HashSip.cc \
HostLookup.cc \
hugepages.cc \
ink_args.cc \
ink_assert.cc \
ink_base64.cc \
ink_cap.cc \
ink_code.cc \
ink_defs.cc \
InkErrno.cc \
ink_error.cc \
Expand Down
94 changes: 0 additions & 94 deletions src/tscore/ink_code.cc

This file was deleted.

2 changes: 1 addition & 1 deletion src/tscore/unit_tests/test_BufferWriterFormat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include "tscpp/util/MemSpan.h"
#include "tscore/ink_config.h"
#if TS_ENABLE_FIPS == 0
#include "tscore/INK_MD5.h"
#include "tscore/MD5.h"
#endif
#include "tscore/CryptoHash.h"

Expand Down
2 changes: 1 addition & 1 deletion tools/jtest/jtest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
#include "tscore/ink_error.h"
#include "tscore/ink_memory.h"
#include "tscore/ink_assert.h"
#include "tscore/INK_MD5.h"
#include "tscore/MD5.h"
#include "tscore/ParseRules.h"
#include "tscore/ink_time.h"
#include "tscore/ink_args.h"
Expand Down