Use the bundled sha1 implementation instead of relying on openssl

This simplifies running tests on platforms where OpenSSL isn't
commonly available.
This commit is contained in:
Martin Storsjö 2014-01-17 10:39:42 +02:00
parent e8a2cf6d1f
commit 4f5fd952b6
3 changed files with 8 additions and 2 deletions

View File

@ -82,7 +82,7 @@ H264ENC_INCLUDES = $(ENCODER_INCLUDES) -Icodec/console/enc/inc
H264ENC_LDFLAGS = -L. $(call LINK_LIB,encoder) $(call LINK_LIB,processing) $(call LINK_LIB,common)
H264ENC_DEPS = $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
CODEC_UNITTEST_LDFLAGS = -L. -lgtest -ldecoder -lcrypto -lencoder -lprocessing -lcommon
CODEC_UNITTEST_LDFLAGS = -L. -lgtest -ldecoder -lencoder -lprocessing -lcommon
CODEC_UNITTEST_DEPS = $(LIBPREFIX)gtest.$(LIBSUFFIX) $(LIBPREFIX)decoder.$(LIBSUFFIX) $(LIBPREFIX)encoder.$(LIBSUFFIX) $(LIBPREFIX)processing.$(LIBSUFFIX) $(LIBPREFIX)common.$(LIBSUFFIX)
.PHONY: test gtest-bootstrap clean

View File

@ -77,6 +77,12 @@ void SHA1Input( SHA1Context *,
const unsigned char *,
unsigned);
#define SHA_DIGEST_LENGTH 20
#define SHA_CTX SHA1Context
#define SHA1_Init(ctx) SHA1Reset(ctx)
#define SHA1_Update(ctx, d, l) SHA1Input(ctx, d, l)
#define SHA1_Final(d, ctx) SHA1Result(ctx, d)
#ifdef __cplusplus
}
#endif

View File

@ -3,7 +3,7 @@
#include <stdio.h>
#include <string.h>
#include <openssl/sha.h>
#include "../sha1.h"
static bool CompareHash(const unsigned char* digest, const char* hashStr) {
char hashStrCmp[SHA_DIGEST_LENGTH * 2 + 1];