|
1 | 1 | /*
|
2 |
| - * Copyright (c) 2005, 2023, Oracle and/or its affiliates. All rights reserved. |
| 2 | + * Copyright (c) 2005, 2024, Oracle and/or its affiliates. All rights reserved. |
3 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
4 | 4 | *
|
5 | 5 | * This code is free software; you can redistribute it and/or modify it
|
@@ -444,7 +444,7 @@ JNIEXPORT void JNICALL Java_sun_security_mscapi_CKeyStore_loadKeysOrCertificateC
|
444 | 444 | }
|
445 | 445 | else if (jCertStoreLocation == KEYSTORE_LOCATION_LOCALMACHINE) {
|
446 | 446 | hCertStore = ::CertOpenStore(CERT_STORE_PROV_SYSTEM_A, 0, NULL,
|
447 |
| - CERT_SYSTEM_STORE_LOCAL_MACHINE, pszCertStoreName); |
| 447 | + CERT_SYSTEM_STORE_LOCAL_MACHINE | CERT_STORE_MAXIMUM_ALLOWED_FLAG, pszCertStoreName); |
448 | 448 | }
|
449 | 449 | else {
|
450 | 450 | PP("jCertStoreLocation is not a valid value");
|
@@ -798,11 +798,15 @@ JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_CSignature_signHash
|
798 | 798 | ::CryptGetProvParam((HCRYPTPROV)hCryptProv, PP_CONTAINER, //deprecated
|
799 | 799 | (BYTE *)pbData, &cbData, 0);
|
800 | 800 |
|
| 801 | + DWORD keysetType = 0; |
| 802 | + DWORD keysetTypeLen = sizeof(keysetType); |
| 803 | + ::CryptGetProvParam((HCRYPTPROV)hCryptProv, PP_KEYSET_TYPE, //deprecated |
| 804 | + (BYTE*)&keysetType, &keysetTypeLen, 0); |
| 805 | + |
801 | 806 | // Acquire an alternative CSP handle
|
802 | 807 | if (::CryptAcquireContext(&hCryptProvAlt, LPCSTR(pbData), NULL, //deprecated
|
803 |
| - PROV_RSA_AES, 0) == FALSE) |
| 808 | + PROV_RSA_AES, 0 | keysetType) == FALSE) |
804 | 809 | {
|
805 |
| - |
806 | 810 | ThrowException(env, SIGNATURE_EXCEPTION, GetLastError());
|
807 | 811 | __leave;
|
808 | 812 | }
|
|
0 commit comments