Fix weak aliasing after recent changes.

Inspired by comments from christos@, xtraeme@, mlelstv@, mhitch@, mrg@,
and uwe@; all the bugs are mine.
This commit is contained in:
elad 2005-09-25 22:20:59 +00:00
parent 3955cf65f9
commit da7e4f7332
7 changed files with 87 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: hash.c,v 1.3 2005/09/24 19:30:06 elad Exp $ */
/* $NetBSD: hash.c,v 1.4 2005/09/25 22:20:59 elad Exp $ */
/*
* ----------------------------------------------------------------------------
@ -47,6 +47,15 @@
#define HASH_LEN CONCAT(HASH_ALGORITHM,_DIGEST_LENGTH)
#define HASH_STRLEN CONCAT(HASH_ALGORITHM,_DIGEST_STRING_LENGTH)
#if !defined(_KERNEL) && defined(__weak_alias)
#define WA(a,b) __weak_alias(a,b)
WA(FNPREFIX(End),CONCAT(_,FNPREFIX(End)))
WA(FNPREFIX(FileChunk),CONCAT(_,FNPREFIX(FileChunk)))
WA(FNPREFIX(File),CONCAT(_,FNPREFIX(File)))
WA(FNPREFIX(Data),CONCAT(_,FNPREFIX(Data)))
#undef WA
#endif
char *
FNPREFIX(End)(HASH_CTX *ctx, char *buf)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: md2.c,v 1.1 2005/09/24 20:51:14 elad Exp $ */
/* $NetBSD: md2.c,v 1.2 2005/09/25 22:20:59 elad Exp $ */
/*
* Copyright (c) 2001 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: md2.c,v 1.1 2005/09/24 20:51:14 elad Exp $");
__RCSID("$NetBSD: md2.c,v 1.2 2005/09/25 22:20:59 elad Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -108,6 +108,7 @@ static void MD2Transform __P((MD2_CTX *));
__weak_alias(MD2Init,_MD2Init)
__weak_alias(MD2Update,_MD2Update)
__weak_alias(MD2Final,_MD2Final)
__weak_alias(MD2Transform,_MD2Transform)
#endif
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: rmd160.c,v 1.2 2005/09/24 22:09:07 elad Exp $ */
/* $NetBSD: rmd160.c,v 1.3 2005/09/25 22:20:59 elad Exp $ */
/* $KAME: rmd160.c,v 1.2 2003/07/25 09:37:55 itojun Exp $ */
/* $OpenBSD: rmd160.c,v 1.3 2001/09/26 21:40:13 markus Exp $ */
/*
@ -95,6 +95,13 @@ static const u_char PADDING[64] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
#ifdef __weak_alias
__weak_alias(RMD160Init,_RMD160Init)
__weak_alias(RMD160Update,_RMD160Update)
__weak_alias(RMD160Final,_RMD160Final)
__weak_alias(RMD160Transform,_RMD160Transform)
#endif
void
RMD160Init(RMD160_CTX *ctx)
{

View File

@ -1,4 +1,4 @@
/* $NetBSD: sha2.c,v 1.3 2005/08/26 15:58:17 elad Exp $ */
/* $NetBSD: sha2.c,v 1.4 2005/09/25 22:20:59 elad Exp $ */
/* $KAME: sha2.c,v 1.9 2003/07/20 00:28:38 itojun Exp $ */
/*
@ -308,6 +308,23 @@ const static sha2_word64 sha512_initial_hash_value[8] = {
0x5be0cd19137e2179ULL
};
#ifdef __weak_alias
__weak_alias(SHA256_Init,_SHA256_Init)
__weak_alias(SHA256_Update,_SHA256_Update)
__weak_alias(SHA256_Final,_SHA256_Final)
__weak_alias(SHA256_Transform,_SHA256_Transform)
__weak_alias(SHA384_Init,_SHA384_Init)
__weak_alias(SHA384_Update,_SHA384_Update)
__weak_alias(SHA384_Final,_SHA384_Final)
__weak_alias(SHA384_Transform,_SHA384_Transform)
__weak_alias(SHA512_Init,_SHA512_Init)
__weak_alias(SHA512_Update,_SHA512_Update)
__weak_alias(SHA512_Final,_SHA512_Final)
__weak_alias(SHA512_Transform,_SHA512_Transform)
#endif
/*** SHA-256: *********************************************************/
void SHA256_Init(SHA256_CTX* context) {
if (context == (SHA256_CTX*)0) {

View File

@ -1,4 +1,4 @@
/* $NetBSD: namespace.h,v 1.107 2005/09/25 20:08:01 christos Exp $ */
/* $NetBSD: namespace.h,v 1.108 2005/09/25 22:20:59 elad Exp $ */
/*-
* Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@ -78,17 +78,33 @@
#define warnx _warnx
#ifdef __weak_alias
#define MD2Data _MD2Data
#define MD2End _MD2End
#define MD2FileChunk _MD2FileChunk
#define MD2File _MD2File
#define MD2Final _MD2Final
#define MD2Init _MD2Init
#define MD2Transform _MD2Transform
#define MD2Update _MD2Update
#define MD4Data _MD4Data
#define MD4End _MD4End
#define MD4FileChunk _MD4FileChunk
#define MD4File _MD4File
#define MD4Final _MD4Final
#define MD4Init _MD4Init
#define MD4Transform _MD4Transform
#define MD4Update _MD4Update
#define MD5Data _MD5Data
#define MD5End _MD5End
#define MD5FileChunk _MD5FileChunk
#define MD5File _MD5File
#define MD5Final _MD5Final
#define MD5Init _MD5Init
#define MD5Transform _MD5Transform
#define MD5Update _MD5Update
#define RMD160Data _RMD160Data
#define RMD160End _RMD160End
#define RMD160FileChunk _RMD160FileChunk
#define RMD160File _RMD160File
#define RMD160Final _RMD160Final
#define RMD160Init _RMD160Init
@ -96,11 +112,36 @@
#define RMD160Update _RMD160Update
#define SHA1Data _SHA1Data
#define SHA1End _SHA1End
#define SHA1FileChunk _SHA1FileChunk
#define SHA1File _SHA1File
#define SHA1Final _SHA1Final
#define SHA1Init _SHA1Init
#define SHA1Transform _SHA1Transform
#define SHA1Update _SHA1Update
#define SHA256Data _SHA256Data
#define SHA256End _SHA256End
#define SHA256FileChunk _SHA256FileChunk
#define SHA256File _SHA256File
#define SHA256Final _SHA256Final
#define SHA256Init _SHA256Init
#define SHA256Transform _SHA256Transform
#define SHA256Update _SHA256Update
#define SHA384Data _SHA384Data
#define SHA384End _SHA384End
#define SHA384FileChunk _SHA384FileChunk
#define SHA384File _SHA384File
#define SHA384Final _SHA384Final
#define SHA384Init _SHA384Init
#define SHA384Transform _SHA384Transform
#define SHA384Update _SHA384Update
#define SHA512Data _SHA512Data
#define SHA512End _SHA512End
#define SHA512FileChunk _SHA512FileChunk
#define SHA512File _SHA512File
#define SHA512Final _SHA512Final
#define SHA512Init _SHA512Init
#define SHA512Transform _SHA512Transform
#define SHA512Update _SHA512Update
#define a64l _a64l
#define adjtime _adjtime
#define alarm _alarm

View File

@ -1,4 +1,4 @@
/* $NetBSD: md4c.c,v 1.13 2005/06/12 05:21:27 lukem Exp $ */
/* $NetBSD: md4c.c,v 1.14 2005/09/25 22:20:59 elad Exp $ */
/*
* This file is derived from the RSA Data Security, Inc. MD4 Message-Digest
@ -30,7 +30,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: md4c.c,v 1.13 2005/06/12 05:21:27 lukem Exp $");
__RCSID("$NetBSD: md4c.c,v 1.14 2005/09/25 22:20:59 elad Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
@ -113,6 +113,7 @@ static const unsigned char PADDING[64] = {
__weak_alias(MD4Init,_MD4Init)
__weak_alias(MD4Update,_MD4Update)
__weak_alias(MD4Final,_MD4Final)
__weak_alias(MD4Transform,_MD4Transform)
#endif
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: md5c.c,v 1.20 2005/06/12 05:21:27 lukem Exp $ */
/* $NetBSD: md5c.c,v 1.21 2005/09/25 22:20:59 elad Exp $ */
/*
* This file is derived from the RSA Data Security, Inc. MD5 Message-Digest
@ -37,7 +37,7 @@
#else
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
__RCSID("$NetBSD: md5c.c,v 1.20 2005/06/12 05:21:27 lukem Exp $");
__RCSID("$NetBSD: md5c.c,v 1.21 2005/09/25 22:20:59 elad Exp $");
#endif /* LIBC_SCCS and not lint */
#include "namespace.h"
#include <sys/types.h>
@ -82,6 +82,7 @@ typedef u_int32_t UINT4;
__weak_alias(MD5Init,_MD5Init)
__weak_alias(MD5Update,_MD5Update)
__weak_alias(MD5Final,_MD5Final)
__weak_alias(MD5Transform,_MD5Transform)
#endif
static void MD5Transform __P((UINT4 [4], const unsigned char [64]));