winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
January 2016
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
627 discussions
Start a n
N
ew thread
Hans Leidekker : bcrypt: Implement BCryptGetProperty.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: 46369d79e0cd24f1ef396a692e001bfc3d1ef101 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=46369d79e0cd24f1ef396a692…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jan 6 14:19:17 2016 +0100 bcrypt: Implement BCryptGetProperty. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/bcrypt_main.c | 152 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 149 insertions(+), 3 deletions(-) diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index d496d80..9ad3060 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -216,11 +216,157 @@ static NTSTATUS hash_init( struct hash *hash ) } #endif -NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE obj, LPCWSTR prop, UCHAR *buffer, ULONG count, ULONG *res, ULONG flags) +#define OBJECT_LENGTH_SHA1 278 +#define OBJECT_LENGTH_SHA256 286 +#define OBJECT_LENGTH_SHA384 382 +#define OBJECT_LENGTH_SHA512 382 + +#define HASH_DIGEST_LENGTH_SHA1 20 +#define HASH_DIGEST_LENGTH_SHA256 32 +#define HASH_DIGEST_LENGTH_SHA384 48 +#define HASH_DIGEST_LENGTH_SHA512 64 + +static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size ) { - FIXME("%p, %s, %p, %u, %p, %08x - stub\n", obj, wine_dbgstr_w(prop), buffer, count, res, flags); + ULONG value; - return STATUS_NOT_IMPLEMENTED; + switch (id) + { + case ALG_ID_SHA1: + if (!strcmpW( prop, BCRYPT_OBJECT_LENGTH )) + { + value = OBJECT_LENGTH_SHA1; + break; + } + FIXME( "unsupported sha1 algorithm property %s\n", debugstr_w(prop) ); + return STATUS_NOT_IMPLEMENTED; + + case ALG_ID_SHA256: + if (!strcmpW( prop, BCRYPT_OBJECT_LENGTH )) + { + value = OBJECT_LENGTH_SHA256; + break; + } + FIXME( "unsupported sha256 algorithm property %s\n", debugstr_w(prop) ); + return STATUS_NOT_IMPLEMENTED; + + case ALG_ID_SHA384: + if (!strcmpW( prop, BCRYPT_OBJECT_LENGTH )) + { + value = OBJECT_LENGTH_SHA384; + break; + } + FIXME( "unsupported sha384 algorithm property %s\n", debugstr_w(prop) ); + return STATUS_NOT_IMPLEMENTED; + + case ALG_ID_SHA512: + if (!strcmpW( prop, BCRYPT_OBJECT_LENGTH )) + { + value = OBJECT_LENGTH_SHA512; + break; + } + FIXME( "unsupported sha512 algorithm property %s\n", debugstr_w(prop) ); + return STATUS_NOT_IMPLEMENTED; + + default: + FIXME( "unsupported algorithm %u\n", id ); + return STATUS_NOT_IMPLEMENTED; + } + + if (size < sizeof(ULONG)) + { + *ret_size = sizeof(ULONG); + return STATUS_BUFFER_TOO_SMALL; + } + if (buf) *(ULONG *)buf = value; + *ret_size = sizeof(ULONG); + + return STATUS_SUCCESS; +} + +static NTSTATUS get_hash_property( enum alg_id id, const WCHAR *prop, UCHAR *buf, ULONG size, ULONG *ret_size ) +{ + ULONG value; + + switch (id) + { + case ALG_ID_SHA1: + if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) + { + value = HASH_DIGEST_LENGTH_SHA1; + break; + } + FIXME( "unsupported sha1 hash property %s\n", debugstr_w(prop) ); + return STATUS_NOT_IMPLEMENTED; + + case ALG_ID_SHA256: + if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) + { + value = HASH_DIGEST_LENGTH_SHA256; + break; + } + FIXME( "unsupported sha256 hash property %s\n", debugstr_w(prop) ); + return STATUS_NOT_IMPLEMENTED; + + case ALG_ID_SHA384: + if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) + { + value = HASH_DIGEST_LENGTH_SHA384; + break; + } + FIXME( "unsupported sha384 hash property %s\n", debugstr_w(prop) ); + return STATUS_NOT_IMPLEMENTED; + + case ALG_ID_SHA512: + if (!strcmpW( prop, BCRYPT_HASH_LENGTH )) + { + value = HASH_DIGEST_LENGTH_SHA512; + break; + } + FIXME( "unsupported sha512 hash property %s\n", debugstr_w(prop) ); + return STATUS_NOT_IMPLEMENTED; + + default: + FIXME( "unsupported hash %u\n", id ); + return STATUS_NOT_IMPLEMENTED; + } + + if (size < sizeof(ULONG)) + { + *ret_size = sizeof(ULONG); + return STATUS_BUFFER_TOO_SMALL; + } + if (buf) *(ULONG *)buf = value; + *ret_size = sizeof(ULONG); + + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI BCryptGetProperty( BCRYPT_HANDLE handle, LPCWSTR prop, UCHAR *buffer, ULONG count, ULONG *res, ULONG flags ) +{ + struct object *object = handle; + + TRACE( "%p, %s, %p, %u, %p, %08x\n", handle, wine_dbgstr_w(prop), buffer, count, res, flags ); + + if (!object) return STATUS_INVALID_HANDLE; + if (!prop || !res) return STATUS_INVALID_PARAMETER; + + switch (object->magic) + { + case MAGIC_ALG: + { + const struct algorithm *alg = (const struct algorithm *)object; + return get_alg_property( alg->id, prop, buffer, count, res ); + } + case MAGIC_HASH: + { + const struct hash *hash = (const struct hash *)object; + return get_hash_property( hash->alg_id, prop, buffer, count, res ); + } + default: + WARN( "unknown magic %08x", object->magic ); + return STATUS_INVALID_HANDLE; + } } NTSTATUS WINAPI BCryptCreateHash( BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDLE *handle, UCHAR *object, ULONG objectlen,
1
0
0
0
Hans Leidekker : bcrypt: Implement BCryptCreateHash and BCryptDestroyHash.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: 0c9b94eeb3bcf5f4b049de934b11f5a8dab0afda URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0c9b94eeb3bcf5f4b049de934…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jan 6 14:19:16 2016 +0100 bcrypt: Implement BCryptCreateHash and BCryptDestroyHash. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- configure | 1 + configure.ac | 1 + dlls/bcrypt/bcrypt.spec | 2 +- dlls/bcrypt/bcrypt_main.c | 99 +++++++++++++++++++++++++++++++++++++++++++++-- include/config.h.in | 3 ++ 5 files changed, 101 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 06e3b4a..997833d 100755 --- a/configure +++ b/configure @@ -6675,6 +6675,7 @@ for ac_header in \ AudioUnit/AudioComponent.h \ CL/cl.h \ Carbon/Carbon.h \ + CommonCrypto/CommonDigest.h \ CoreAudio/CoreAudio.h \ CoreServices/CoreServices.h \ DiskArbitration/DiskArbitration.h \ diff --git a/configure.ac b/configure.ac index d47f7e9..2b1dd81 100644 --- a/configure.ac +++ b/configure.ac @@ -393,6 +393,7 @@ AC_CHECK_HEADERS(\ AudioUnit/AudioComponent.h \ CL/cl.h \ Carbon/Carbon.h \ + CommonCrypto/CommonDigest.h \ CoreAudio/CoreAudio.h \ CoreServices/CoreServices.h \ DiskArbitration/DiskArbitration.h \ diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec index 1c848e1..53db32a 100644 --- a/dlls/bcrypt/bcrypt.spec +++ b/dlls/bcrypt/bcrypt.spec @@ -8,7 +8,7 @@ @ stub BCryptDecrypt @ stub BCryptDeleteContext @ stub BCryptDeriveKey -@ stub BCryptDestroyHash +@ stdcall BCryptDestroyHash(ptr) @ stub BCryptDestroyKey @ stub BCryptDestroySecret @ stub BCryptDuplicateHash diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 310c9b6..d496d80 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -20,6 +20,9 @@ #include "config.h" #include <stdarg.h> +#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H +#include <CommonCrypto/CommonDigest.h> +#endif #include "ntstatus.h" #define WIN32_NO_STATUS @@ -81,6 +84,7 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE algorithm, UCHAR *buffer, ULON } #define MAGIC_ALG (('A' << 24) | ('L' << 16) | ('G' << 8) | '0') +#define MAGIC_HASH (('H' << 24) | ('A' << 16) | ('S' << 8) | 'H') struct object { ULONG magic; @@ -159,6 +163,59 @@ NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *enabled) return STATUS_SUCCESS; } +#ifdef HAVE_COMMONCRYPTO_COMMONDIGEST_H +struct hash +{ + struct object hdr; + enum alg_id alg_id; + union + { + CC_SHA1_CTX sha1_ctx; + CC_SHA256_CTX sha256_ctx; + CC_SHA512_CTX sha512_ctx; + } u; +}; + +static NTSTATUS hash_init( struct hash *hash ) +{ + switch (hash->alg_id) + { + case ALG_ID_SHA1: + CC_SHA1_Init( &hash->u.sha1_ctx ); + break; + + case ALG_ID_SHA256: + CC_SHA256_Init( &hash->u.sha256_ctx ); + break; + + case ALG_ID_SHA384: + CC_SHA384_Init( &hash->u.sha512_ctx ); + break; + + case ALG_ID_SHA512: + CC_SHA512_Init( &hash->u.sha512_ctx ); + break; + + default: + ERR( "unhandled id %u\n", hash->alg_id ); + return STATUS_NOT_IMPLEMENTED; + } + return STATUS_SUCCESS; +} +#else +struct hash +{ + struct object hdr; + enum alg_id alg_id; +}; + +static NTSTATUS hash_init( struct hash *hash ) +{ + ERR( "support for hashes not available at build time\n" ); + return STATUS_NOT_IMPLEMENTED; +} +#endif + NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE obj, LPCWSTR prop, UCHAR *buffer, ULONG count, ULONG *res, ULONG flags) { FIXME("%p, %s, %p, %u, %p, %08x - stub\n", obj, wine_dbgstr_w(prop), buffer, count, res, flags); @@ -166,10 +223,44 @@ NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE obj, LPCWSTR prop, UCHAR *buffer return STATUS_NOT_IMPLEMENTED; } -NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDLE* hash, UCHAR* hashobject, - ULONG hashobjectlen, UCHAR *secret, ULONG secretlen, ULONG flags) +NTSTATUS WINAPI BCryptCreateHash( BCRYPT_ALG_HANDLE algorithm, BCRYPT_HASH_HANDLE *handle, UCHAR *object, ULONG objectlen, + UCHAR *secret, ULONG secretlen, ULONG flags ) { - FIXME("%p, %p, %p, %u, %p, %u, %08x - stub\n", algorithm, hash, hashobject, hashobjectlen, secret, secretlen, flags); + struct algorithm *alg = algorithm; + struct hash *hash; + NTSTATUS status; - return STATUS_NOT_IMPLEMENTED; + TRACE( "%p, %p, %p, %u, %p, %u, %08x - stub\n", algorithm, handle, object, objectlen, + secret, secretlen, flags ); + if (flags) + { + FIXME( "unimplemented flags %08x\n", flags ); + return STATUS_NOT_IMPLEMENTED; + } + + if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE; + if (object) FIXME( "ignoring object buffer\n" ); + + if (!(hash = HeapAlloc( GetProcessHeap(), 0, sizeof(*hash) ))) return STATUS_NO_MEMORY; + hash->hdr.magic = MAGIC_HASH; + hash->alg_id = alg->id; + if ((status = hash_init( hash )) != STATUS_SUCCESS) + { + HeapFree( GetProcessHeap(), 0, hash ); + return status; + } + + *handle = hash; + return STATUS_SUCCESS; +} + +NTSTATUS WINAPI BCryptDestroyHash( BCRYPT_HASH_HANDLE handle ) +{ + struct hash *hash = handle; + + TRACE( "%p\n", handle ); + + if (!hash || hash->hdr.magic != MAGIC_HASH) return STATUS_INVALID_HANDLE; + HeapFree( GetProcessHeap(), 0, hash ); + return STATUS_SUCCESS; } diff --git a/include/config.h.in b/include/config.h.in index 61817f4..514e5fe 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -71,6 +71,9 @@ /* Define to 1 if you have the <CL/cl.h> header file. */ #undef HAVE_CL_CL_H +/* Define to 1 if you have the <CommonCrypto/CommonDigest.h> header file. */ +#undef HAVE_COMMONCRYPTO_COMMONDIGEST_H + /* Define to 1 if you have the <CoreAudio/CoreAudio.h> header file. */ #undef HAVE_COREAUDIO_COREAUDIO_H
1
0
0
0
Hans Leidekker : bcrypt: Implement BCryptOpenAlgorithmProvider and BCryptCloseAlgorithmProvider.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: eaf9e4154317cc160d5baa85aba22a62ba75103e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=eaf9e4154317cc160d5baa85a…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jan 6 14:19:15 2016 +0100 bcrypt: Implement BCryptOpenAlgorithmProvider and BCryptCloseAlgorithmProvider. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/bcrypt_main.c | 70 ++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 10 deletions(-) diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index b716aea..310c9b6 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -27,7 +27,9 @@ #include "winbase.h" #include "ntsecapi.h" #include "bcrypt.h" + #include "wine/debug.h" +#include "wine/unicode.h" WINE_DEFAULT_DEBUG_CHANNEL(bcrypt); @@ -78,24 +80,72 @@ NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE algorithm, UCHAR *buffer, ULON return STATUS_NOT_IMPLEMENTED; } -NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *algorithm, LPCWSTR algorithmId, - LPCWSTR implementation, DWORD flags) +#define MAGIC_ALG (('A' << 24) | ('L' << 16) | ('G' << 8) | '0') +struct object { - FIXME("%p, %s, %s, %08x - stub\n", algorithm, wine_dbgstr_w(algorithmId), wine_dbgstr_w(implementation), flags); + ULONG magic; +}; - if (!algorithm) - return STATUS_INVALID_PARAMETER; +enum alg_id +{ + ALG_ID_SHA1 = 1, + ALG_ID_SHA256 = 2, + ALG_ID_SHA384 = 3, + ALG_ID_SHA512 = 4 +}; - *algorithm = NULL; +struct algorithm +{ + struct object hdr; + enum alg_id id; +}; - return STATUS_NOT_IMPLEMENTED; +NTSTATUS WINAPI BCryptOpenAlgorithmProvider( BCRYPT_ALG_HANDLE *handle, LPCWSTR id, LPCWSTR implementation, DWORD flags ) +{ + struct algorithm *alg; + enum alg_id alg_id; + + TRACE( "%p, %s, %s, %08x\n", handle, wine_dbgstr_w(id), wine_dbgstr_w(implementation), flags ); + + if (!handle || !id) return STATUS_INVALID_PARAMETER; + if (flags) + { + FIXME( "unimplemented flags %08x\n", flags ); + return STATUS_NOT_IMPLEMENTED; + } + + if (!strcmpW( id, BCRYPT_SHA1_ALGORITHM )) alg_id = ALG_ID_SHA1; + else if (!strcmpW( id, BCRYPT_SHA256_ALGORITHM )) alg_id = ALG_ID_SHA256; + else if (!strcmpW( id, BCRYPT_SHA384_ALGORITHM )) alg_id = ALG_ID_SHA384; + else if (!strcmpW( id, BCRYPT_SHA512_ALGORITHM )) alg_id = ALG_ID_SHA512; + else + { + FIXME( "algorithm %s not supported\n", debugstr_w(id) ); + return STATUS_NOT_IMPLEMENTED; + } + if (!implementation || strcmpW( implementation, MS_PRIMITIVE_PROVIDER )) + { + FIXME( "implementation %s not supported\n", debugstr_w(implementation) ); + return STATUS_NOT_IMPLEMENTED; + } + + if (!(alg = HeapAlloc( GetProcessHeap(), 0, sizeof(*alg) ))) return STATUS_NO_MEMORY; + alg->hdr.magic = MAGIC_ALG; + alg->id = alg_id; + + *handle = alg; + return STATUS_SUCCESS; } -NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE algorithm, DWORD flags) +NTSTATUS WINAPI BCryptCloseAlgorithmProvider( BCRYPT_ALG_HANDLE handle, DWORD flags ) { - FIXME("%p, %08x - stub\n", algorithm, flags); + struct algorithm *alg = handle; - return STATUS_NOT_IMPLEMENTED; + TRACE( "%p, %08x\n", handle, flags ); + + if (!alg || alg->hdr.magic != MAGIC_ALG) return STATUS_INVALID_HANDLE; + HeapFree( GetProcessHeap(), 0, alg ); + return STATUS_SUCCESS; } NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *enabled)
1
0
0
0
Hans Leidekker : include: Add missing BCrypt declarations.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: 5c1a92e1cf06bf6446f0da5982624beb4bc69a6b URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5c1a92e1cf06bf6446f0da598…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Wed Jan 6 14:19:14 2016 +0100 include: Add missing BCrypt declarations. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/bcrypt.h | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/include/bcrypt.h b/include/bcrypt.h index fe3d854..30988be 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -40,6 +40,34 @@ typedef LONG NTSTATUS; #endif +#define BCRYPT_ALGORITHM_NAME (const WCHAR []){'A','l','g','o','r','i','t','h','m','N','a','m','e',0} +#define BCRYPT_AUTH_TAG_LENGTH (const WCHAR []){'A','u','t','h','T','a','g','L','e','n','g','t','h',0} +#define BCRYPT_BLOCK_LENGTH (const WCHAR []){'B','l','o','c','k','L','e','n','g','t','h',0} +#define BCRYPT_BLOCK_SIZE_LIST (const WCHAR []){'B','l','o','c','k','S','i','z','e','L','i','s','t',0} +#define BCRYPT_CHAINING_MODE (const WCHAR []){'C','h','a','i','n','i','n','g','M','o','d','e',0} +#define BCRYPT_EFFECTIVE_KEY_LENGTH (const WCHAR []){'E','f','f','e','c','t','i','v','e','K','e','y','L','e','n','g','t','h',0} +#define BCRYPT_HASH_BLOCK_LENGTH (const WCHAR []){'H','a','s','h','B','l','o','c','k','L','e','n','g','t','h',0} +#define BCRYPT_HASH_LENGTH (const WCHAR []){'H','a','s','h','D','i','g','e','s','t','L','e','n','g','t','h',0} +#define BCRYPT_HASH_OID_LIST (const WCHAR []){'H','a','s','h','O','I','D','L','i','s','t',0} +#define BCRYPT_KEY_LENGTH (const WCHAR []){'K','e','y','L','e','n','g','t','h',0} +#define BCRYPT_KEY_LENGTHS (const WCHAR []){'K','e','y','L','e','n','g','t','h','s',0} +#define BCRYPT_KEY_OBJECT_LENGTH (const WCHAR []){'K','e','y','O','b','j','e','c','t','L','e','n','g','t','h',0} +#define BCRYPT_KEY_STRENGTH (const WCHAR []){'K','e','y','S','t','r','e','n','g','t','h',0} +#define BCRYPT_OBJECT_LENGTH (const WCHAR []){'O','b','j','e','c','t','L','e','n','g','t','h',0} +#define BCRYPT_PADDING_SCHEMES (const WCHAR []){'P','a','d','d','i','n','g','S','c','h','e','m','e','s',0} +#define BCRYPT_PROVIDER_HANDLE (const WCHAR []){'P','r','o','v','i','d','e','r','H','a','n','d','l','e',0} +#define BCRYPT_SIGNATURE_LENGTH (const WCHAR []){'S','i','g','n','a','t','u','r','e','L','e','n','g','t','h',0} + +#define MS_PRIMITIVE_PROVIDER (const WCHAR [])\ + {'M','i','c','r','o','s','o','f','t',' ','P','r','i','m','i','t','i','v','e',' ','P','r','o','v','i','d','e','r',0} +#define MS_PLATFORM_CRYPTO_PROVIDER (const WCHAR [])\ + {'M','i','c','r','o','s','o','f','t',' ','P','l','a','t','f','o','r','m',' ','C','r','y','p','t','o',' ','P','r','o','v','i','d','e','r',0} + +#define BCRYPT_SHA1_ALGORITHM (const WCHAR []){'S','H','A','1',0} +#define BCRYPT_SHA256_ALGORITHM (const WCHAR []){'S','H','A','2','5','6',0} +#define BCRYPT_SHA384_ALGORITHM (const WCHAR []){'S','H','A','3','8','4',0} +#define BCRYPT_SHA512_ALGORITHM (const WCHAR []){'S','H','A','5','1','2',0} + typedef struct _BCRYPT_ALGORITHM_IDENTIFIER { LPWSTR pszName; @@ -54,4 +82,15 @@ typedef PVOID BCRYPT_HASH_HANDLE; #define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001 #define BCRYPT_USE_SYSTEM_PREFERRED_RNG 0x00000002 +NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE, ULONG); +NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG); +NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE); +NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG); +NTSTATUS WINAPI BCryptFinishHash(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG); +NTSTATUS WINAPI BCryptGenRandom(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, ULONG); +NTSTATUS WINAPI BCryptGetFipsAlgorithmMode(BOOLEAN *); +NTSTATUS WINAPI BCryptGetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG *, ULONG); +NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG); +NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG); + #endif /* __WINE_BCRYPT_H */
1
0
0
0
Nikolay Sivov : ole32/tests: A couple of tests for ReadClassStm/ ReadClassStg.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: 0a34f25487f65448104b85cb0a8f33748adf9fbd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0a34f25487f65448104b85cb0…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jan 6 15:51:28 2016 +0300 ole32/tests: A couple of tests for ReadClassStm/ReadClassStg. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ole32/tests/storage32.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/ole32/tests/storage32.c b/dlls/ole32/tests/storage32.c index afe9332..43c0c28 100644 --- a/dlls/ole32/tests/storage32.c +++ b/dlls/ole32/tests/storage32.c @@ -1176,7 +1176,7 @@ static void test_writeclassstg(void) { IStorage *stg = NULL; HRESULT r; - CLSID temp_cls; + CLSID temp_cls, cls2; DeleteFileA(filenameA); @@ -1188,6 +1188,12 @@ static void test_writeclassstg(void) r = ReadClassStg( NULL, NULL ); ok(r == E_INVALIDARG, "ReadClassStg should return E_INVALIDARG instead of 0x%08X\n", r); + memset(&temp_cls, 0xcc, sizeof(temp_cls)); + memset(&cls2, 0xcc, sizeof(cls2)); + r = ReadClassStg( NULL, &temp_cls ); + ok(r == E_INVALIDARG, "got 0x%08x\n", r); + ok(IsEqualCLSID(&temp_cls, &cls2), "got wrong clsid\n"); + r = ReadClassStg( stg, NULL ); ok(r == E_INVALIDARG, "ReadClassStg should return E_INVALIDARG instead of 0x%08X\n", r); @@ -1957,7 +1963,7 @@ static void test_nonroot_transacted(void) static void test_ReadClassStm(void) { - CLSID clsid; + CLSID clsid, clsid2; HRESULT hr; IStream *pStream; static const LARGE_INTEGER llZero; @@ -1973,6 +1979,12 @@ static void test_ReadClassStm(void) hr = ReadClassStm(pStream, NULL); ok(hr == E_INVALIDARG, "ReadClassStm should have returned E_INVALIDARG instead of 0x%08x\n", hr); + memset(&clsid, 0xcc, sizeof(clsid)); + memset(&clsid2, 0xcc, sizeof(clsid2)); + hr = ReadClassStm(NULL, &clsid); + ok(hr == E_INVALIDARG, "got 0x%08x\n", hr); + ok(IsEqualCLSID(&clsid, &clsid2), "got wrong clsid\n"); + /* test not rewound stream */ hr = ReadClassStm(pStream, &clsid); ok(hr == STG_E_READFAULT, "ReadClassStm should have returned STG_E_READFAULT instead of 0x%08x\n", hr);
1
0
0
0
Hugh McMaster : kernel32: Remove incorrect comment from !i386 version of GetLargestConsoleWindowSize.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: 66974e5502c5d094286455cf23f51ca62c5b1220 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=66974e5502c5d094286455cf2…
Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Wed Jan 6 18:27:59 2016 +1100 kernel32: Remove incorrect comment from !i386 version of GetLargestConsoleWindowSize. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/console.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 85e4ba8..5db37a0 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -1398,19 +1398,9 @@ DWORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) TRACE("(%p), returning %dx%d (%x)\n", hConsoleOutput, x.c.X, x.c.Y, x.w); return x.w; } -#endif /* defined(__i386__) */ +#else -/*********************************************************************** - * GetLargestConsoleWindowSize (KERNEL32.@) - * - * NOTE - * This should return a COORD, but calling convention for returning - * structures is different between Windows and gcc on i386. - * - * VERSION: [!i386] - */ -#ifndef __i386__ COORD WINAPI GetLargestConsoleWindowSize(HANDLE hConsoleOutput) { COORD c;
1
0
0
0
Sebastian Lackner : kernel32: Clamp maximum console window size to screen buffer size.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: dfe42ca50652517db365bd1f02f848c7029072d5 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dfe42ca50652517db365bd1f0…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Wed Jan 6 01:05:04 2016 +0100 kernel32: Clamp maximum console window size to screen buffer size. Signed-off-by: Sebastian Lackner <sebastian(a)fds-team.de> Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/console.c | 4 ++-- dlls/kernel32/tests/console.c | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c index 3c53b52..85e4ba8 100644 --- a/dlls/kernel32/console.c +++ b/dlls/kernel32/console.c @@ -2160,8 +2160,8 @@ BOOL WINAPI GetConsoleScreenBufferInfo(HANDLE hConsoleOutput, LPCONSOLE_SCREEN_B csbi->srWindow.Right = reply->win_right; csbi->srWindow.Top = reply->win_top; csbi->srWindow.Bottom = reply->win_bottom; - csbi->dwMaximumWindowSize.X = reply->max_width; - csbi->dwMaximumWindowSize.Y = reply->max_height; + csbi->dwMaximumWindowSize.X = min(reply->width, reply->max_width); + csbi->dwMaximumWindowSize.Y = min(reply->height, reply->max_height); } } SERVER_END_REQ; diff --git a/dlls/kernel32/tests/console.c b/dlls/kernel32/tests/console.c index f362415..43a4b75 100644 --- a/dlls/kernel32/tests/console.c +++ b/dlls/kernel32/tests/console.c @@ -2686,9 +2686,11 @@ static void test_GetLargestConsoleWindowSize(HANDLE std_output) COORD c, font; RECT r; LONG workarea_w, workarea_h, maxcon_w, maxcon_h; + CONSOLE_SCREEN_BUFFER_INFO sbi; CONSOLE_FONT_INFO cfi; DWORD index, i; HMODULE hmod; + BOOL ret; DWORD (WINAPI *pGetNumberOfConsoleFonts)(void); BOOL (WINAPI *pSetConsoleFont)(HANDLE, DWORD); @@ -2740,6 +2742,13 @@ static void test_GetLargestConsoleWindowSize(HANDLE std_output) maxcon_h = workarea_h / font.Y; ok(c.X == maxcon_w || c.X == maxcon_w - 1 /* Win10 */, "got %d, expected %d\n", c.X, maxcon_w); ok(c.Y == maxcon_h || c.Y == maxcon_h - 1 /* Win10 */, "got %d, expected %d\n", c.Y, maxcon_h); + + ret = GetConsoleScreenBufferInfo(std_output, &sbi); + ok(ret, "GetConsoleScreenBufferInfo failed %u\n", GetLastError()); + ok(sbi.dwMaximumWindowSize.X == min(c.X, sbi.dwSize.X), "got %d, expected %d\n", + sbi.dwMaximumWindowSize.X, min(c.X, sbi.dwSize.X)); + ok(sbi.dwMaximumWindowSize.Y == min(c.Y, sbi.dwSize.Y), "got %d, expected %d\n", + sbi.dwMaximumWindowSize.Y, min(c.Y, sbi.dwSize.Y)); } pSetConsoleFont(std_output, index); /* restore original font size */ }
1
0
0
0
Nikolay Sivov : shlwapi: Remove a cast that's not really needed.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: 9171865661df71b3e0f629a9e73f7607a39f6688 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9171865661df71b3e0f629a9e…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Tue Jan 5 23:48:22 2016 +0300 shlwapi: Remove a cast that's not really needed. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/shlwapi/stopwatch.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dlls/shlwapi/stopwatch.c b/dlls/shlwapi/stopwatch.c index 7a7007e..c7b4356 100644 --- a/dlls/shlwapi/stopwatch.c +++ b/dlls/shlwapi/stopwatch.c @@ -190,16 +190,16 @@ void WINAPI StopWatch_MarkJavaStop(LPCWSTR lpszEvent, HWND hWnd, DWORD dwReserve */ DWORD WINAPI GetPerfTime(void) { - static LONG64 iCounterFreq = 0; + static LARGE_INTEGER iCounterFreq = { 0 }; LARGE_INTEGER iCounter; TRACE("()\n"); - if (!iCounterFreq) - QueryPerformanceFrequency((LARGE_INTEGER*)&iCounterFreq); + if (!iCounterFreq.QuadPart) + QueryPerformanceFrequency(&iCounterFreq); QueryPerformanceCounter(&iCounter); - iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq; + iCounter.QuadPart = iCounter.QuadPart * 1000 / iCounterFreq.QuadPart; return iCounter.u.LowPart; }
1
0
0
0
Andrew Eikum : oleaut32: Don't clear BSTR size.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: 3bc2ec33712ed57abf92b8014dda334cb9046d13 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3bc2ec33712ed57abf92b8014…
Author: Andrew Eikum <aeikum(a)codeweavers.com> Date: Tue Jan 5 13:38:21 2016 -0600 oleaut32: Don't clear BSTR size. The size is used during cache lookup. Clearing it will break lookup and prevent detection of double-freeing when warn+heap is enabled. Signed-off-by: Andrew Eikum <aeikum(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/oleaut32/oleaut.c | 1 - 1 file changed, 1 deletion(-) diff --git a/dlls/oleaut32/oleaut.c b/dlls/oleaut32/oleaut.c index 78cb083..214421c 100644 --- a/dlls/oleaut32/oleaut.c +++ b/dlls/oleaut32/oleaut.c @@ -277,7 +277,6 @@ void WINAPI SysFreeString(BSTR str) if(WARN_ON(heap)) { unsigned n = bstr_alloc_size(bstr->size) / sizeof(DWORD) - 1; - bstr->size = ARENA_FREE_FILLER; for(i=0; i<n; i++) bstr->u.dwptr[i] = ARENA_FREE_FILLER; }
1
0
0
0
Jacek Caban : mshtml: Properly convert VT_NULL to string in get_elem_attr_value_by_dispid.
by Alexandre Julliard
06 Jan '16
06 Jan '16
Module: wine Branch: master Commit: f394dca92a014fa07e0cec59f97fb9fd2ba157da URL:
http://source.winehq.org/git/wine.git/?a=commit;h=f394dca92a014fa07e0cec59f…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Tue Jan 5 18:53:21 2016 +0100 mshtml: Properly convert VT_NULL to string in get_elem_attr_value_by_dispid. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/htmlelem.c | 8 ++++++++ dlls/mshtml/tests/dom.c | 13 ++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index ce9d859..e5ae4e0 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -644,6 +644,8 @@ HRESULT get_elem_attr_value_by_dispid(HTMLElement *elem, DISPID dispid, DWORD fl EXCEPINFO excep; HRESULT hres; + static const WCHAR nullW[] = {'n','u','l','l',0}; + hres = IDispatchEx_InvokeEx(&elem->node.event_target.dispex.IDispatchEx_iface, dispid, LOCALE_SYSTEM_DEFAULT, DISPATCH_PROPERTYGET, &dispParams, ret, &excep, NULL); if(FAILED(hres)) @@ -653,6 +655,12 @@ HRESULT get_elem_attr_value_by_dispid(HTMLElement *elem, DISPID dispid, DWORD fl switch(V_VT(ret)) { case VT_BSTR: break; + case VT_NULL: + V_BSTR(ret) = SysAllocString(nullW); + if(!V_BSTR(ret)) + return E_OUTOFMEMORY; + V_VT(ret) = VT_BSTR; + break; case VT_DISPATCH: IDispatch_Release(V_DISPATCH(ret)); V_VT(ret) = VT_BSTR; diff --git a/dlls/mshtml/tests/dom.c b/dlls/mshtml/tests/dom.c index bcb016d..1be81e5 100644 --- a/dlls/mshtml/tests/dom.c +++ b/dlls/mshtml/tests/dom.c @@ -1411,8 +1411,19 @@ static void test_get_set_attr(IHTMLDocument2 *doc) ok(V_VT(&val) == VT_BOOL, "variant type should have been VT_BOOL (0x%x), was: 0x%x\n", VT_BOOL, V_VT(&val)); ok(V_BOOL(&val) == VARIANT_TRUE, "variant value should have been VARIANT_TRUE (0x%x), was %d\n", VARIANT_TRUE, V_BOOL(&val)); VariantClear(&val); - SysFreeString(bstr); + /* overwrite the attribute with null */ + V_VT(&val) = VT_NULL; + hres = IHTMLElement_setAttribute(elem, bstr, val, 0); + ok(hres == S_OK, "setAttribute failed: %08x\n", hres); + + hres = IHTMLElement_getAttribute(elem, bstr, 2, &val); + ok(hres == S_OK, "getAttribute failed: %08x\n", hres); + ok(V_VT(&val) == VT_BSTR, "V_VT(val) = %u, expected VT_BSTR", V_VT(&val)); + ok(!strcmp_wa(V_BSTR(&val), "null"), "V_BSTR(val) = %s, expected \"null\"\n", wine_dbgstr_w(V_BSTR(&val))); + VariantClear(&val); + + SysFreeString(bstr); IHTMLElement_Release(elem); }
1
0
0
0
← Newer
1
...
53
54
55
56
57
58
59
...
63
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
Results per page:
10
25
50
100
200