Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
39dc9d09
Commit
39dc9d09
authored
Feb 10, 2023
by
Paul Gofman
Committed by
Alexandre Julliard
Feb 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Only reset init vector if the new vector is non-NULL.
parent
7d31f394
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
bcrypt_main.c
dlls/bcrypt/bcrypt_main.c
+4
-4
bcrypt.c
dlls/bcrypt/tests/bcrypt.c
+4
-4
No files found.
dlls/bcrypt/bcrypt_main.c
View file @
39dc9d09
...
...
@@ -1149,12 +1149,12 @@ static BOOL is_equal_vector( const UCHAR *vector, ULONG len, const UCHAR *vector
static
NTSTATUS
key_symmetric_set_vector
(
struct
key
*
key
,
UCHAR
*
vector
,
ULONG
vector_len
,
BOOL
force_reset
)
{
BOOL
needs_reset
=
force_reset
||
!
is_equal_vector
(
key
->
u
.
s
.
vector
,
key
->
u
.
s
.
vector_len
,
vector
,
vector_len
);
free
(
key
->
u
.
s
.
vector
);
key
->
u
.
s
.
vector
=
NULL
;
key
->
u
.
s
.
vector_len
=
0
;
if
(
vector
)
{
free
(
key
->
u
.
s
.
vector
);
key
->
u
.
s
.
vector
=
NULL
;
key
->
u
.
s
.
vector_len
=
0
;
if
(
!
(
key
->
u
.
s
.
vector
=
malloc
(
vector_len
)))
return
STATUS_NO_MEMORY
;
memcpy
(
key
->
u
.
s
.
vector
,
vector
,
vector_len
);
key
->
u
.
s
.
vector_len
=
vector_len
;
...
...
dlls/bcrypt/tests/bcrypt.c
View file @
39dc9d09
...
...
@@ -843,7 +843,7 @@ static void test_BCryptGenerateSymmetricKey(void)
ret
=
BCryptEncrypt
(
key
,
data
,
16
,
NULL
,
NULL
,
0
,
ciphertext
,
16
,
&
size
,
0
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %#lx
\n
"
,
ret
);
ok
(
size
==
16
,
"got %lu
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
ciphertext
,
expected2
,
sizeof
(
expected2
)),
"wrong data
\n
"
);
ok
(
!
memcmp
(
ciphertext
,
expected2
,
sizeof
(
expected2
)),
"wrong data
\n
"
);
size
=
0
;
memcpy
(
ivbuf
,
iv
,
sizeof
(
iv
));
...
...
@@ -1129,7 +1129,7 @@ static void test_BCryptEncrypt(void)
ret
=
BCryptEncrypt
(
key
,
data
,
16
,
NULL
,
NULL
,
0
,
ciphertext
,
16
,
&
size
,
0
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %#lx
\n
"
,
ret
);
ok
(
size
==
16
,
"got %lu
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
ciphertext
,
expected8
,
sizeof
(
expected8
)),
"wrong data
\n
"
);
ok
(
!
memcmp
(
ciphertext
,
expected8
,
sizeof
(
expected8
)),
"wrong data
\n
"
);
/* all zero initialization vector */
size
=
0
;
...
...
@@ -1556,7 +1556,7 @@ static void test_BCryptEncrypt(void)
ret
=
BCryptEncrypt
(
key
,
data
,
16
,
NULL
,
NULL
,
0
,
ciphertext
,
16
,
&
size
,
0
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %#lx
\n
"
,
ret
);
ok
(
size
==
16
,
"got %lu
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
ciphertext
,
expected12
,
sizeof
(
expected12
)),
"wrong data
\n
"
);
ok
(
!
memcmp
(
ciphertext
,
expected12
,
sizeof
(
expected12
)),
"wrong data
\n
"
);
/* all zero initialization vector */
size
=
0
;
...
...
@@ -1784,7 +1784,7 @@ static void test_BCryptDecrypt(void)
ret
=
BCryptDecrypt
(
key
,
ciphertext
,
32
,
NULL
,
NULL
,
0
,
plaintext
,
32
,
&
size
,
0
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %#lx
\n
"
,
ret
);
ok
(
size
==
32
,
"got %lu
\n
"
,
size
);
todo_wine
ok
(
!
memcmp
(
plaintext
,
expected4
,
sizeof
(
expected4
)),
"wrong data
\n
"
);
ok
(
!
memcmp
(
plaintext
,
expected4
,
sizeof
(
expected4
)),
"wrong data
\n
"
);
/* test with padding smaller than block size */
size
=
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment