From 64f8253b7d9d382b18003c647a3941733f191329 Mon Sep 17 00:00:00 2001 From: Julian Waters Date: Thu, 2 Nov 2023 10:53:17 +0000 Subject: [PATCH] 8317332: Prepare security for permissive- Reviewed-by: djelinski, weijun, valeriep --- .../windows/native/libsspi_bridge/sspi.cpp | 15 ++++++++++----- .../windows/native/libw2k_lsa_auth/NativeCreds.c | 1 + 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/java.security.jgss/windows/native/libsspi_bridge/sspi.cpp b/src/java.security.jgss/windows/native/libsspi_bridge/sspi.cpp index 5c1f4dbae77..dd84ab3057b 100644 --- a/src/java.security.jgss/windows/native/libsspi_bridge/sspi.cpp +++ b/src/java.security.jgss/windows/native/libsspi_bridge/sspi.cpp @@ -409,7 +409,8 @@ gss_import_name(OM_uint32 *minor_status, PP("Host-based service now %ls", value); } PP("import_name to %ls", value); - gss_name_struct* name = new gss_name_struct; + gss_name_struct* name; + name = new gss_name_struct; if (name == NULL) { goto err; } @@ -533,15 +534,18 @@ gss_export_name(OM_uint32 *minor_status, } PP("Make fullname: %ls -> %ls", name, fullname); int len; - size_t namelen = wcslen(fullname); + size_t namelen; + namelen = wcslen(fullname); if (namelen > 255) { goto err; } len = (int)namelen; // We only deal with not-so-long names. // 04 01 00 ** 06 ** OID len:int32 name - int mechLen = KRB5_OID.length; - char* buffer = (char*) malloc(10 + mechLen + len); + int mechLen; + mechLen = KRB5_OID.length; + char* buffer; + buffer = (char*) malloc(10 + mechLen + len); if (buffer == NULL) { goto err; } @@ -904,7 +908,8 @@ gss_init_sec_context(OM_uint32 *minor_status, } outName[len] = 0; - int flag = flag_gss_to_sspi(req_flags) | ISC_REQ_ALLOCATE_MEMORY; + int flag; + flag = flag_gss_to_sspi(req_flags) | ISC_REQ_ALLOCATE_MEMORY; outBuffDesc.ulVersion = SECBUFFER_VERSION; outBuffDesc.cBuffers = 1; diff --git a/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c b/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c index abace8db417..5857267b760 100644 --- a/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c +++ b/src/java.security.jgss/windows/native/libw2k_lsa_auth/NativeCreds.c @@ -75,6 +75,7 @@ BOOL native_debug = 0; BOOL PackageConnectLookup(PHANDLE,PULONG); +static NTSTATUS ConstructTicketRequest(JNIEnv *env, UNICODE_STRING DomainName, PKERB_RETRIEVE_TKT_REQUEST *outRequest,