< prev index next >

src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp

Print this page
rev 13981 : imported patch 6483657-MSCAPI-provider-does-not-create-unique-alias-names

*** 1,7 **** /* ! * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this --- 1,7 ---- /* ! * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this
*** 270,280 **** * Class: sun_security_mscapi_KeyStore * Method: loadKeysOrCertificateChains * Signature: (Ljava/lang/String;Ljava/util/Collection;)V */ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_loadKeysOrCertificateChains ! (JNIEnv *env, jobject obj, jstring jCertStoreName, jobject jCollections) { /** * Certificate in cert store has enhanced key usage extension * property (or EKU property) that is not part of the certificate itself. To determine * if the certificate should be returned, both the enhanced key usage in certificate --- 270,280 ---- * Class: sun_security_mscapi_KeyStore * Method: loadKeysOrCertificateChains * Signature: (Ljava/lang/String;Ljava/util/Collection;)V */ JNIEXPORT void JNICALL Java_sun_security_mscapi_KeyStore_loadKeysOrCertificateChains ! (JNIEnv *env, jobject obj, jstring jCertStoreName) { /** * Certificate in cert store has enhanced key usage extension * property (or EKU property) that is not part of the certificate itself. To determine * if the certificate should be returned, both the enhanced key usage in certificate
*** 329,347 **** } // Determine method ID to generate certificate chain jmethodID mGenCertChain = env->GetMethodID(clazzOfThis, "generateCertificateChain", ! "(Ljava/lang/String;Ljava/util/Collection;Ljava/util/Collection;)V"); if (mGenCertChain == NULL) { __leave; } // Determine method ID to generate RSA certificate chain jmethodID mGenRSAKeyAndCertChain = env->GetMethodID(clazzOfThis, "generateRSAKeyAndCertificateChain", ! "(Ljava/lang/String;JJILjava/util/Collection;Ljava/util/Collection;)V"); if (mGenRSAKeyAndCertChain == NULL) { __leave; } // Use CertEnumCertificatesInStore to get the certificates --- 329,347 ---- } // Determine method ID to generate certificate chain jmethodID mGenCertChain = env->GetMethodID(clazzOfThis, "generateCertificateChain", ! "(Ljava/lang/String;Ljava/util/Collection;)V"); if (mGenCertChain == NULL) { __leave; } // Determine method ID to generate RSA certificate chain jmethodID mGenRSAKeyAndCertChain = env->GetMethodID(clazzOfThis, "generateRSAKeyAndCertificateChain", ! "(Ljava/lang/String;JJILjava/util/Collection;)V"); if (mGenRSAKeyAndCertChain == NULL) { __leave; } // Use CertEnumCertificatesInStore to get the certificates
*** 388,405 **** // determine the key length of the private key by using the public key // in the certificate. dwPublicKeyLength = ::CertGetPublicKeyLength(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &(pCertContext->pCertInfo->SubjectPublicKeyInfo)); ! } PCCERT_CHAIN_CONTEXT pCertChainContext = NULL; // Build certificate chain by using system certificate store. // Add cert chain into collection for any key usage. // ! if (GetCertificateChain(OID_EKU_ANY, pCertContext, ! &pCertChainContext)) { for (unsigned int i=0; i < pCertChainContext->cChain; i++) { // Found cert chain --- 388,404 ---- // determine the key length of the private key by using the public key // in the certificate. dwPublicKeyLength = ::CertGetPublicKeyLength(X509_ASN_ENCODING | PKCS_7_ASN_ENCODING, &(pCertContext->pCertInfo->SubjectPublicKeyInfo)); ! } PCCERT_CHAIN_CONTEXT pCertChainContext = NULL; // Build certificate chain by using system certificate store. // Add cert chain into collection for any key usage. // ! if (GetCertificateChain(OID_EKU_ANY, pCertContext, &pCertChainContext)) { for (unsigned int i=0; i < pCertChainContext->cChain; i++) { // Found cert chain
*** 454,464 **** { // Generate certificate chain and store into cert chain // collection env->CallVoidMethod(obj, mGenCertChain, env->NewStringUTF(pszNameString), ! jArrayList, jCollections); } else { // Determine key type: RSA or DSA DWORD dwData = CALG_RSA_KEYX; --- 453,463 ---- { // Generate certificate chain and store into cert chain // collection env->CallVoidMethod(obj, mGenCertChain, env->NewStringUTF(pszNameString), ! jArrayList); } else { // Determine key type: RSA or DSA DWORD dwData = CALG_RSA_KEYX;
*** 471,483 **** // Generate RSA certificate chain and store into cert // chain collection env->CallVoidMethod(obj, mGenRSAKeyAndCertChain, env->NewStringUTF(pszNameString), (jlong) hCryptProv, (jlong) hUserKey, ! dwPublicKeyLength, jArrayList, jCollections); } - } } // Free cert chain if (pCertChainContext) ::CertFreeCertificateChain(pCertChainContext); --- 470,482 ---- // Generate RSA certificate chain and store into cert // chain collection env->CallVoidMethod(obj, mGenRSAKeyAndCertChain, env->NewStringUTF(pszNameString), (jlong) hCryptProv, (jlong) hUserKey, ! dwPublicKeyLength, jArrayList); ! } } } // Free cert chain if (pCertChainContext) ::CertFreeCertificateChain(pCertChainContext);
< prev index next >