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
August 2022
----- 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
1 participants
596 discussions
Start a n
N
ew thread
Brendan Shanks : wow64: Copy floating point and extended registers in copy_context_64to32.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: 2599042221d7bcbafd2646178b47801fb080c1ae URL:
https://gitlab.winehq.org/wine/wine/-/commit/2599042221d7bcbafd2646178b4780…
Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Tue Aug 2 10:40:09 2022 -0700 wow64: Copy floating point and extended registers in copy_context_64to32. --- dlls/wow64cpu/cpu.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/dlls/wow64cpu/cpu.c b/dlls/wow64cpu/cpu.c index 34c3f3ad493..fa1c22aafc6 100644 --- a/dlls/wow64cpu/cpu.c +++ b/dlls/wow64cpu/cpu.c @@ -53,6 +53,51 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved ) return TRUE; } +/*********************************************************************** + * fpux_to_fpu + * + * Build a standard i386 FPU context from an extended one. + */ +static void fpux_to_fpu( I386_FLOATING_SAVE_AREA *fpu, const XMM_SAVE_AREA32 *fpux ) +{ + unsigned int i, tag, stack_top; + + fpu->ControlWord = fpux->ControlWord; + fpu->StatusWord = fpux->StatusWord; + fpu->ErrorOffset = fpux->ErrorOffset; + fpu->ErrorSelector = fpux->ErrorSelector | (fpux->ErrorOpcode << 16); + fpu->DataOffset = fpux->DataOffset; + fpu->DataSelector = fpux->DataSelector; + fpu->Cr0NpxState = fpux->StatusWord | 0xffff0000; + + stack_top = (fpux->StatusWord >> 11) & 7; + fpu->TagWord = 0xffff0000; + for (i = 0; i < 8; i++) + { + memcpy( &fpu->RegisterArea[10 * i], &fpux->FloatRegisters[i], 10 ); + if (!(fpux->TagWord & (1 << i))) tag = 3; /* empty */ + else + { + const M128A *reg = &fpux->FloatRegisters[(i - stack_top) & 7]; + if ((reg->High & 0x7fff) == 0x7fff) /* exponent all ones */ + { + tag = 2; /* special */ + } + else if (!(reg->High & 0x7fff)) /* exponent all zeroes */ + { + if (reg->Low) tag = 2; /* special */ + else tag = 1; /* zero */ + } + else + { + if (reg->Low >> 63) tag = 0; /* valid */ + else tag = 2; /* special */ + } + } + fpu->TagWord |= tag << (2 * i); + } +} + /********************************************************************** * copy_context_64to32 * @@ -97,7 +142,15 @@ static void copy_context_64to32( I386_CONTEXT *ctx32, DWORD flags, AMD64_CONTEXT ctx32->Dr6 = ctx64->Dr6; ctx32->Dr7 = ctx64->Dr7; } - /* FIXME: floating point + xstate */ + if (flags & CONTEXT_I386_FLOATING_POINT) + { + fpux_to_fpu( &ctx32->FloatSave, &ctx64->FltSave ); + } + if (flags & CONTEXT_I386_EXTENDED_REGISTERS) + { + *(XSAVE_FORMAT *)ctx32->ExtendedRegisters = ctx64->FltSave; + } + /* FIXME: xstate */ }
1
0
0
0
Alexandre Julliard : tiff: Import upstream release 4.4.0.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: f937ad5a6d92b892bf52b71b7f14304d25d4e6df URL:
https://gitlab.winehq.org/wine/wine/-/commit/f937ad5a6d92b892bf52b71b7f1430…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Aug 3 17:36:10 2022 +0200 tiff: Import upstream release 4.4.0. --- libs/tiff/libtiff/tif_close.c | 13 +- libs/tiff/libtiff/tif_config.h | 8 +- libs/tiff/libtiff/tif_dir.c | 67 +- libs/tiff/libtiff/tif_dir.h | 4 +- libs/tiff/libtiff/tif_dirinfo.c | 142 +- libs/tiff/libtiff/tif_dirread.c | 873 ++++++-- libs/tiff/libtiff/tif_dirwrite.c | 61 +- libs/tiff/libtiff/tif_fax3.c | 51 +- libs/tiff/libtiff/tif_jpeg.c | 4191 +++++++++++++++++++------------------- libs/tiff/libtiff/tif_luv.c | 14 +- libs/tiff/libtiff/tif_lzw.c | 661 +++--- libs/tiff/libtiff/tif_open.c | 13 +- libs/tiff/libtiff/tif_packbits.c | 10 +- libs/tiff/libtiff/tif_predict.c | 90 +- libs/tiff/libtiff/tif_read.c | 30 +- libs/tiff/libtiff/tif_win32.c | 1 + libs/tiff/libtiff/tif_write.c | 139 +- libs/tiff/libtiff/tiff.h | 2 +- libs/tiff/libtiff/tiffconf.h | 2 +- libs/tiff/libtiff/tiffio.h | 8 +- libs/tiff/libtiff/tiffiop.h | 35 +- libs/tiff/libtiff/tiffvers.h | 4 +- 22 files changed, 3728 insertions(+), 2691 deletions(-)
1
0
0
0
Alexandre Julliard : mpg123: Import upstream release 1.30.2.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: be227979b0fda95ec6aee139c176da07fa147419 URL:
https://gitlab.winehq.org/wine/wine/-/commit/be227979b0fda95ec6aee139c176da…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Aug 3 17:27:11 2022 +0200 mpg123: Import upstream release 1.30.2. --- libs/mpg123/config.h | 24 ++++++++++++++-- libs/mpg123/src/compat/compat.c | 25 ++++++++++++++-- libs/mpg123/src/compat/compat.h | 43 +++++++++++++++++++++++----- libs/mpg123/src/compat/compat_str.c | 23 +++++++++++---- libs/mpg123/src/intsym.h | 1 + libs/mpg123/src/libmpg123/frame.c | 6 ++++ libs/mpg123/src/libmpg123/id3.c | 7 ++--- libs/mpg123/src/libmpg123/libmpg123.c | 37 ++++++++++++++++++++++-- libs/mpg123/src/libmpg123/mpg123.h | 35 ++++++++++++++++++++-- libs/mpg123/src/libmpg123/mpg123lib_intern.h | 12 ++++++++ libs/mpg123/src/libmpg123/readers.c | 23 ++++++++++----- 11 files changed, 200 insertions(+), 36 deletions(-)
1
0
0
0
Alexandre Julliard : faudio: Import upstream release 22.08.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: ce0a985f1bc887c4a606697f635d1716232855ac URL:
https://gitlab.winehq.org/wine/wine/-/commit/ce0a985f1bc887c4a606697f635d17…
Author: Alexandre Julliard <julliard(a)winehq.org> Date: Wed Aug 3 17:13:51 2022 +0200 faudio: Import upstream release 22.08. --- libs/faudio/include/FAudio.h | 2 +- libs/faudio/src/FAudio_platform_win32.c | 2 +- libs/faudio/src/matrix_defaults.inl | 62 +++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/libs/faudio/include/FAudio.h b/libs/faudio/include/FAudio.h index f9dce8dfc16..88d5e996cbf 100644 --- a/libs/faudio/include/FAudio.h +++ b/libs/faudio/include/FAudio.h @@ -485,7 +485,7 @@ extern FAudioGUID DATAFORMAT_SUBTYPE_IEEE_FLOAT; #define FAUDIO_ABI_VERSION 0 #define FAUDIO_MAJOR_VERSION 22 -#define FAUDIO_MINOR_VERSION 7 +#define FAUDIO_MINOR_VERSION 8 #define FAUDIO_PATCH_VERSION 0 #define FAUDIO_COMPILED_VERSION ( \ diff --git a/libs/faudio/src/FAudio_platform_win32.c b/libs/faudio/src/FAudio_platform_win32.c index 29944edcfed..8ed9cde1c7d 100644 --- a/libs/faudio/src/FAudio_platform_win32.c +++ b/libs/faudio/src/FAudio_platform_win32.c @@ -582,7 +582,7 @@ FAudioThread FAudio_PlatformCreateThread( void FAudio_PlatformWaitThread(FAudioThread thread, int32_t *retval) { WaitForSingleObject(thread, INFINITE); - GetExitCodeThread(thread, (DWORD *)retval); + if (retval != NULL) GetExitCodeThread(thread, (DWORD *)retval); } void FAudio_PlatformThreadPriority(FAudioThreadPriority priority) diff --git a/libs/faudio/src/matrix_defaults.inl b/libs/faudio/src/matrix_defaults.inl index 2262a6a0744..6f540f289d3 100644 --- a/libs/faudio/src/matrix_defaults.inl +++ b/libs/faudio/src/matrix_defaults.inl @@ -1,6 +1,68 @@ /* This was generated by making 8 sources and 8 submixes, then assigning each * submix to each voice and dumping the output matrix. Terrible, but it worked! */ +/* +int main(int argc, char **argv) +{ + CoInitialize(NULL); + + IXAudio2 *engine; + XAudio2Create(&engine); + + IXAudio2MasteringVoice *master; + engine->CreateMasteringVoice(&master); + + FILE *fileOut = fopen("matrix_defaults.inl", "w"); + for (int srcChans = 1; srcChans < 9; srcChans += 1) + { + fprintf(fileOut, "{\n"); + for (int dstChans = 1; dstChans < 9; dstChans += 1) + { + IXAudio2SubmixVoice *submix; + engine->CreateSubmixVoice(&submix, dstChans, 48000); + + XAUDIO2_SEND_DESCRIPTOR sendDesc; + sendDesc.Flags = 0; + sendDesc.pOutputVoice = submix; + + XAUDIO2_VOICE_SENDS sends; + sends.SendCount = 1; + sends.pSends = &sendDesc; + + WAVEFORMATEX fmt; + fmt.wFormatTag = 1; + fmt.nChannels = srcChans; + fmt.nSamplesPerSec = 48000; + fmt.wBitsPerSample = 16; + fmt.nBlockAlign = srcChans * (fmt.wBitsPerSample / 8); + fmt.nAvgBytesPerSec = fmt.nBlockAlign * fmt.nSamplesPerSec; + fmt.cbSize = 0; + + IXAudio2SourceVoice *source; + engine->CreateSourceVoice(&source, &fmt, 0, 2.0f, NULL, &sends); + + float matrix[8 * 8]; + source->GetOutputMatrix(submix, srcChans, dstChans, matrix); + fprintf(fileOut, "\t{ "); + for (int i = 0; i < srcChans * dstChans; i += 1) + { + fprintf(fileOut, "%.9f%s ", matrix[i], (i == ((srcChans * dstChans) - 1)) ? "" : ","); + } + fprintf(fileOut, "}%s\n", (dstChans == 8) ? "" : ","); + + source->DestroyVoice(); + submix->DestroyVoice(); + } + fprintf(fileOut, "}%s\n", (srcChans == 8) ? "" : ","); + } + fclose(fileOut); + + master->DestroyVoice(); + engine->Release(); + CoUninitialize(); + return 0; +} +*/ { /* 1 x 1 */ { 1.000000000f },
1
0
0
0
Nikolay Sivov : dwrite: Fix stretch value validation in CreateTextFormat().
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: 2dd903885becd74264393007a5e8c4e47c52c5e8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/2dd903885becd74264393007a5e8c4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Aug 3 13:41:35 2022 +0300 dwrite: Fix stretch value validation in CreateTextFormat(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- dlls/dwrite/format.c | 11 +++++++---- dlls/dwrite/tests/layout.c | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/dlls/dwrite/format.c b/dlls/dwrite/format.c index dd120fe032e..01a6dfd06c9 100644 --- a/dlls/dwrite/format.c +++ b/dlls/dwrite/format.c @@ -1,5 +1,5 @@ /* - * Copyright 2012, 2014-2021 Nikolay Sivov for CodeWeavers + * Copyright 2012, 2014-2022 Nikolay Sivov for CodeWeavers * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -723,10 +723,13 @@ HRESULT create_text_format(const WCHAR *family_name, IDWriteFontCollection *coll if (size <= 0.0f) return E_INVALIDARG; - if (((UINT32)weight > DWRITE_FONT_WEIGHT_ULTRA_BLACK) || - ((UINT32)stretch > DWRITE_FONT_STRETCH_ULTRA_EXPANDED) || - ((UINT32)style > DWRITE_FONT_STYLE_ITALIC)) + if ((UINT32)weight > DWRITE_FONT_WEIGHT_ULTRA_BLACK + || stretch == DWRITE_FONT_STRETCH_UNDEFINED + || (UINT32)stretch > DWRITE_FONT_STRETCH_ULTRA_EXPANDED + || (UINT32)style > DWRITE_FONT_STYLE_ITALIC) + { return E_INVALIDARG; + } if (!(object = calloc(1, sizeof(*object)))) return E_OUTOFMEMORY; diff --git a/dlls/dwrite/tests/layout.c b/dlls/dwrite/tests/layout.c index 5e7e1b16d27..3b2289b40ce 100644 --- a/dlls/dwrite/tests/layout.c +++ b/dlls/dwrite/tests/layout.c @@ -1196,6 +1196,10 @@ static void test_CreateTextFormat(void) 10, 10.0f, L"en-us", &format); ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + hr = IDWriteFactory_CreateTextFormat(factory, L"Tahoma", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_ITALIC, + DWRITE_FONT_STRETCH_UNDEFINED, 10.0f, L"en-us", &format); + ok(hr == E_INVALIDARG, "Unexpected hr %#lx.\n", hr); + /* empty family name */ hr = IDWriteFactory_CreateTextFormat(factory, L"", NULL, DWRITE_FONT_WEIGHT_NORMAL, DWRITE_FONT_STYLE_NORMAL, DWRITE_FONT_STRETCH_NORMAL, 10.0f, L"en-us", &format);
1
0
0
0
Santino Mazza : ncrypt: Initial implementation for NCryptEncrypt.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: 27cdb54bd890fb3bd57ad7840b77495619e966c8 URL:
https://gitlab.winehq.org/wine/wine/-/commit/27cdb54bd890fb3bd57ad7840b7749…
Author: Santino Mazza <mazzasantino1206(a)gmail.com> Date: Sun Jul 31 13:51:05 2022 -0300 ncrypt: Initial implementation for NCryptEncrypt. Signed-off-by: Santino Mazza <mazzasantino1206(a)gmail.com> --- dlls/ncrypt/main.c | 24 ++++++++++++++++++++++-- dlls/ncrypt/tests/ncrypt.c | 6 ++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/dlls/ncrypt/main.c b/dlls/ncrypt/main.c index 58503338d6e..9f859acfdf9 100644 --- a/dlls/ncrypt/main.c +++ b/dlls/ncrypt/main.c @@ -43,6 +43,7 @@ static SECURITY_STATUS map_ntstatus(NTSTATUS status) case STATUS_NO_MEMORY: return NTE_NO_MEMORY; case STATUS_NOT_SUPPORTED: return NTE_NOT_SUPPORTED; case NTE_BAD_DATA: return NTE_BAD_DATA; + case STATUS_BUFFER_TOO_SMALL: return NTE_BUFFER_TOO_SMALL; default: FIXME("unhandled status %#lx\n", status); return NTE_INTERNAL_ERROR; @@ -227,9 +228,28 @@ SECURITY_STATUS WINAPI NCryptDeleteKey(NCRYPT_KEY_HANDLE key, DWORD flags) SECURITY_STATUS WINAPI NCryptEncrypt(NCRYPT_KEY_HANDLE key, BYTE *input, DWORD insize, void *padding, BYTE *output, DWORD outsize, DWORD *result, DWORD flags) { - FIXME("(%#Ix, %p, %lu, %p, %p, %lu, %p, %#lx): stub\n", key, input, insize, padding, + struct object *key_object = (struct object *)key; + + TRACE("(%#Ix, %p, %lu, %p, %p, %lu, %p, %#lx)\n", key, input, insize, padding, output, outsize, result, flags); - return NTE_NOT_SUPPORTED; + + if (flags & ~(NCRYPT_NO_PADDING_FLAG | NCRYPT_PAD_OAEP_FLAG + | NCRYPT_PAD_PKCS1_FLAG | NCRYPT_SILENT_FLAG)) + { + FIXME("Flags %lx not supported\n", flags); + return NTE_BAD_FLAGS; + } + + if (flags & NCRYPT_NO_PADDING_FLAG || flags & NCRYPT_PAD_OAEP_FLAG) + { + FIXME("No padding and oaep padding not supported\n"); + return NTE_NOT_SUPPORTED; + } + + if (key_object->type != KEY) return NTE_INVALID_HANDLE; + + return map_ntstatus(BCryptEncrypt(key_object->key.bcrypt_key, input, insize, padding, + NULL, 0, output, outsize, result, flags)); } SECURITY_STATUS WINAPI NCryptEnumAlgorithms(NCRYPT_PROV_HANDLE provider, DWORD alg_ops, diff --git a/dlls/ncrypt/tests/ncrypt.c b/dlls/ncrypt/tests/ncrypt.c index 81b737c9a21..bd2f63bea87 100644 --- a/dlls/ncrypt/tests/ncrypt.c +++ b/dlls/ncrypt/tests/ncrypt.c @@ -550,7 +550,6 @@ static void test_NCryptEncrypt(void) BYTE *output_b; DWORD output_size; - todo_wine { NCryptOpenStorageProvider(&prov, NULL, 0); NCryptCreatePersistedKey(prov, &key, BCRYPT_RSA_ALGORITHM, NULL, 0, 0); @@ -562,6 +561,7 @@ static void test_NCryptEncrypt(void) /* Test encrypt with a non finalized key */ ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, NULL, 0, &output_size, NCRYPT_PAD_PKCS1_FLAG); + todo_wine ok(ret == NTE_BAD_KEY_STATE, "got %lx\n", ret); NCryptFinalizeKey(key, 0); @@ -572,6 +572,8 @@ static void test_NCryptEncrypt(void) ok(ret == NTE_BAD_FLAGS, "got %lx\n", ret); /* Test no padding with RSA */ + todo_wine + { ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, NULL, 0, &output_size, NCRYPT_NO_PADDING_FLAG); ok(ret == ERROR_SUCCESS, "got %lx\n", ret); @@ -582,6 +584,7 @@ static void test_NCryptEncrypt(void) &output_size, NCRYPT_NO_PADDING_FLAG); ok(ret == NTE_INVALID_PARAMETER, "got %lx\n", ret); free(output_a); + } /* Test output RSA with PKCS1. PKCS1 should append a random padding to the data, so the output should be different * with each call. */ @@ -611,7 +614,6 @@ static void test_NCryptEncrypt(void) free(output_b); NCryptFreeObject(prov); - } } START_TEST(ncrypt)
1
0
0
0
Santino Mazza : bcrypt: Initial RSA encryption implementation.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: dd61c5638a0e597a488ca74e48f1ac97bc008f93 URL:
https://gitlab.winehq.org/wine/wine/-/commit/dd61c5638a0e597a488ca74e48f1ac…
Author: Santino Mazza <mazzasantino1206(a)gmail.com> Date: Fri Jul 29 14:42:49 2022 -0300 bcrypt: Initial RSA encryption implementation. Signed-off-by: Santino Mazza <mazzasantino1206(a)gmail.com> --- dlls/bcrypt/bcrypt_internal.h | 11 +++++++ dlls/bcrypt/bcrypt_main.c | 33 +++++++++++++++------ dlls/bcrypt/gnutls.c | 69 ++++++++++++++++++++++++++++++++++++++++++- dlls/bcrypt/tests/bcrypt.c | 2 ++ 4 files changed, 105 insertions(+), 10 deletions(-)
1
0
0
0
Santino Mazza : bcrypt/tests: Test for BCryptEncrypt with RSA keys.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: 4a395899eabab73c3c5045a17d728e7668225b8f URL:
https://gitlab.winehq.org/wine/wine/-/commit/4a395899eabab73c3c5045a17d728e…
Author: Santino Mazza <mazzasantino1206(a)gmail.com> Date: Thu Jul 28 14:10:27 2022 -0300 bcrypt/tests: Test for BCryptEncrypt with RSA keys. Signed-off-by: Santino Mazza <mazzasantino1206(a)gmail.com> --- dlls/bcrypt/tests/bcrypt.c | 111 +++++++++++++++++++++++++++++++++++++++++++++ include/bcrypt.h | 6 +++ 2 files changed, 117 insertions(+) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 08ce360cac0..fca7ae4e1ed 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -2019,6 +2019,114 @@ static UCHAR rsaPublicBlobWithInvalidPublicExpSize[] = 0x87, 0x75, 0x33, 0x15, 0xb8, 0xde, 0x32, 0x30, 0xb4, 0x5e, 0xfd }; +static void test_rsa_encrypt(void) +{ + static UCHAR input[] = "Hello World!"; + static UCHAR input_no_padding[64] = { 0 }; + BCRYPT_ALG_HANDLE rsa = 0; + BCRYPT_KEY_HANDLE key = 0; + NTSTATUS ret = 0; + DWORD encrypted_size = 60; + UCHAR *encrypted_a = NULL; + UCHAR *encrypted_b = NULL; + DWORD decrypted_size = 0; + UCHAR *decrypted = NULL; + BCRYPT_OAEP_PADDING_INFO oaep_pad; + oaep_pad.pszAlgId = BCRYPT_MD5_ALGORITHM; + oaep_pad.pbLabel = (PUCHAR)"test"; + oaep_pad.cbLabel = 5; + + BCryptOpenAlgorithmProvider(&rsa, BCRYPT_RSA_ALGORITHM, NULL, 0); + BCryptGenerateKeyPair(rsa, &key, 512, 0); + + todo_wine { + /* Not finalized key */ + ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, NULL, 0, &encrypted_size, 0); + ok(ret == STATUS_INVALID_HANDLE, "got %lx\n", ret); + + BCryptFinalizeKeyPair(key, 0); + + /* No padding */ + memset(input_no_padding, 0, sizeof(input_no_padding)); + strcpy((char *)input_no_padding, "Hello World"); + ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_NONE); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ok(encrypted_size == 64, "got size of %ld\n", encrypted_size); + + encrypted_a = malloc(encrypted_size); + memset(encrypted_a, 0, encrypted_size); + encrypted_b = malloc(encrypted_size); + memset(encrypted_b, 0xff, encrypted_size); + + ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_NONE); + ok(ret == STATUS_INVALID_PARAMETER, "got %lx\n", ret); + + ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_a, 12, &encrypted_size, BCRYPT_PAD_NONE); + ok(ret == STATUS_BUFFER_TOO_SMALL, "got %lx\n", ret); + + ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_NONE); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ret = BCryptEncrypt(key, input_no_padding, sizeof(input_no_padding), NULL, NULL, 0, encrypted_b, encrypted_size, &encrypted_size, BCRYPT_PAD_NONE); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ok(!memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs should be the same\n"); + + BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_NONE); + decrypted = malloc(decrypted_size); + BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_NONE); + ok(!memcmp(decrypted, input_no_padding, sizeof(input_no_padding)), "Decrypted output it's not what expected\n"); + free(decrypted); + + encrypted_size = 60; + /* PKCS1 Padding */ + ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_PKCS1); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ok(encrypted_size == 64, "got size of %ld\n", encrypted_size); + + encrypted_a = realloc(encrypted_a, encrypted_size); + memset(encrypted_a, 0, encrypted_size); + encrypted_b = realloc(encrypted_b, encrypted_size); + memset(encrypted_b, 0, encrypted_size); + + ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_PKCS1); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ret = BCryptEncrypt(key, input, sizeof(input), NULL, NULL, 0, encrypted_b, encrypted_size, &encrypted_size, BCRYPT_PAD_PKCS1); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ok(memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs are the same\n"); + + BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_PKCS1); + decrypted = malloc(decrypted_size); + BCryptDecrypt(key, encrypted_a, encrypted_size, NULL, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_PKCS1); + ok(!memcmp(decrypted, input, sizeof(input)), "Decrypted output it's not what expected\n"); + free(decrypted); + + encrypted_size = 60; + /* OAEP Padding */ + ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, NULL, 0, &encrypted_size, BCRYPT_PAD_OAEP); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ok(encrypted_size == 64, "got size of %ld\n", encrypted_size); + + encrypted_a = realloc(encrypted_a, encrypted_size); + memset(encrypted_a, 0, encrypted_size); + encrypted_b = realloc(encrypted_b, encrypted_size); + memset(encrypted_b, 0, encrypted_size); + + ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_a, encrypted_size, &encrypted_size, BCRYPT_PAD_OAEP); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ret = BCryptEncrypt(key, input, sizeof(input), &oaep_pad, NULL, 0, encrypted_b, encrypted_size, &encrypted_size, BCRYPT_PAD_OAEP); + ok(ret == STATUS_SUCCESS, "got %lx\n", ret); + ok(memcmp(encrypted_a, encrypted_b, encrypted_size), "Both outputs are the same\n"); + + BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, NULL, 0, &decrypted_size, BCRYPT_PAD_OAEP); + decrypted = malloc(decrypted_size); + BCryptDecrypt(key, encrypted_a, encrypted_size, &oaep_pad, NULL, 0, decrypted, decrypted_size, &decrypted_size, BCRYPT_PAD_OAEP); + ok(!memcmp(decrypted, input, sizeof(input)), "Decrypted output it's not what expected\n"); + } + free(decrypted); + + free(encrypted_a); + free(encrypted_b); +} + static void test_RSA(void) { static UCHAR hash[] = @@ -2202,6 +2310,9 @@ static void test_RSA(void) ret = BCryptCloseAlgorithmProvider(alg, 0); ok(!ret, "got %#lx\n", ret); + + /* RSA encryption */ + test_rsa_encrypt(); } static void test_RSA_SIGN(void) diff --git a/include/bcrypt.h b/include/bcrypt.h index fbfb5099c09..fd660c1843c 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -284,6 +284,12 @@ typedef struct _BCRYPT_PKCS1_PADDING_INFO LPCWSTR pszAlgId; } BCRYPT_PKCS1_PADDING_INFO; +typedef struct _BCRYPT_OAEP_PADDING_INFO { + LPCWSTR pszAlgId; + PUCHAR pbLabel; + ULONG cbLabel; +} BCRYPT_OAEP_PADDING_INFO; + #define BCRYPT_PAD_NONE 0x00000001 #define BCRYPT_PAD_PKCS1 0x00000002 #define BCRYPT_PAD_OAEP 0x00000004
1
0
0
0
Santino Mazza : ncrypt/tests: Test for NCryptEncrypt with RSA and PKCS1 padding.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: 68f6d6ba9e649599412e291b47424497a4ae0622 URL:
https://gitlab.winehq.org/wine/wine/-/commit/68f6d6ba9e649599412e291b474244…
Author: Santino Mazza <mazzasantino1206(a)gmail.com> Date: Tue Jul 26 19:39:37 2022 -0300 ncrypt/tests: Test for NCryptEncrypt with RSA and PKCS1 padding. Signed-off-by: Santino Mazza <mazzasantino1206(a)gmail.com> --- dlls/ncrypt/tests/ncrypt.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/dlls/ncrypt/tests/ncrypt.c b/dlls/ncrypt/tests/ncrypt.c index 5808a3bb30a..81b737c9a21 100644 --- a/dlls/ncrypt/tests/ncrypt.c +++ b/dlls/ncrypt/tests/ncrypt.c @@ -539,6 +539,81 @@ static void test_NCryptIsAlgSupported(void) NCryptFreeObject(prov); } +static UCHAR data_to_encrypt[12] = "Hello world"; + +static void test_NCryptEncrypt(void) +{ + NCRYPT_PROV_HANDLE prov; + NCRYPT_KEY_HANDLE key; + SECURITY_STATUS ret; + BYTE *output_a; + BYTE *output_b; + DWORD output_size; + + todo_wine { + NCryptOpenStorageProvider(&prov, NULL, 0); + NCryptCreatePersistedKey(prov, &key, BCRYPT_RSA_ALGORITHM, NULL, 0, 0); + + /* Test encrypt with invalid key handle */ + ret = NCryptEncrypt(prov, data_to_encrypt, sizeof(data_to_encrypt), NULL, NULL, 0, + &output_size, NCRYPT_PAD_PKCS1_FLAG); + ok(ret == NTE_INVALID_HANDLE, "got %lx\n", ret); + + /* Test encrypt with a non finalized key */ + ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, NULL, 0, + &output_size, NCRYPT_PAD_PKCS1_FLAG); + ok(ret == NTE_BAD_KEY_STATE, "got %lx\n", ret); + + NCryptFinalizeKey(key, 0); + + /* Test encrypt with invalid flags */ + ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, NULL, 0, + &output_size, 51342); + ok(ret == NTE_BAD_FLAGS, "got %lx\n", ret); + + /* Test no padding with RSA */ + ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, NULL, 0, &output_size, + NCRYPT_NO_PADDING_FLAG); + ok(ret == ERROR_SUCCESS, "got %lx\n", ret); + ok(output_size == 128, "got %ld\n", output_size); + + output_a = malloc(output_size); + ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, output_a, output_size, + &output_size, NCRYPT_NO_PADDING_FLAG); + ok(ret == NTE_INVALID_PARAMETER, "got %lx\n", ret); + free(output_a); + + /* Test output RSA with PKCS1. PKCS1 should append a random padding to the data, so the output should be different + * with each call. */ + ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, NULL, 0, + &output_size, NCRYPT_PAD_PKCS1_FLAG); + ok(ret == ERROR_SUCCESS, "got %lx\n", ret); + ok(output_size == 128, "got %ld\n", output_size); + + output_a = malloc(output_size); + output_b = malloc(output_size); + + ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, output_a, 12, + &output_size, NCRYPT_PAD_PKCS1_FLAG); + ok(ret == NTE_BUFFER_TOO_SMALL, "got %lx\n", ret); + + ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, output_a, output_size, + &output_size, NCRYPT_PAD_PKCS1_FLAG); + ok(ret == ERROR_SUCCESS, "got %lx\n", ret); + + ret = NCryptEncrypt(key, data_to_encrypt, sizeof(data_to_encrypt), NULL, output_b, output_size, + &output_size, NCRYPT_PAD_PKCS1_FLAG); + ok(ret == ERROR_SUCCESS, "got %lx\n", ret); + ok(memcmp(output_a, output_b, 128), "expected to have different outputs.\n"); + + NCryptFreeObject(key); + free(output_a); + free(output_b); + + NCryptFreeObject(prov); + } +} + START_TEST(ncrypt) { test_key_import_rsa(); @@ -549,4 +624,5 @@ START_TEST(ncrypt) test_finalize_key(); test_verify_signature(); test_NCryptIsAlgSupported(); + test_NCryptEncrypt(); }
1
0
0
0
Shaun Ren : webservices: Support faults in error.
by Alexandre Julliard
03 Aug '22
03 Aug '22
Module: wine Branch: master Commit: ac90bc1e162c209bb28cb2c06c3bab42f33a8a10 URL:
https://gitlab.winehq.org/wine/wine/-/commit/ac90bc1e162c209bb28cb2c06c3bab…
Author: Shaun Ren <sren(a)codeweavers.com> Date: Fri Jul 22 14:17:42 2022 -0400 webservices: Support faults in error. Signed-off-by: Shaun Ren <sren(a)codeweavers.com> --- dlls/webservices/error.c | 348 +++++++++++++++++++++++++++++++++ dlls/webservices/tests/reader.c | 310 +++++++++++++++++++++++++++++ dlls/webservices/webservices.spec | 6 +- dlls/webservices/webservices_private.h | 2 + include/webservices.h | 39 ++++ 5 files changed, 702 insertions(+), 3 deletions(-)
1
0
0
0
← Newer
1
...
51
52
53
54
55
56
57
...
60
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
Results per page:
10
25
50
100
200