Commit Graph

127 Commits

Author SHA1 Message Date
Derek Lesho 741f8ae24e bcrypt: Add more BCryptSignHash tests.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 22:30:23 +01:00
Hans Leidekker 1703ac54fa bcrypt: Handle SHA1 hash in key_asymmetric_verify.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 22:30:23 +01:00
Derek Lesho 741f76fc2c bcrypt: Add support for signing hashes with ECDSA keys.
Signed-off-by: Derek Lesho <dlesho@codeweavers.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-12-06 22:30:23 +01:00
Hans Leidekker f4d6df8947 bcrypt: Avoid recreating cipher handles when the initialization vector doesn't change.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-11-06 16:03:50 +01:00
Hans Leidekker 02723a8856 bcrypt: Avoid recreating the hash on every iteration in BCryptDeriveKeyPBKDF2.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-10-01 19:17:36 +02:00
Hans Leidekker 04631f9c6e bcrypt: Implement BCryptEnumAlgorithms.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-30 22:24:27 +02:00
Alistair Leslie-Hughes e95215d08c bcrypt: Fix key_asymmetric_init function for macos.
Regression introduced in 98b230f851

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-24 17:28:45 +02:00
Hans Leidekker 98b230f851 bcrypt: Implement BCryptSignHash.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-23 19:44:18 +02:00
Hans Leidekker b2bbb6f48f bcrypt: Add support for generating RSA keys.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-09-23 19:44:18 +02:00
Hans Leidekker 691fcebf3d bcrypt: Ignore the size parameter in BCRYPT_CHAINING_MODE setters.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47432
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-07-05 17:38:04 +02:00
Hans Leidekker 4c649116a5 bcrypt: Add support for BCRYPT_RSA_SIGN_ALGORITHM.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47371
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-17 20:47:34 +02:00
Hans Leidekker c1746612b2 bcrypt: Add stub implementations of BCryptEnumContextFunctions and BCryptFreeBuffer.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-06-17 20:47:32 +02:00
Alistair Leslie-Hughes eb615ea0cb bcrypt: Add BCryptDeriveKey stub.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-28 12:06:46 +02:00
Alistair Leslie-Hughes 08bc5b0d34 bcrypt: Add BCryptDestroySecret/BCryptSecretAgreement stubs.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-05-28 12:06:46 +02:00
Hans Leidekker 98ea906b96 bcrypt: Implement BCRYPT_HASH_REUSABLE_FLAG.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-03-06 18:32:00 +01:00
Hans Leidekker f0a18f6f19 bcrypt: Implement BCryptDeriveKeyPBKDF2.
Based on a patch by Jack Grigg.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=42704
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-13 19:45:24 +01:00
Hans Leidekker 158ce169e4 bcrypt: Add support for importing and exporting ECC private keys.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-13 19:45:24 +01:00
Hans Leidekker 5c2ac77ab7 bcrypt: Add support for importing and exporting ECC public keys.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-13 19:45:24 +01:00
Hans Leidekker 73b695f059 bcrypt: Implement BCryptGenerate/FinalizeKeyPair for ECDH P256.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46564
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2019-02-13 19:45:24 +01:00
Hans Leidekker 370ffa0d14 bcrypt: Clear magic bytes on destroy.
Based on a patch by Steven Noonan.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-17 10:08:03 +01:00
Hans Leidekker dc97df72ff bcrypt: Support retrieving properties from key handles.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-12-04 10:02:25 +01:00
Hans Leidekker b6cb27ea4c bcrypt: Move the ASN1 buffer functions to gnutls.c.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-20 18:36:56 +02:00
Hans Leidekker 8b8a32f7a8 bcrypt: Default to building with GnuTLS support on macOS, if present.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-20 18:36:56 +02:00
Hans Leidekker d265dd88cd bcrypt: Move macOS support to a new file.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-18 14:13:43 +02:00
Hans Leidekker 018b695efa bcrypt: Move GnuTLS support to a new file.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-07-18 14:13:43 +02:00
Michael Stefaniuc 7f99932a39 bcrypt/tests: Use the available ARRAY_SIZE() macro.
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-05-29 09:28:23 +02:00
Hans Leidekker 576d22d251 bcrypt: Introduce helpers for BCryptDe/Encrypt and BCryptImportKeyPair.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-29 16:06:04 +02:00
Hans Leidekker f352837868 bcrypt: Add support for BCRYPT_OPAQUE_KEY_BLOB.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-29 16:06:03 +02:00
Kimmo Myllyvirta 2154562d7e bcrypt/tests: Add simple test for RSA.
Based on patch from Bernhard Übelacker.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-26 21:06:24 +02:00
Kimmo Myllyvirta b3c8723bd4 bcrypt: Initial implementation for RSA key import and signature verification.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-26 21:06:20 +02:00
Michael Müller 19e0f97f71 bcrypt: Implement BCryptVerifySignature for ECDSA signatures.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-26 21:06:13 +02:00
Michael Müller 76b6c360fa bcrypt: Implement importing of ECDSA keys.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-26 21:06:04 +02:00
Michael Müller 3f17921d86 bcrypt: Preparation for asymmetric keys.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-26 21:05:57 +02:00
Michael Müller 5946973021 bcrypt/tests: Add basic test for ECDSA.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-23 16:28:22 +01:00
Michael Müller d0006d05c9 bcrypt: Add support for 192 and 256 bit AES keys.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-23 16:28:20 +01:00
Hans Leidekker 0c55f8faa3 bcrypt: Implement support for ECB chain mode.
Based on a patch by Sebastian Lackner.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-23 16:28:17 +01:00
Andrew Wesie 5118eb3ab5 bcrypt: Fix BCryptEncrypt with AES_GCM and no input and no output.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-22 11:41:38 +01:00
Hans Leidekker aabc55c491 bcrypt/tests: Add more tests for BCryptGenerateSymmetricKey and BCryptDuplicateKey.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-22 11:41:29 +01:00
Sebastian Lackner e7923d3e0d bcrypt/tests: Add tests for auth data in AES GCM mode.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-22 11:41:24 +01:00
Michael Müller 1b5e877155 bcrypt: Add support for auth data in AES GCM mode.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-22 11:41:20 +01:00
Sebastian Lackner 4f4adf6972 bcrypt/tests: Add tests for BCryptDuplicateKey.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-22 11:41:16 +01:00
Michael Müller cb0a960ff6 bcrypt: Implement BCryptDuplicateKey.
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-22 11:41:05 +01:00
Michael Müller 1b999a447b bcrypt: Allow to call BCryptSetProperty on key objects.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-21 10:41:24 +01:00
Michael Müller c7b46e8e3c bcrypt: Add support for computing/comparing cipher tag.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-21 10:41:19 +01:00
Michael Müller 8d2b1d276d bcrypt: Implement BCryptDecrypt for AES GCM mode.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-21 10:41:15 +01:00
Michael Müller 7c9291ce07 bcrypt: Implement BCryptEncrypt for AES GCM mode.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-21 10:41:12 +01:00
Michael Müller 313c06bfbf bcrypt: Implement BCryptGetProperty for BCRYPT_AUTH_TAG_LENGTH.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-19 13:16:32 +01:00
Michael Müller ba1ed4432c bcrypt: Implement BCryptGetProperty for BCRYPT_CHAINING_MODE.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-19 13:16:32 +01:00
Michael Müller 7ec0892ab7 bcrypt: Implement BCryptSetProperty for algorithms.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-19 13:16:32 +01:00
Sebastian Lackner fb8da6ca0c bcrypt: Pass object to get_{alg, hash}_property instead of alg_id.
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
2018-03-19 13:15:12 +01:00