diff options
author | Adam Langley <agl@chromium.org> | 2014-08-22 22:06:14 +0400 |
---|---|---|
committer | Adam Langley <agl@google.com> | 2014-08-27 01:51:48 +0400 |
commit | c9eb7eac86a3f07bf23b35b7ce24382e158056fc (patch) | |
tree | c6468a0a76286c9724929ab3888b9a73b821d747 /crypto/digest | |
parent | 8da990677b852daff3f6e4a10d9c80c7b4822a06 (diff) |
Readd MD4.
Sadly this is needed by wpa_supplicant for NTLM hashes.
Change-Id: I1c362c676a11ee01f301ff6fbd33d0669396ea23
Reviewed-on: https://boringssl-review.googlesource.com/1620
Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/digest')
-rw-r--r-- | crypto/digest/digests.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/crypto/digest/digests.c b/crypto/digest/digests.c index b757ea88..e3d3a871 100644 --- a/crypto/digest/digests.c +++ b/crypto/digest/digests.c @@ -56,6 +56,7 @@ #include <openssl/digest.h> +#include <openssl/md4.h> #include <openssl/md5.h> #include <openssl/obj.h> #include <openssl/sha.h> @@ -63,6 +64,24 @@ #include "internal.h" +static int md4_init(EVP_MD_CTX *ctx) { return MD4_Init(ctx->md_data); } + +static int md4_update(EVP_MD_CTX *ctx, const void *data, size_t count) { + return MD4_Update(ctx->md_data, data, count); +} + +static int md4_final(EVP_MD_CTX *ctx, unsigned char *out) { + return MD4_Final(out, ctx->md_data); +} + +static const EVP_MD md4_md = { + NID_md4, MD4_DIGEST_LENGTH, 0 /* flags */, md4_init, + md4_update, md4_final, 64 /* block size */, sizeof(MD4_CTX), +}; + +const EVP_MD *EVP_md4(void) { return &md4_md; } + + static int md5_init(EVP_MD_CTX *ctx) { return MD5_Init(ctx->md_data); } static int md5_update(EVP_MD_CTX *ctx, const void *data, size_t count) { |