advapi32: Move SHA1 implementation to ntdll.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-06-24 14:40:45 +02:00
parent f535bcb2e6
commit 45e0f91de1
5 changed files with 17 additions and 17 deletions

View File

@ -13,7 +13,6 @@ C_SRCS = \
crypt_lmhash.c \ crypt_lmhash.c \
crypt_md4.c \ crypt_md4.c \
crypt_md5.c \ crypt_md5.c \
crypt_sha.c \
eventlog.c \ eventlog.c \
lsa.c \ lsa.c \
perf.c \ perf.c \

View File

@ -1,7 +1,7 @@
# 1000 stub ADVAPI32_1000 # 1000 stub ADVAPI32_1000
@ stdcall A_SHAFinal(ptr ptr) @ stdcall A_SHAFinal(ptr ptr) ntdll.A_SHAFinal
@ stdcall A_SHAInit(ptr) @ stdcall A_SHAInit(ptr) ntdll.A_SHAInit
@ stdcall A_SHAUpdate(ptr ptr long) @ stdcall A_SHAUpdate(ptr ptr long) ntdll.A_SHAUpdate
@ stdcall AbortSystemShutdownA(ptr) @ stdcall AbortSystemShutdownA(ptr)
@ stdcall AbortSystemShutdownW(ptr) @ stdcall AbortSystemShutdownW(ptr)
@ stdcall AccessCheck(ptr long long ptr ptr ptr ptr ptr) @ stdcall AccessCheck(ptr long long ptr ptr ptr ptr ptr)

View File

@ -10,6 +10,7 @@ C_SRCS = \
atom.c \ atom.c \
cdrom.c \ cdrom.c \
critsection.c \ critsection.c \
crypt.c \
debugbuffer.c \ debugbuffer.c \
debugtools.c \ debugtools.c \
directory.c \ directory.c \

View File

@ -1,6 +1,5 @@
/* /*
* Copyright 2004 Filip Navara * Copyright 2004 Filip Navara
* Based on public domain SHA code by Steve Reid <steve@edmweb.com>
* *
* This library is free software; you can redistribute it and/or * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public * modify it under the terms of the GNU Lesser General Public
@ -20,7 +19,10 @@
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"
/* SHA Context Structure Declaration */ /* SHA1 algorithm
*
* Based on public domain SHA code by Steve Reid <steve@edmweb.com>
*/
typedef struct { typedef struct {
ULONG Unknown[6]; ULONG Unknown[6];
@ -29,8 +31,6 @@ typedef struct {
UCHAR Buffer[64]; UCHAR Buffer[64];
} SHA_CTX, *PSHA_CTX; } SHA_CTX, *PSHA_CTX;
/* SHA1 Helper Macros */
#define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits))))
/* FIXME: This definition of DWORD2BE is little endian specific! */ /* FIXME: This definition of DWORD2BE is little endian specific! */
#define DWORD2BE(x) (((x) >> 24) & 0xff) | (((x) >> 8) & 0xff00) | (((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000); #define DWORD2BE(x) (((x) >> 24) & 0xff) | (((x) >> 8) & 0xff00) | (((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000);
@ -98,7 +98,7 @@ static void SHA1Transform(ULONG State[5], UCHAR Buffer[64])
/****************************************************************************** /******************************************************************************
* A_SHAInit [ADVAPI32.@] * A_SHAInit (ntdll.@)
* *
* Initialize a SHA context structure. * Initialize a SHA context structure.
* *
@ -108,8 +108,7 @@ static void SHA1Transform(ULONG State[5], UCHAR Buffer[64])
* RETURNS * RETURNS
* Nothing * Nothing
*/ */
VOID WINAPI void WINAPI A_SHAInit(PSHA_CTX Context)
A_SHAInit(PSHA_CTX Context)
{ {
/* SHA1 initialization constants */ /* SHA1 initialization constants */
Context->State[0] = 0x67452301; Context->State[0] = 0x67452301;
@ -122,7 +121,7 @@ A_SHAInit(PSHA_CTX Context)
} }
/****************************************************************************** /******************************************************************************
* A_SHAUpdate [ADVAPI32.@] * A_SHAUpdate (ntdll.@)
* *
* Update a SHA context with a hashed data from supplied buffer. * Update a SHA context with a hashed data from supplied buffer.
* *
@ -134,8 +133,7 @@ A_SHAInit(PSHA_CTX Context)
* RETURNS * RETURNS
* Nothing * Nothing
*/ */
VOID WINAPI void WINAPI A_SHAUpdate(PSHA_CTX Context, const unsigned char *Buffer, UINT BufferSize)
A_SHAUpdate(PSHA_CTX Context, const unsigned char *Buffer, UINT BufferSize)
{ {
ULONG BufferContentSize; ULONG BufferContentSize;
@ -166,7 +164,7 @@ A_SHAUpdate(PSHA_CTX Context, const unsigned char *Buffer, UINT BufferSize)
} }
/****************************************************************************** /******************************************************************************
* A_SHAFinal [ADVAPI32.@] * A_SHAFinal (ntdll.@)
* *
* Finalize SHA context and return the resulting hash. * Finalize SHA context and return the resulting hash.
* *
@ -177,8 +175,7 @@ A_SHAUpdate(PSHA_CTX Context, const unsigned char *Buffer, UINT BufferSize)
* RETURNS * RETURNS
* Nothing * Nothing
*/ */
VOID WINAPI void WINAPI A_SHAFinal(PSHA_CTX Context, PULONG Result)
A_SHAFinal(PSHA_CTX Context, PULONG Result)
{ {
INT Pad, Index; INT Pad, Index;
UCHAR Buffer[72]; UCHAR Buffer[72];

View File

@ -3,6 +3,9 @@
#if you change a Nt.. function DON'T FORGET to change the #if you change a Nt.. function DON'T FORGET to change the
#Zw one too. #Zw one too.
@ stdcall A_SHAFinal(ptr ptr)
@ stdcall A_SHAInit(ptr)
@ stdcall A_SHAUpdate(ptr ptr long)
@ stdcall ApiSetQueryApiSetPresence(ptr ptr) @ stdcall ApiSetQueryApiSetPresence(ptr ptr)
@ stub CsrAllocateCaptureBuffer @ stub CsrAllocateCaptureBuffer
@ stub CsrAllocateCapturePointer @ stub CsrAllocateCapturePointer