diff options
| author | John-Mark Gurney <jmg@FreeBSD.org> | 2015-07-11 03:12:34 +0000 |
|---|---|---|
| committer | John-Mark Gurney <jmg@FreeBSD.org> | 2015-07-11 03:12:34 +0000 |
| commit | 2ff9c4f915f0bf0cc3ff557aa64976b83c038e53 (patch) | |
| tree | cc404fee793de078109b2b87ac2a76e4ef51781c /sys/crypto | |
| parent | 4273d4129936cb50f66b55c79d93f8ff2355df3d (diff) | |
Notes
Diffstat (limited to 'sys/crypto')
| -rw-r--r-- | sys/crypto/sha2/sha256.h | 32 | ||||
| -rw-r--r-- | sys/crypto/sha2/sha256c.c | 15 |
2 files changed, 47 insertions, 0 deletions
diff --git a/sys/crypto/sha2/sha256.h b/sys/crypto/sha2/sha256.h index 80765ef8749d..c828379be5c9 100644 --- a/sys/crypto/sha2/sha256.h +++ b/sys/crypto/sha2/sha256.h @@ -40,6 +40,38 @@ typedef struct SHA256Context { } SHA256_CTX; __BEGIN_DECLS + +/* Ensure libmd symbols do not clash with libcrypto */ + +#ifndef SHA256_Init +#define SHA256_Init _libmd_SHA256_Init +#endif +#ifndef SHA256_Update +#define SHA256_Update _libmd_SHA256_Update +#endif +#ifndef SHA256_Final +#define SHA256_Final _libmd_SHA256_Final +#endif +#ifndef SHA256_End +#define SHA256_End _libmd_SHA256_End +#endif +#ifndef SHA256_File +#define SHA256_File _libmd_SHA256_File +#endif +#ifndef SHA256_FileChunk +#define SHA256_FileChunk _libmd_SHA256_FileChunk +#endif +#ifndef SHA256_Data +#define SHA256_Data _libmd_SHA256_Data +#endif + +#ifndef SHA256_Transform +#define SHA256_Transform _libmd_SHA256_Transform +#endif +#ifndef SHA256_version +#define SHA256_version _libmd_SHA256_version +#endif + void SHA256_Init(SHA256_CTX *); void SHA256_Update(SHA256_CTX *, const void *, size_t); void SHA256_Final(unsigned char [32], SHA256_CTX *); diff --git a/sys/crypto/sha2/sha256c.c b/sys/crypto/sha2/sha256c.c index 9c666df3ee25..da9b02cbd1bf 100644 --- a/sys/crypto/sha2/sha256c.c +++ b/sys/crypto/sha2/sha256c.c @@ -299,3 +299,18 @@ SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx) /* Clear the context state */ memset((void *)ctx, 0, sizeof(*ctx)); } + +#ifdef WEAK_REFS +/* When building libmd, provide weak references. Note: this is not + activated in the context of compiling these sources for internal + use in libcrypt. + */ +#undef SHA256_Init +__weak_reference(_libmd_SHA256_Init, SHA256_Init); +#undef SHA256_Update +__weak_reference(_libmd_SHA256_Update, SHA256_Update); +#undef SHA256_Final +__weak_reference(_libmd_SHA256_Final, SHA256_Final); +#undef SHA256_Transform +__weak_reference(_libmd_SHA256_Transform, SHA256_Transform); +#endif |
