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
11279bad
Commit
11279bad
authored
Jan 20, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Jan 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bcrypt: Support retrieving hash length from algorithm handles.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e3e2805b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
bcrypt_main.c
dlls/bcrypt/bcrypt_main.c
+20
-0
bcrypt.c
dlls/bcrypt/tests/bcrypt.c
+24
-0
No files found.
dlls/bcrypt/bcrypt_main.c
View file @
11279bad
...
@@ -438,6 +438,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
...
@@ -438,6 +438,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
value
=
OBJECT_LENGTH_SHA1
;
value
=
OBJECT_LENGTH_SHA1
;
break
;
break
;
}
}
else
if
(
!
strcmpW
(
prop
,
BCRYPT_HASH_LENGTH
))
{
value
=
HASH_DIGEST_LENGTH_SHA1
;
break
;
}
FIXME
(
"unsupported sha1 algorithm property %s
\n
"
,
debugstr_w
(
prop
)
);
FIXME
(
"unsupported sha1 algorithm property %s
\n
"
,
debugstr_w
(
prop
)
);
return
STATUS_NOT_IMPLEMENTED
;
return
STATUS_NOT_IMPLEMENTED
;
...
@@ -447,6 +452,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
...
@@ -447,6 +452,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
value
=
OBJECT_LENGTH_SHA256
;
value
=
OBJECT_LENGTH_SHA256
;
break
;
break
;
}
}
else
if
(
!
strcmpW
(
prop
,
BCRYPT_HASH_LENGTH
))
{
value
=
HASH_DIGEST_LENGTH_SHA256
;
break
;
}
FIXME
(
"unsupported sha256 algorithm property %s
\n
"
,
debugstr_w
(
prop
)
);
FIXME
(
"unsupported sha256 algorithm property %s
\n
"
,
debugstr_w
(
prop
)
);
return
STATUS_NOT_IMPLEMENTED
;
return
STATUS_NOT_IMPLEMENTED
;
...
@@ -456,6 +466,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
...
@@ -456,6 +466,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
value
=
OBJECT_LENGTH_SHA384
;
value
=
OBJECT_LENGTH_SHA384
;
break
;
break
;
}
}
else
if
(
!
strcmpW
(
prop
,
BCRYPT_HASH_LENGTH
))
{
value
=
HASH_DIGEST_LENGTH_SHA384
;
break
;
}
FIXME
(
"unsupported sha384 algorithm property %s
\n
"
,
debugstr_w
(
prop
)
);
FIXME
(
"unsupported sha384 algorithm property %s
\n
"
,
debugstr_w
(
prop
)
);
return
STATUS_NOT_IMPLEMENTED
;
return
STATUS_NOT_IMPLEMENTED
;
...
@@ -465,6 +480,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
...
@@ -465,6 +480,11 @@ static NTSTATUS get_alg_property( enum alg_id id, const WCHAR *prop, UCHAR *buf,
value
=
OBJECT_LENGTH_SHA512
;
value
=
OBJECT_LENGTH_SHA512
;
break
;
break
;
}
}
else
if
(
!
strcmpW
(
prop
,
BCRYPT_HASH_LENGTH
))
{
value
=
HASH_DIGEST_LENGTH_SHA512
;
break
;
}
FIXME
(
"unsupported sha512 algorithm property %s
\n
"
,
debugstr_w
(
prop
)
);
FIXME
(
"unsupported sha512 algorithm property %s
\n
"
,
debugstr_w
(
prop
)
);
return
STATUS_NOT_IMPLEMENTED
;
return
STATUS_NOT_IMPLEMENTED
;
...
...
dlls/bcrypt/tests/bcrypt.c
View file @
11279bad
...
@@ -123,6 +123,12 @@ static void test_sha1(void)
...
@@ -123,6 +123,12 @@ static void test_sha1(void)
ok
(
len
!=
0xdeadbeef
,
"len not set
\n
"
);
ok
(
len
!=
0xdeadbeef
,
"len not set
\n
"
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
len
=
size
=
0xdeadbeef
;
ret
=
BCryptGetProperty
(
alg
,
BCRYPT_HASH_LENGTH
,
(
UCHAR
*
)
&
len
,
sizeof
(
len
),
&
size
,
0
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %08x
\n
"
,
ret
);
ok
(
len
==
20
,
"got %u
\n
"
,
len
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
hash
=
NULL
;
hash
=
NULL
;
len
=
sizeof
(
buf
);
len
=
sizeof
(
buf
);
ret
=
BCryptCreateHash
(
alg
,
&
hash
,
buf
,
len
,
NULL
,
0
,
0
);
ret
=
BCryptCreateHash
(
alg
,
&
hash
,
buf
,
len
,
NULL
,
0
,
0
);
...
@@ -196,6 +202,12 @@ static void test_sha256(void)
...
@@ -196,6 +202,12 @@ static void test_sha256(void)
ok
(
len
!=
0xdeadbeef
,
"len not set
\n
"
);
ok
(
len
!=
0xdeadbeef
,
"len not set
\n
"
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
len
=
size
=
0xdeadbeef
;
ret
=
BCryptGetProperty
(
alg
,
BCRYPT_HASH_LENGTH
,
(
UCHAR
*
)
&
len
,
sizeof
(
len
),
&
size
,
0
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %08x
\n
"
,
ret
);
ok
(
len
==
32
,
"got %u
\n
"
,
len
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
hash
=
NULL
;
hash
=
NULL
;
len
=
sizeof
(
buf
);
len
=
sizeof
(
buf
);
ret
=
BCryptCreateHash
(
alg
,
&
hash
,
buf
,
len
,
NULL
,
0
,
0
);
ret
=
BCryptCreateHash
(
alg
,
&
hash
,
buf
,
len
,
NULL
,
0
,
0
);
...
@@ -269,6 +281,12 @@ static void test_sha384(void)
...
@@ -269,6 +281,12 @@ static void test_sha384(void)
ok
(
len
!=
0xdeadbeef
,
"len not set
\n
"
);
ok
(
len
!=
0xdeadbeef
,
"len not set
\n
"
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
len
=
size
=
0xdeadbeef
;
ret
=
BCryptGetProperty
(
alg
,
BCRYPT_HASH_LENGTH
,
(
UCHAR
*
)
&
len
,
sizeof
(
len
),
&
size
,
0
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %08x
\n
"
,
ret
);
ok
(
len
==
48
,
"got %u
\n
"
,
len
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
hash
=
NULL
;
hash
=
NULL
;
len
=
sizeof
(
buf
);
len
=
sizeof
(
buf
);
ret
=
BCryptCreateHash
(
alg
,
&
hash
,
buf
,
len
,
NULL
,
0
,
0
);
ret
=
BCryptCreateHash
(
alg
,
&
hash
,
buf
,
len
,
NULL
,
0
,
0
);
...
@@ -343,6 +361,12 @@ static void test_sha512(void)
...
@@ -343,6 +361,12 @@ static void test_sha512(void)
ok
(
len
!=
0xdeadbeef
,
"len not set
\n
"
);
ok
(
len
!=
0xdeadbeef
,
"len not set
\n
"
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
len
=
size
=
0xdeadbeef
;
ret
=
BCryptGetProperty
(
alg
,
BCRYPT_HASH_LENGTH
,
(
UCHAR
*
)
&
len
,
sizeof
(
len
),
&
size
,
0
);
ok
(
ret
==
STATUS_SUCCESS
,
"got %08x
\n
"
,
ret
);
ok
(
len
==
64
,
"got %u
\n
"
,
len
);
ok
(
size
==
sizeof
(
len
),
"got %u
\n
"
,
size
);
hash
=
NULL
;
hash
=
NULL
;
len
=
sizeof
(
buf
);
len
=
sizeof
(
buf
);
ret
=
BCryptCreateHash
(
alg
,
&
hash
,
buf
,
len
,
NULL
,
0
,
0
);
ret
=
BCryptCreateHash
(
alg
,
&
hash
,
buf
,
len
,
NULL
,
0
,
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