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
March 2018
----- 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
785 discussions
Start a n
N
ew thread
Henri Verbeet : wined3d: Simplify context_resource_released().
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: e5ab987d601ed23e63d22d33580af404ae3879ce URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e5ab987d601ed23e63d22d33…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Mar 22 14:40:44 2018 +0430 wined3d: Simplify context_resource_released(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/context.c | 30 +++++++++--------------------- dlls/wined3d/resource.c | 2 +- dlls/wined3d/wined3d_private.h | 3 +-- 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index db32f1d..04756be 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -1055,34 +1055,22 @@ static void context_queue_fbo_entry_destruction(struct wined3d_context *context, list_add_head(&context->fbo_destroy_list, &entry->entry); } -void context_resource_released(const struct wined3d_device *device, - struct wined3d_resource *resource, enum wined3d_resource_type type) +void context_resource_released(const struct wined3d_device *device, struct wined3d_resource *resource) { - struct wined3d_texture *texture; - UINT i; + unsigned int i; if (!device->d3d_initialized) return; - switch (type) + for (i = 0; i < device->context_count; ++i) { - case WINED3D_RTYPE_TEXTURE_2D: - case WINED3D_RTYPE_TEXTURE_3D: - texture = texture_from_resource(resource); - - for (i = 0; i < device->context_count; ++i) - { - struct wined3d_context *context = device->contexts[i]; - if (context->current_rt.texture == texture) - { - context->current_rt.texture = NULL; - context->current_rt.sub_resource_idx = 0; - } - } - break; + struct wined3d_context *context = device->contexts[i]; - default: - break; + if (&context->current_rt.texture->resource == resource) + { + context->current_rt.texture = NULL; + context->current_rt.sub_resource_idx = 0; + } } } diff --git a/dlls/wined3d/resource.c b/dlls/wined3d/resource.c index 8968c16..a95d6f5 100644 --- a/dlls/wined3d/resource.c +++ b/dlls/wined3d/resource.c @@ -222,7 +222,7 @@ static void wined3d_resource_destroy_object(void *object) struct wined3d_resource *resource = object; wined3d_resource_free_sysmem(resource); - context_resource_released(resource->device, resource, resource->type); + context_resource_released(resource->device, resource); wined3d_resource_release(resource); } diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 5e8734e..506f7db 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2171,8 +2171,7 @@ void *context_map_bo_address(struct wined3d_context *context, const struct wined struct wined3d_context *context_reacquire(const struct wined3d_device *device, struct wined3d_context *context) DECLSPEC_HIDDEN; void context_release(struct wined3d_context *context) DECLSPEC_HIDDEN; -void context_resource_released(const struct wined3d_device *device, - struct wined3d_resource *resource, enum wined3d_resource_type type) DECLSPEC_HIDDEN; +void context_resource_released(const struct wined3d_device *device, struct wined3d_resource *resource) DECLSPEC_HIDDEN; void context_restore(struct wined3d_context *context, struct wined3d_texture *texture, unsigned int sub_resource_idx) DECLSPEC_HIDDEN; BOOL context_set_current(struct wined3d_context *ctx) DECLSPEC_HIDDEN;
1
0
0
0
Henri Verbeet : wined3d: Get rid of the "StrictDrawOrdering" setting.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: 70f017ac4d40642195947f6e03aff83c246dede8 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=70f017ac4d40642195947f6e…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Mar 22 14:40:43 2018 +0430 wined3d: Get rid of the "StrictDrawOrdering" setting. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/arb_program_shader.c | 5 ++--- dlls/wined3d/buffer.c | 2 -- dlls/wined3d/context.c | 6 ------ dlls/wined3d/device.c | 5 ++--- dlls/wined3d/surface.c | 14 +++----------- dlls/wined3d/texture.c | 3 --- dlls/wined3d/wined3d_main.c | 8 -------- dlls/wined3d/wined3d_private.h | 1 - 8 files changed, 7 insertions(+), 37 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index e9c9d7d..4b4cd4e 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -7886,9 +7886,8 @@ static DWORD arbfp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_bl /* Leave the opengl state valid for blitting */ arbfp_blit_unset(context->gl_info); - if (wined3d_settings.strict_draw_ordering - || (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture))) - context->gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + if (dst_texture->swapchain && (dst_texture->swapchain->front_buffer == dst_texture)) + context->gl_info->gl_ops.gl.p_glFlush(); return dst_location; } diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c index 1055326..5b92470 100644 --- a/dlls/wined3d/buffer.c +++ b/dlls/wined3d/buffer.c @@ -1183,8 +1183,6 @@ static void wined3d_buffer_unmap(struct wined3d_buffer *buffer) } GL_EXTCALL(glUnmapBuffer(buffer->buffer_type_hint)); - if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ context_release(context); buffer_clear_dirty_areas(buffer); diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c index 34102c7..db32f1d 100644 --- a/dlls/wined3d/context.c +++ b/dlls/wined3d/context.c @@ -4322,9 +4322,6 @@ void dispatch_compute(struct wined3d_device *device, const struct wined3d_state GL_EXTCALL(glMemoryBarrier(GL_ALL_BARRIER_BITS)); checkGLcall("glMemoryBarrier"); - if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - context_release(context); } @@ -4985,8 +4982,5 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s for (i = 0; i < context->buffer_fence_count; ++i) wined3d_fence_issue(context->buffer_fences[i], device); - if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - context_release(context); } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index c5517f5..d4e39db 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -457,9 +457,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c } } - if (wined3d_settings.strict_draw_ordering || (flags & WINED3DCLEAR_TARGET - && target->swapchain && target->swapchain->front_buffer == target)) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + if (flags & WINED3DCLEAR_TARGET && target->swapchain && target->swapchain->front_buffer == target) + gl_info->gl_ops.gl.p_glFlush(); context_release(context); } diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 2a725e6..ea6a984 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -337,9 +337,6 @@ static void texture2d_depth_blt_fbo(const struct wined3d_device *device, struct gl_info->fbo_ops.glBlitFramebuffer(src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, gl_mask, GL_NEAREST); checkGLcall("glBlitFramebuffer()"); - - if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ } static BOOL is_multisample_location(const struct wined3d_texture *texture, DWORD location) @@ -489,8 +486,7 @@ static void texture2d_blt_fbo(const struct wined3d_device *device, struct wined3 dst_rect->left, dst_rect->top, dst_rect->right, dst_rect->bottom, GL_COLOR_BUFFER_BIT, gl_filter); checkGLcall("glBlitFramebuffer()"); - if (wined3d_settings.strict_draw_ordering || (dst_location == WINED3D_LOCATION_DRAWABLE - && dst_texture->swapchain->front_buffer == dst_texture)) + if (dst_location == WINED3D_LOCATION_DRAWABLE && dst_texture->swapchain->front_buffer == dst_texture) gl_info->gl_ops.gl.p_glFlush(); if (restore_texture) @@ -1741,9 +1737,6 @@ static void fb_copy_to_texture_hwstretch(struct wined3d_texture *dst_texture, un checkGLcall("glDeleteTextures(1, &backup)"); } - if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ - context_release(context); /* The texture is now most up to date - If the surface is a render target @@ -2662,9 +2655,8 @@ static DWORD ffp_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit checkGLcall("glDisable(GL_TEXTURE_RECTANGLE_ARB)"); } - if (wined3d_settings.strict_draw_ordering - || (dst_texture->swapchain && dst_texture->swapchain->front_buffer == dst_texture)) - gl_info->gl_ops.gl.p_glFlush(); /* Flush to ensure ordering across contexts. */ + if (dst_texture->swapchain && dst_texture->swapchain->front_buffer == dst_texture) + gl_info->gl_ops.gl.p_glFlush(); /* Restore the color key parameters */ wined3d_texture_set_color_key(src_texture, WINED3D_CKEY_SRC_BLT, diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 187e2a2..9e6b599 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -1931,9 +1931,6 @@ void wined3d_texture_upload_data(struct wined3d_texture *texture, unsigned int s } heap_free(converted_mem); - if (wined3d_settings.strict_draw_ordering) - gl_info->gl_ops.gl.p_glFlush(); - if (gl_info->quirks & WINED3D_QUIRK_FBO_TEX_UPDATE) { struct wined3d_device *device = texture->resource.device; diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c index b57bcdc..56fae6b 100644 --- a/dlls/wined3d/wined3d_main.c +++ b/dlls/wined3d/wined3d_main.c @@ -83,7 +83,6 @@ struct wined3d_settings wined3d_settings = NULL, /* No wine logo by default */ TRUE, /* Prefer multisample textures to multisample renderbuffers. */ ~0u, /* Don't force a specific sample count by default. */ - FALSE, /* No strict draw ordering. */ FALSE, /* Don't range check relative addressing indices in float constants. */ ~0U, /* No VS shader model limit by default. */ ~0U, /* No HS shader model limit by default. */ @@ -290,13 +289,6 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL) if (!get_config_key_dword(hkey, appkey, "SampleCount", &wined3d_settings.sample_count)) ERR_(winediag)("Forcing sample count to %u. This may not be compatible with all applications.\n", wined3d_settings.sample_count); - if (!get_config_key(hkey, appkey, "StrictDrawOrdering", buffer, size) - && !strcmp(buffer,"enabled")) - { - ERR_(winediag)("\"StrictDrawOrdering\" is deprecated, please use \"csmt\" instead.\n"); - TRACE("Enforcing strict draw ordering.\n"); - wined3d_settings.strict_draw_ordering = TRUE; - } if (!get_config_key(hkey, appkey, "CheckFloatConstants", buffer, size) && !strcmp(buffer, "enabled")) { diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index fdbcd7c..5e8734e 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -395,7 +395,6 @@ struct wined3d_settings char *logo; unsigned int multisample_textures; unsigned int sample_count; - BOOL strict_draw_ordering; BOOL check_float_constants; unsigned int max_sm_vs; unsigned int max_sm_hs;
1
0
0
0
Andrew Wesie : bcrypt: Fix BCryptEncrypt with AES_GCM and no input and no output.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: 5118eb3ab5e3ba063e55472f4bacdce9311a273d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=5118eb3ab5e3ba063e55472f…
Author: Andrew Wesie <awesie(a)gmail.com> Date: Thu Mar 22 11:33:40 2018 +0100 bcrypt: Fix BCryptEncrypt with AES_GCM and no input and no output. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/bcrypt_main.c | 2 +- dlls/bcrypt/tests/bcrypt.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index b21dc1f..e05e94c 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -1440,7 +1440,7 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp *ret_len = input_len; if (flags & BCRYPT_BLOCK_PADDING) return STATUS_INVALID_PARAMETER; - if (!output) return STATUS_SUCCESS; + if (input && !output) return STATUS_SUCCESS; if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL; if (auth_info->pbAuthData && (status = key_set_auth_data( key, auth_info->pbAuthData, auth_info->cbAuthData ))) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 0bd91af..d38e581 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -647,6 +647,9 @@ static void test_BCryptEncrypt(void) {0x9a,0x92,0x32,0x2c,0x61,0x2a,0xae,0xef,0x66,0x2a,0xfb,0x55,0xe9,0x48,0xdf,0xbd}; static UCHAR expected_tag3[] = {0x17,0x9d,0xc0,0x7a,0xf0,0xcf,0xaa,0xd5,0x1c,0x11,0xc4,0x4b,0xd6,0xa3,0x3e,0x77}; + static UCHAR expected_tag4[] = + {0x4c,0x42,0x83,0x9e,0x8d,0x40,0xf1,0x19,0xd6,0x2b,0x1c,0x66,0x03,0x2b,0x39,0x63}; + BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO auth_info; UCHAR *buf, ciphertext[48], ivbuf[16], tag[16]; BCRYPT_AUTH_TAG_LENGTHS_STRUCT tag_length; @@ -842,6 +845,21 @@ static void test_BCryptEncrypt(void) for (i = 0; i < 16; i++) ok(tag[i] == expected_tag3[i], "%u: %02x != %02x\n", i, tag[i], expected_tag3[i]); + memset(tag, 0xff, sizeof(tag)); + ret = pBCryptEncrypt(key, data2, 0, &auth_info, ivbuf, 16, NULL, 0, &size, 0); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(!size, "got %u\n", size); + for (i = 0; i < 16; i++) + ok(tag[i] == 0xff, "%u: %02x != %02x\n", i, tag[i], 0xff); + + memset(tag, 0xff, sizeof(tag)); + ret = pBCryptEncrypt(key, NULL, 0, &auth_info, ivbuf, 16, NULL, 0, &size, 0); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(!size, "got %u\n", size); + ok(!memcmp(tag, expected_tag4, sizeof(expected_tag4)), "wrong tag\n"); + for (i = 0; i < 16; i++) + ok(tag[i] == expected_tag4[i], "%u: %02x != %02x\n", i, tag[i], expected_tag4[i]); + /* test with padding */ memcpy(ivbuf, iv, sizeof(iv)); memset(ciphertext, 0, sizeof(ciphertext));
1
0
0
0
Hans Leidekker : bcrypt/tests: Add more tests for BCryptGenerateSymmetricKey and BCryptDuplicateKey.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: aabc55c491be9df24fd471ab002be1a16b597b59 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=aabc55c491be9df24fd471ab…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Thu Mar 22 11:33:39 2018 +0100 bcrypt/tests: Add more tests for BCryptGenerateSymmetricKey and BCryptDuplicateKey. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/tests/bcrypt.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index d33c096..0bd91af 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -516,6 +516,11 @@ static void test_BCryptGenerateSymmetricKey(void) ret = pBCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + key = (void *)0xdeadbeef; + ret = pBCryptGenerateSymmetricKey(NULL, &key, NULL, 0, secret, sizeof(secret), 0); + ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret); + ok(key == (void *)0xdeadbeef, "got %p\n", key); + key = NULL; buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); ret = pBCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0); @@ -551,8 +556,10 @@ static void test_BCryptGenerateSymmetricKey(void) for (i = 0; i < 16; i++) ok(ciphertext[i] == expected[i], "%u: %02x != %02x\n", i, ciphertext[i], expected[i]); + key2 = (void *)0xdeadbeef; ret = pBCryptDuplicateKey(NULL, &key2, NULL, 0, 0); ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret); + ok(key2 == (void *)0xdeadbeef, "got %p\n", key2); if (0) /* crashes on some Windows versions */ { @@ -660,9 +667,11 @@ static void test_BCryptEncrypt(void) ret = pBCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + key = NULL; buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); ret = pBCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(key != NULL, "key not set\n"); /* input size is a multiple of block size */ size = 0; @@ -771,9 +780,11 @@ static void test_BCryptEncrypt(void) ret = pBCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + key = NULL; buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); ret = pBCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(key != NULL, "key not set\n"); memset(&auth_info, 0, sizeof(auth_info)); auth_info.cbSize = sizeof(auth_info); @@ -913,9 +924,11 @@ static void test_BCryptDecrypt(void) ret = pBCryptGetProperty(aes, BCRYPT_OBJECT_LENGTH, (UCHAR *)&len, sizeof(len), &size, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + key = NULL; buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); ret = pBCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(key != NULL, "key not set\n"); /* input size is a multiple of block size */ size = 0; @@ -1012,9 +1025,11 @@ static void test_BCryptDecrypt(void) ret = BCryptSetProperty(aes, BCRYPT_CHAINING_MODE, (UCHAR*)BCRYPT_CHAIN_MODE_GCM, sizeof(BCRYPT_CHAIN_MODE_GCM), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + key = NULL; buf = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len); ret = pBCryptGenerateSymmetricKey(aes, &key, buf, len, secret, sizeof(secret), 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(key != NULL, "key not set\n"); memset(&auth_info, 0, sizeof(auth_info)); auth_info.cbSize = sizeof(auth_info);
1
0
0
0
Sebastian Lackner : bcrypt/tests: Add tests for auth data in AES GCM mode.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: e7923d3e0d93942648f5b563e3e533180ac7dc46 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e7923d3e0d93942648f5b563…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Thu Mar 22 11:33:38 2018 +0100 bcrypt/tests: Add tests for auth data in AES GCM mode. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/tests/bcrypt.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index f67a975..d33c096 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -610,7 +610,9 @@ static void test_BCryptGenerateSymmetricKey(void) static void test_BCryptEncrypt(void) { static UCHAR nonce[] = - {0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60}; + {0x10,0x20,0x30,0x40,0x50,0x60,0x10,0x20,0x30,0x40,0x50,0x60}; + static UCHAR auth_data[] = + {0x60,0x50,0x40,0x30,0x20,0x10,0x60,0x50,0x40,0x30,0x20,0x10}; static UCHAR secret[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}; static UCHAR iv[] = @@ -636,6 +638,8 @@ static void test_BCryptEncrypt(void) {0x89,0xb3,0x92,0x00,0x39,0x20,0x09,0xb4,0x6a,0xd6,0xaf,0xca,0x4b,0x5b,0xfd,0xd0}; static UCHAR expected_tag2[] = {0x9a,0x92,0x32,0x2c,0x61,0x2a,0xae,0xef,0x66,0x2a,0xfb,0x55,0xe9,0x48,0xdf,0xbd}; + static UCHAR expected_tag3[] = + {0x17,0x9d,0xc0,0x7a,0xf0,0xcf,0xaa,0xd5,0x1c,0x11,0xc4,0x4b,0xd6,0xa3,0x3e,0x77}; BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO auth_info; UCHAR *buf, ciphertext[48], ivbuf[16], tag[16]; BCRYPT_AUTH_TAG_LENGTHS_STRUCT tag_length; @@ -809,6 +813,24 @@ static void test_BCryptEncrypt(void) for (i = 0; i < 16; i++) ok(tag[i] == expected_tag2[i], "%u: %02x != %02x\n", i, tag[i], expected_tag2[i]); + /* test with auth data */ + auth_info.pbAuthData = auth_data; + auth_info.cbAuthData = sizeof(auth_data); + + size = 0; + memcpy(ivbuf, iv, sizeof(iv)); + memset(ciphertext, 0xff, sizeof(ciphertext)); + memset(tag, 0xff, sizeof(tag)); + ret = pBCryptEncrypt(key, data2, 32, &auth_info, ivbuf, 16, ciphertext, 32, &size, 0); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(size == 32, "got %u\n", size); + ok(!memcmp(ciphertext, expected4, sizeof(expected4)), "wrong data\n"); + ok(!memcmp(tag, expected_tag3, sizeof(expected_tag3)), "wrong tag\n"); + for (i = 0; i < 32; i++) + ok(ciphertext[i] == expected4[i], "%u: %02x != %02x\n", i, ciphertext[i], expected4[i]); + for (i = 0; i < 16; i++) + ok(tag[i] == expected_tag3[i], "%u: %02x != %02x\n", i, tag[i], expected_tag3[i]); + /* test with padding */ memcpy(ivbuf, iv, sizeof(iv)); memset(ciphertext, 0, sizeof(ciphertext)); @@ -831,7 +853,9 @@ static void test_BCryptEncrypt(void) static void test_BCryptDecrypt(void) { static UCHAR nonce[] = - {0x10, 0x20, 0x30, 0x40, 0x50, 0x60, 0x10, 0x20, 0x30, 0x40, 0x50, 0x60}; + {0x10,0x20,0x30,0x40,0x50,0x60,0x10,0x20,0x30,0x40,0x50,0x60}; + static UCHAR auth_data[] = + {0x60,0x50,0x40,0x30,0x20,0x10,0x60,0x50,0x40,0x30,0x20,0x10}; static UCHAR secret[] = {0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f}; static UCHAR iv[] = @@ -858,6 +882,8 @@ static void test_BCryptDecrypt(void) 0x86,0x64,0xc3,0xfe,0xa3,0x07,0x61,0xf8,0x16,0xc9,0x78,0x7f,0xe7,0xb1,0xc4,0x94}; static UCHAR tag[] = {0x89,0xb3,0x92,0x00,0x39,0x20,0x09,0xb4,0x6a,0xd6,0xaf,0xca,0x4b,0x5b,0xfd,0xd0}; + static UCHAR tag2[] = + {0x17,0x9d,0xc0,0x7a,0xf0,0xcf,0xaa,0xd5,0x1c,0x11,0xc4,0x4b,0xd6,0xa3,0x3e,0x77}; BCRYPT_AUTHENTICATED_CIPHER_MODE_INFO auth_info; BCRYPT_KEY_LENGTHS_STRUCT key_lengths; BCRYPT_ALG_HANDLE aes; @@ -1007,6 +1033,20 @@ static void test_BCryptDecrypt(void) ok(size == 32, "got %u\n", size); ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n"); + /* test with auth data */ + auth_info.pbAuthData = auth_data; + auth_info.cbAuthData = sizeof(auth_data); + auth_info.pbTag = tag2; + auth_info.cbTag = sizeof(tag2); + + size = 0; + memcpy(ivbuf, iv, sizeof(iv)); + memset(plaintext, 0, sizeof(plaintext)); + ret = pBCryptDecrypt(key, ciphertext4, 32, &auth_info, ivbuf, 16, plaintext, 32, &size, 0); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(size == 32, "got %u\n", size); + ok(!memcmp(plaintext, expected3, sizeof(expected3)), "wrong data\n"); + /* test with wrong tag */ memcpy(ivbuf, iv, sizeof(iv)); auth_info.pbTag = iv; /* wrong tag */
1
0
0
0
Michael Müller : bcrypt: Add support for auth data in AES GCM mode.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: 1b5e877155d9b8598f903a80bfb2133cf1b69f6f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1b5e877155d9b8598f903a80…
Author: Michael Müller <michael(a)fds-team.de> Date: Thu Mar 22 11:33:37 2018 +0100 bcrypt: Add support for auth data in AES GCM mode. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/bcrypt_main.c | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index 47b6caf..b21dc1f 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -52,6 +52,7 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag); /* Not present in gnutls version < 3.0 */ static int (*pgnutls_cipher_tag)(gnutls_cipher_hd_t handle, void * tag, size_t tag_size); +static int (*pgnutls_cipher_add_auth)(gnutls_cipher_hd_t handle, const void *ptext, size_t ptext_size); static void *libgnutls_handle; #define MAKE_FUNCPTR(f) static typeof(f) * p##f @@ -72,7 +73,12 @@ MAKE_FUNCPTR(gnutls_perror); #define GNUTLS_CIPHER_AES_256_GCM 94 #endif -static int compat_gnutls_cipher_tag(gnutls_cipher_hd_t handle, void * tag, size_t tag_size) +static int compat_gnutls_cipher_tag(gnutls_cipher_hd_t handle, void *tag, size_t tag_size) +{ + return GNUTLS_E_UNKNOWN_CIPHER_TYPE; +} + +static int compat_gnutls_cipher_add_auth(gnutls_cipher_hd_t handle, const void *ptext, size_t ptext_size) { return GNUTLS_E_UNKNOWN_CIPHER_TYPE; } @@ -115,6 +121,11 @@ static BOOL gnutls_initialize(void) WARN("gnutls_cipher_tag not found\n"); pgnutls_cipher_tag = compat_gnutls_cipher_tag; } + if (!(pgnutls_cipher_add_auth = wine_dlsym( libgnutls_handle, "gnutls_cipher_add_auth", NULL, 0 ))) + { + WARN("gnutls_cipher_add_auth not found\n"); + pgnutls_cipher_add_auth = compat_gnutls_cipher_add_auth; + } if ((ret = pgnutls_global_init()) != GNUTLS_E_SUCCESS) { @@ -1022,6 +1033,19 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len ) return STATUS_SUCCESS; } +static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len ) +{ + int ret; + + if ((ret = pgnutls_cipher_add_auth( key->handle, auth_data, len ))) + { + pgnutls_perror( ret ); + return STATUS_INTERNAL_ERROR; + } + + return STATUS_SUCCESS; +} + static NTSTATUS key_encrypt( struct key *key, const UCHAR *input, ULONG input_len, UCHAR *output, ULONG output_len ) { @@ -1146,6 +1170,12 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len ) return STATUS_SUCCESS; } +static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len ) +{ + FIXME( "not implemented on Mac\n" ); + return STATUS_NOT_IMPLEMENTED; +} + static NTSTATUS key_encrypt( struct key *key, const UCHAR *input, ULONG input_len, UCHAR *output, ULONG output_len ) { @@ -1213,6 +1243,12 @@ static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len ) return STATUS_NOT_IMPLEMENTED; } +static NTSTATUS key_set_auth_data( struct key *key, UCHAR *auth_data, ULONG len ) +{ + ERR( "support for keys not available at build time\n" ); + return STATUS_NOT_IMPLEMENTED; +} + static NTSTATUS key_encrypt( struct key *key, const UCHAR *input, ULONG input_len, UCHAR *output, ULONG output_len ) { @@ -1407,6 +1443,8 @@ NTSTATUS WINAPI BCryptEncrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp if (!output) return STATUS_SUCCESS; if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL; + if (auth_info->pbAuthData && (status = key_set_auth_data( key, auth_info->pbAuthData, auth_info->cbAuthData ))) + return status; if ((status = key_encrypt( key, input, input_len, output, output_len ))) return status; @@ -1484,6 +1522,8 @@ NTSTATUS WINAPI BCryptDecrypt( BCRYPT_KEY_HANDLE handle, UCHAR *input, ULONG inp if (!output) return STATUS_SUCCESS; if (output_len < *ret_len) return STATUS_BUFFER_TOO_SMALL; + if (auth_info->pbAuthData && (status = key_set_auth_data( key, auth_info->pbAuthData, auth_info->cbAuthData ))) + return status; if ((status = key_decrypt( key, input, input_len, output, output_len ))) return status;
1
0
0
0
Sebastian Lackner : bcrypt/tests: Add tests for BCryptDuplicateKey.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: 4f4adf6972e6937e1ce1013c284dbe8ba1c3fb12 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4f4adf6972e6937e1ce1013c…
Author: Sebastian Lackner <sebastian(a)fds-team.de> Date: Thu Mar 22 11:33:36 2018 +0100 bcrypt/tests: Add tests for BCryptDuplicateKey. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/tests/bcrypt.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/dlls/bcrypt/tests/bcrypt.c b/dlls/bcrypt/tests/bcrypt.c index 9922e41..f67a975 100644 --- a/dlls/bcrypt/tests/bcrypt.c +++ b/dlls/bcrypt/tests/bcrypt.c @@ -45,6 +45,7 @@ static NTSTATUS (WINAPI *pBCryptEncrypt)(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID ULONG *, ULONG); static NTSTATUS (WINAPI *pBCryptDecrypt)(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG); +static NTSTATUS (WINAPI *pBCryptDuplicateKey)(BCRYPT_KEY_HANDLE, BCRYPT_KEY_HANDLE *, UCHAR *, ULONG, ULONG); static NTSTATUS (WINAPI *pBCryptDestroyKey)(BCRYPT_KEY_HANDLE); static NTSTATUS (WINAPI *pBCryptImportKey)(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, BCRYPT_KEY_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG); @@ -503,7 +504,7 @@ static void test_BCryptGenerateSymmetricKey(void) static UCHAR expected[] = {0xc6,0xa1,0x3b,0x37,0x87,0x8f,0x5b,0x82,0x6f,0x4f,0x81,0x62,0xa1,0xc8,0xd8,0x79}; BCRYPT_ALG_HANDLE aes; - BCRYPT_KEY_HANDLE key; + BCRYPT_KEY_HANDLE key, key2; UCHAR *buf, ciphertext[16], plaintext[16], ivbuf[16]; ULONG size, len, i; NTSTATUS ret; @@ -550,6 +551,35 @@ static void test_BCryptGenerateSymmetricKey(void) for (i = 0; i < 16; i++) ok(ciphertext[i] == expected[i], "%u: %02x != %02x\n", i, ciphertext[i], expected[i]); + ret = pBCryptDuplicateKey(NULL, &key2, NULL, 0, 0); + ok(ret == STATUS_INVALID_HANDLE, "got %08x\n", ret); + + if (0) /* crashes on some Windows versions */ + { + ret = pBCryptDuplicateKey(key, NULL, NULL, 0, 0); + ok(ret == STATUS_INVALID_PARAMETER, "got %08x\n", ret); + } + + key2 = (void *)0xdeadbeef; + ret = pBCryptDuplicateKey(key, &key2, NULL, 0, 0); + ok(ret == STATUS_SUCCESS || broken(ret == STATUS_INVALID_PARAMETER), "got %08x\n", ret); + + if (ret == STATUS_SUCCESS) + { + size = 0; + memcpy(ivbuf, iv, sizeof(iv)); + memset(ciphertext, 0, sizeof(ciphertext)); + ret = pBCryptEncrypt(key2, data, 16, NULL, ivbuf, 16, ciphertext, 16, &size, 0); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + ok(size == 16, "got %u\n", size); + ok(!memcmp(ciphertext, expected, sizeof(expected)), "wrong data\n"); + for (i = 0; i < 16; i++) + ok(ciphertext[i] == expected[i], "%u: %02x != %02x\n", i, ciphertext[i], expected[i]); + + ret = pBCryptDestroyKey(key2); + ok(ret == STATUS_SUCCESS, "got %08x\n", ret); + } + size = 0xdeadbeef; ret = pBCryptDecrypt(key, NULL, 0, NULL, NULL, 0, NULL, 0, &size, 0); ok(ret == STATUS_SUCCESS, "got %08x\n", ret); @@ -1063,6 +1093,7 @@ START_TEST(bcrypt) pBCryptGenerateSymmetricKey = (void *)GetProcAddress(module, "BCryptGenerateSymmetricKey"); pBCryptEncrypt = (void *)GetProcAddress(module, "BCryptEncrypt"); pBCryptDecrypt = (void *)GetProcAddress(module, "BCryptDecrypt"); + pBCryptDuplicateKey = (void *)GetProcAddress(module, "BCryptDuplicateKey"); pBCryptDestroyKey = (void *)GetProcAddress(module, "BCryptDestroyKey"); pBCryptImportKey = (void *)GetProcAddress(module, "BCryptImportKey"); pBCryptExportKey = (void *)GetProcAddress(module, "BCryptExportKey");
1
0
0
0
Michael Müller : bcrypt: Implement BCryptDuplicateKey.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: cb0a960ff65688bd065860ef49edd5800619f8ee URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cb0a960ff65688bd065860ef…
Author: Michael Müller <michael(a)fds-team.de> Date: Thu Mar 22 11:33:35 2018 +0100 bcrypt: Implement BCryptDuplicateKey. Signed-off-by: Hans Leidekker <hans(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/bcrypt/bcrypt.spec | 2 +- dlls/bcrypt/bcrypt_main.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++ dlls/ncrypt/ncrypt.spec | 2 +- 3 files changed, 51 insertions(+), 2 deletions(-) diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec index 21b54b4..28c2394 100644 --- a/dlls/bcrypt/bcrypt.spec +++ b/dlls/bcrypt/bcrypt.spec @@ -12,7 +12,7 @@ @ stdcall BCryptDestroyKey(ptr) @ stub BCryptDestroySecret @ stdcall BCryptDuplicateHash(ptr ptr ptr long long) -@ stub BCryptDuplicateKey +@ stdcall BCryptDuplicateKey(ptr ptr ptr long long) @ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long) @ stdcall BCryptEnumAlgorithms(long ptr ptr long) @ stub BCryptEnumContextFunctionProviders diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c index cd44bdf..47b6caf 100644 --- a/dlls/bcrypt/bcrypt_main.c +++ b/dlls/bcrypt/bcrypt_main.c @@ -876,6 +876,7 @@ static ULONG get_block_size( struct algorithm *alg ) get_alg_property( alg, BCRYPT_BLOCK_LENGTH, (UCHAR *)&ret, sizeof(ret), &size ); return ret; } + static NTSTATUS key_export( struct key *key, const WCHAR *type, UCHAR *output, ULONG output_len, ULONG *size ) { if (!strcmpW( type, BCRYPT_KEY_DATA_BLOB )) @@ -896,6 +897,24 @@ static NTSTATUS key_export( struct key *key, const WCHAR *type, UCHAR *output, U FIXME( "unsupported key type %s\n", debugstr_w(type) ); return STATUS_NOT_IMPLEMENTED; } + +static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy ) +{ + UCHAR *buffer; + + if (!(buffer = heap_alloc( key_orig->secret_len ))) return STATUS_NO_MEMORY; + memcpy( buffer, key_orig->secret, key_orig->secret_len ); + + memset( key_copy, 0, sizeof(*key_copy) ); + key_copy->hdr = key_orig->hdr; + key_copy->alg_id = key_orig->alg_id; + key_copy->mode = key_orig->mode; + key_copy->block_size = key_orig->block_size; + key_copy->secret = buffer; + key_copy->secret_len = key_orig->secret_len; + + return STATUS_SUCCESS; +} #endif #if defined(HAVE_GNUTLS_CIPHER_INIT) && !defined(HAVE_COMMONCRYPTO_COMMONCRYPTOR_H) @@ -1182,6 +1201,12 @@ static NTSTATUS set_key_property( struct key *key, const WCHAR *prop, UCHAR *val return STATUS_NOT_IMPLEMENTED; } +static NTSTATUS key_duplicate( struct key *key_orig, struct key *key_copy ) +{ + ERR( "support for keys not available at build time\n" ); + return STATUS_NOT_IMPLEMENTED; +} + static NTSTATUS key_set_params( struct key *key, UCHAR *iv, ULONG iv_len ) { ERR( "support for keys not available at build time\n" ); @@ -1310,6 +1335,30 @@ NTSTATUS WINAPI BCryptExportKey(BCRYPT_KEY_HANDLE export_key, BCRYPT_KEY_HANDLE return key_export( key, type, output, output_len, size ); } +NTSTATUS WINAPI BCryptDuplicateKey( BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE *handle_copy, + UCHAR *object, ULONG object_len, ULONG flags ) +{ + struct key *key_orig = handle; + struct key *key_copy; + NTSTATUS status; + + TRACE( "%p, %p, %p, %u, %08x\n", handle, handle_copy, object, object_len, flags ); + if (object) FIXME( "ignoring object buffer\n" ); + + if (!key_orig || key_orig->hdr.magic != MAGIC_KEY) return STATUS_INVALID_HANDLE; + if (!handle_copy) return STATUS_INVALID_PARAMETER; + if (!(key_copy = heap_alloc( sizeof(*key_copy) ))) return STATUS_NO_MEMORY; + + if ((status = key_duplicate( key_orig, key_copy ))) + { + heap_free( key_copy ); + return status; + } + + *handle_copy = key_copy; + return STATUS_SUCCESS; +} + NTSTATUS WINAPI BCryptDestroyKey( BCRYPT_KEY_HANDLE handle ) { struct key *key = handle; diff --git a/dlls/ncrypt/ncrypt.spec b/dlls/ncrypt/ncrypt.spec index 5d5fae0..d0f0f56 100644 --- a/dlls/ncrypt/ncrypt.spec +++ b/dlls/ncrypt/ncrypt.spec @@ -14,7 +14,7 @@ @ stdcall BCryptDestroyKey(ptr) bcrypt.BCryptDestroyKey @ stub BCryptDestroySecret @ stdcall BCryptDuplicateHash(ptr ptr ptr long long) bcrypt.BCryptDuplicateHash -@ stub BCryptDuplicateKey +@ stdcall BCryptDuplicateKey(ptr ptr ptr long long) bcrypt.BCryptDuplicateKey @ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long) bcrypt.BCryptEncrypt @ stdcall BCryptEnumAlgorithms(long ptr ptr long) bcrypt.BCryptEnumAlgorithms @ stub BCryptEnumContextFunctionProviders
1
0
0
0
Józef Kucia : winevulkan: Remove excess quotation marks.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: bf9ed46930d9853c398ea79be80577cf29d2da57 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=bf9ed46930d9853c398ea79b…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Mar 22 08:03:37 2018 +0100 winevulkan: Remove excess quotation marks. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winevulkan/vulkan.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index 9440000..a5b8a96 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -897,7 +897,7 @@ PFN_vkVoidFunction WINAPI wine_vkGetDeviceProcAddr(VkDevice device, const char * func = wine_vk_get_instance_proc_addr(name); if (func) { - WARN("Returning instance function '%s'.\n", debugstr_a(name)); + WARN("Returning instance function %s.\n", debugstr_a(name)); return func; } @@ -932,7 +932,7 @@ static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, } if (!instance) { - FIXME("Global function '%s' not found\n", debugstr_a(name)); + FIXME("Global function %s not found.\n", debugstr_a(name)); return NULL; } @@ -943,7 +943,7 @@ static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, func = wine_vk_get_device_proc_addr(name); if (func) return func; - FIXME("Unsupported device or instance function: '%s'\n", debugstr_a(name)); + FIXME("Unsupported device or instance function: %s.\n", debugstr_a(name)); return NULL; }
1
0
0
0
Nikolay Sivov : winex11: Fix build without Vulkan support.
by Alexandre Julliard
22 Mar '18
22 Mar '18
Module: wine Branch: master Commit: 9e539f48227016d8cc8c79fbd7747f6eb6f1e1a0 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=9e539f48227016d8cc8c79fb…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Thu Mar 22 09:20:53 2018 +0300 winex11: Fix build without Vulkan support. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/winex11.drv/vulkan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 27ff722..f96ef64 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -37,10 +37,10 @@ #include "wine/vulkan.h" #include "wine/vulkan_driver.h" -#ifdef SONAME_LIBVULKAN - WINE_DEFAULT_DEBUG_CHANNEL(vulkan); +#ifdef SONAME_LIBVULKAN + typedef VkFlags VkXlibSurfaceCreateFlagsKHR; #define VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR 1000004000
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
79
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Results per page:
10
25
50
100
200