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
c156c1e4
Commit
c156c1e4
authored
Sep 29, 2006
by
Karsten Elfenbein
Committed by
Alexandre Julliard
Oct 02, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rsaenh/tests: import & export of a plaintext public key + algID check.
parent
ba123abf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
rsaenh.c
dlls/rsaenh/tests/rsaenh.c
+37
-0
No files found.
dlls/rsaenh/tests/rsaenh.c
View file @
c156c1e4
...
...
@@ -1142,6 +1142,42 @@ static void test_rsa_encrypt(void)
CryptDestroyKey
(
hRSAKey
);
}
static
void
test_import_export
(
void
)
{
DWORD
dwLen
,
dwDataLen
;
HCRYPTKEY
hPublicKey
;
BOOL
result
;
ALG_ID
algID
;
BYTE
emptyKey
[
2048
];
static
BYTE
abPlainPublicKey
[
84
]
=
{
0x06
,
0x02
,
0x00
,
0x00
,
0x00
,
0xa4
,
0x00
,
0x00
,
0x52
,
0x53
,
0x41
,
0x31
,
0x00
,
0x02
,
0x00
,
0x00
,
0x01
,
0x00
,
0x01
,
0x00
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
,
0x11
};
dwLen
=
84
;
result
=
CryptImportKey
(
hProv
,
abPlainPublicKey
,
dwLen
,
0
,
0
,
&
hPublicKey
);
ok
(
result
,
"failed to import the public key
\n
"
);
dwDataLen
=
sizeof
(
algID
);
result
=
CryptGetKeyParam
(
hPublicKey
,
KP_ALGID
,
(
LPBYTE
)
&
algID
,
&
dwDataLen
,
0
);
ok
(
result
,
"failed to get the KP_ALGID from the imported public key
\n
"
);
ok
(
algID
==
CALG_RSA_KEYX
,
"Expected CALG_RSA_KEYX, got %x
\n
"
,
algID
);
result
=
CryptExportKey
(
hPublicKey
,
0
,
PUBLICKEYBLOB
,
0
,
emptyKey
,
&
dwLen
);
ok
(
result
,
"failed to export the fresh imported public key
\n
"
);
ok
(
dwLen
==
84
,
"Expected exported key to be 84 bytes long but got %ld bytes."
,
dwLen
);
ok
(
!
memcmp
(
emptyKey
,
abPlainPublicKey
,
dwLen
),
"exported key is different from the imported key
\n
"
);
}
static
void
test_schannel_provider
(
void
)
{
...
...
@@ -1586,6 +1622,7 @@ START_TEST(rsaenh)
test_import_private
();
test_verify_signature
();
test_rsa_encrypt
();
test_import_export
();
test_enum_container
();
clean_up_environment
();
test_schannel_provider
();
...
...
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