libshared: move md5 to BPrivate namespace
Otherwise it clashes with the implementation in OpenSSL which uses the same names but now has a different ABI. Change-Id: I5cb3ff97d7b28de978cdcbd8a06f25f65fb53784 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2854 Reviewed-by: Kyle Ambroff-Kao <[email protected]> Reviewed-by: Jérôme Duval <[email protected]>
This commit is contained in:
committed by
Adrien Destugues
parent
6307201bac
commit
6b0e92ebd4
@@ -25,9 +25,7 @@
|
|||||||
#ifndef _MD5_H
|
#ifndef _MD5_H
|
||||||
#define _MD5_H
|
#define _MD5_H
|
||||||
|
|
||||||
#ifdef __cplusplus
|
namespace BPrivate {
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Any 32-bit or wider unsigned integer data type will do */
|
/* Any 32-bit or wider unsigned integer data type will do */
|
||||||
typedef unsigned int MD5_u32plus;
|
typedef unsigned int MD5_u32plus;
|
||||||
@@ -43,8 +41,8 @@ extern void MD5_Init(MD5_CTX *ctx);
|
|||||||
extern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
|
extern void MD5_Update(MD5_CTX *ctx, const void *data, unsigned long size);
|
||||||
extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
|
extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
using namespace BPrivate;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -21,13 +21,13 @@
|
|||||||
#define PRINT(x)
|
#define PRINT(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#ifdef OPENSSL_ENABLED
|
#ifdef OPENSSL_ENABLED
|
||||||
|
extern "C" {
|
||||||
#include <openssl/md5.h>
|
#include <openssl/md5.h>
|
||||||
|
};
|
||||||
#else
|
#else
|
||||||
#include "md5.h"
|
#include "md5.h"
|
||||||
#endif
|
#endif
|
||||||
};
|
|
||||||
|
|
||||||
#ifndef MD5_DIGEST_LENGTH
|
#ifndef MD5_DIGEST_LENGTH
|
||||||
#define MD5_DIGEST_LENGTH 16
|
#define MD5_DIGEST_LENGTH 16
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
|
|||||||
Json.cpp
|
Json.cpp
|
||||||
Keymap.cpp
|
Keymap.cpp
|
||||||
LongAndDragTrackingFilter.cpp
|
LongAndDragTrackingFilter.cpp
|
||||||
md5.c
|
md5.cpp
|
||||||
MessageBuilder.cpp
|
MessageBuilder.cpp
|
||||||
NaturalCompare.cpp
|
NaturalCompare.cpp
|
||||||
PromptWindow.cpp
|
PromptWindow.cpp
|
||||||
|
|||||||
@@ -85,6 +85,9 @@
|
|||||||
(ctx->block[(n)])
|
(ctx->block[(n)])
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
namespace BPrivate {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This processes one or more 64-byte data blocks, but does NOT update
|
* This processes one or more 64-byte data blocks, but does NOT update
|
||||||
* the bit counters. There are no alignment requirements.
|
* the bit counters. There are no alignment requirements.
|
||||||
@@ -95,7 +98,7 @@ static const void *body(MD5_CTX *ctx, const void *data, unsigned long size)
|
|||||||
MD5_u32plus a, b, c, d;
|
MD5_u32plus a, b, c, d;
|
||||||
MD5_u32plus saved_a, saved_b, saved_c, saved_d;
|
MD5_u32plus saved_a, saved_b, saved_c, saved_d;
|
||||||
|
|
||||||
ptr = data;
|
ptr = (const unsigned char*)data;
|
||||||
|
|
||||||
a = ctx->a;
|
a = ctx->a;
|
||||||
b = ctx->b;
|
b = ctx->b;
|
||||||
@@ -291,3 +294,5 @@ void MD5_Final(unsigned char *result, MD5_CTX *ctx)
|
|||||||
|
|
||||||
memset(ctx, 0, sizeof(*ctx));
|
memset(ctx, 0, sizeof(*ctx));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user