提交 7201114e 编写于 作者: C coffeys

Merge

......@@ -945,3 +945,4 @@ f47b81dbed2dd730d34a8dc3e3d14e2aa9f9c493 jdk8u192-b09
2cd82eb879dd0f853dbfb7ffa2441e81e2413447 jdk8u192-b11
f877dad22786f92aa495a595a1a4a16f0163c573 jdk8u192-b12
996dd3ce1ec5437da8b5a742c60a5ff7b6028122 jdk8u192-b26
9da3ff5cd435240bc4941bc1c2ca170c567e012f jdk8u202-b01
......@@ -269,6 +269,15 @@ ifeq ($(OPENJDK_TARGET_OS), windows)
MACRO := copy-and-chmod))
COPY_FILES += $(COPY_MSVCR) $(COPY_MSVCP)
ifneq ($(UCRT_DLL_DIR), )
$(eval $(call SetupCopyFiles,COPY_UCRT_DLLS, \
DEST := $(JDK_OUTPUTDIR)/bin, \
FILES := $(wildcard $(UCRT_DLL_DIR)/*.dll), \
MACRO := copy-and-chmod \
))
COPY_FILES += $(COPY_UCRT_DLLS)
endif
endif
##########################################################################################
......
......@@ -96,7 +96,9 @@ void setDefaultScopeID(JNIEnv *env, struct sockaddr *him)
}
int defaultIndex;
struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *)him;
if (sin6->sin6_family == AF_INET6 && (sin6->sin6_scope_id == 0)) {
if (sin6->sin6_family == AF_INET6 && (sin6->sin6_scope_id == 0) &&
(IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr) ||
IN6_IS_ADDR_MULTICAST(&sin6->sin6_addr))) {
defaultIndex = (*env)->GetStaticIntField(env, ni_class,
ni_defaultIndexID);
sin6->sin6_scope_id = defaultIndex;
......
/*
* Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, 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
......@@ -25,6 +25,7 @@
// common infrastructure for SunPKCS11 tests
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.lang.reflect.*;
......@@ -269,8 +270,15 @@ public abstract class PKCS11Test {
getNSSInfo(nss_library);
}
// Try to parse the version for the specified library.
// Assuming the library contains either of the following patterns:
// $Header: NSS <version>
// Version: NSS <version>
// Here, <version> stands for NSS version.
static double getNSSInfo(String library) {
String nssHeader = "$Header: NSS";
// look for two types of headers in NSS libraries
String nssHeader1 = "$Header: NSS";
String nssHeader2 = "Version: NSS";
boolean found = false;
String s = null;
int i = 0;
......@@ -297,8 +305,9 @@ public abstract class PKCS11Test {
read = 100 + is.read(data, 100, 900);
}
s = new String(data, 0, read);
if ((i = s.indexOf(nssHeader)) > 0) {
s = new String(data, 0, read, StandardCharsets.US_ASCII);
i = s.indexOf(nssHeader1);
if (i > 0 || (i = s.indexOf(nssHeader2)) > 0) {
found = true;
// If the nssHeader is before 920 we can break, otherwise
// we may not have the whole header so do another read. If
......@@ -324,7 +333,12 @@ public abstract class PKCS11Test {
// the index after whitespace after nssHeader
int afterheader = s.indexOf("NSS", i) + 4;
String version = s.substring(afterheader, s.indexOf(' ', afterheader));
String version = String.valueOf(s.charAt(afterheader));
for (char c = s.charAt(++afterheader);
c == '.' || (c >= '0' && c <= '9');
c = s.charAt(++afterheader)) {
version += c;
}
// If a "dot dot" release, strip the extra dots for double parsing
String[] dot = version.split("\\.");
......@@ -339,6 +353,9 @@ public abstract class PKCS11Test {
try {
nss_version = Double.parseDouble(version);
} catch (NumberFormatException e) {
System.out.println("===== Content start =====");
System.out.println(s);
System.out.println("===== Content end =====");
System.out.println("Failed to parse lib" + library +
" version. Set to 0.0");
e.printStackTrace();
......
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 2018, 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
......@@ -103,7 +103,7 @@ public class TestKeyPairGenerator extends PKCS11Test {
data = new byte[2048];
// keypair generation is very slow, test only a few short keys
int[] keyLengths = {512, 512, 1024};
BigInteger[] pubExps = {null, BigInteger.valueOf(3), null};
BigInteger[] pubExps = {null, RSAKeyGenParameterSpec.F4, null};
KeyPair[] keyPairs = new KeyPair[3];
new Random().nextBytes(data);
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA", provider);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册