Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
6a158108
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6a158108
编写于
5月 25, 2017
作者:
I
igerasim
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8156502: Use short name of SupportedEllipticCurvesExtension.java
Reviewed-by: vinnie
上级
96ed4dfd
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
29 addition
and
32 deletion
+29
-32
src/share/classes/sun/security/ssl/ClientHandshaker.java
src/share/classes/sun/security/ssl/ClientHandshaker.java
+3
-3
src/share/classes/sun/security/ssl/ECDHCrypt.java
src/share/classes/sun/security/ssl/ECDHCrypt.java
+1
-1
src/share/classes/sun/security/ssl/EllipticCurvesExtension.java
...are/classes/sun/security/ssl/EllipticCurvesExtension.java
+5
-5
src/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java
...asses/sun/security/ssl/EllipticPointFormatsExtension.java
+5
-5
src/share/classes/sun/security/ssl/HandshakeMessage.java
src/share/classes/sun/security/ssl/HandshakeMessage.java
+3
-5
src/share/classes/sun/security/ssl/Handshaker.java
src/share/classes/sun/security/ssl/Handshaker.java
+2
-2
src/share/classes/sun/security/ssl/HelloExtensions.java
src/share/classes/sun/security/ssl/HelloExtensions.java
+5
-6
src/share/classes/sun/security/ssl/ServerHandshaker.java
src/share/classes/sun/security/ssl/ServerHandshaker.java
+5
-5
未找到文件。
src/share/classes/sun/security/ssl/ClientHandshaker.java
浏览文件 @
6a158108
...
@@ -1381,12 +1381,12 @@ final class ClientHandshaker extends Handshaker {
...
@@ -1381,12 +1381,12 @@ final class ClientHandshaker extends Handshaker {
// add elliptic curves and point format extensions
// add elliptic curves and point format extensions
if
(
cipherSuites
.
containsEC
())
{
if
(
cipherSuites
.
containsEC
())
{
Supported
EllipticCurvesExtension
ece
=
EllipticCurvesExtension
ece
=
Supported
EllipticCurvesExtension
.
createExtension
(
algorithmConstraints
);
EllipticCurvesExtension
.
createExtension
(
algorithmConstraints
);
if
(
ece
!=
null
)
{
if
(
ece
!=
null
)
{
clientHelloMessage
.
extensions
.
add
(
ece
);
clientHelloMessage
.
extensions
.
add
(
ece
);
clientHelloMessage
.
extensions
.
add
(
clientHelloMessage
.
extensions
.
add
(
Supported
EllipticPointFormatsExtension
.
DEFAULT
);
EllipticPointFormatsExtension
.
DEFAULT
);
}
}
}
}
...
...
src/share/classes/sun/security/ssl/ECDHCrypt.java
浏览文件 @
6a158108
...
@@ -60,7 +60,7 @@ final class ECDHCrypt {
...
@@ -60,7 +60,7 @@ final class ECDHCrypt {
try
{
try
{
KeyPairGenerator
kpg
=
JsseJce
.
getKeyPairGenerator
(
"EC"
);
KeyPairGenerator
kpg
=
JsseJce
.
getKeyPairGenerator
(
"EC"
);
ECGenParameterSpec
params
=
ECGenParameterSpec
params
=
Supported
EllipticCurvesExtension
.
getECGenParamSpec
(
curveId
);
EllipticCurvesExtension
.
getECGenParamSpec
(
curveId
);
kpg
.
initialize
(
params
,
random
);
kpg
.
initialize
(
params
,
random
);
KeyPair
kp
=
kpg
.
generateKeyPair
();
KeyPair
kp
=
kpg
.
generateKeyPair
();
privateKey
=
kp
.
getPrivate
();
privateKey
=
kp
.
getPrivate
();
...
...
src/share/classes/sun/security/ssl/
Supported
EllipticCurvesExtension.java
→
src/share/classes/sun/security/ssl/EllipticCurvesExtension.java
浏览文件 @
6a158108
...
@@ -41,7 +41,7 @@ import javax.net.ssl.SSLProtocolException;
...
@@ -41,7 +41,7 @@ import javax.net.ssl.SSLProtocolException;
import
sun.security.action.GetPropertyAction
;
import
sun.security.action.GetPropertyAction
;
final
class
Supported
EllipticCurvesExtension
extends
HelloExtension
{
final
class
EllipticCurvesExtension
extends
HelloExtension
{
/* Class and subclass dynamic debugging support */
/* Class and subclass dynamic debugging support */
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"ssl"
);
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"ssl"
);
...
@@ -226,12 +226,12 @@ final class SupportedEllipticCurvesExtension extends HelloExtension {
...
@@ -226,12 +226,12 @@ final class SupportedEllipticCurvesExtension extends HelloExtension {
return
false
;
return
false
;
}
}
private
Supported
EllipticCurvesExtension
(
int
[]
curveIds
)
{
private
EllipticCurvesExtension
(
int
[]
curveIds
)
{
super
(
ExtensionType
.
EXT_ELLIPTIC_CURVES
);
super
(
ExtensionType
.
EXT_ELLIPTIC_CURVES
);
this
.
curveIds
=
curveIds
;
this
.
curveIds
=
curveIds
;
}
}
Supported
EllipticCurvesExtension
(
HandshakeInStream
s
,
int
len
)
EllipticCurvesExtension
(
HandshakeInStream
s
,
int
len
)
throws
IOException
{
throws
IOException
{
super
(
ExtensionType
.
EXT_ELLIPTIC_CURVES
);
super
(
ExtensionType
.
EXT_ELLIPTIC_CURVES
);
int
k
=
s
.
getInt16
();
int
k
=
s
.
getInt16
();
...
@@ -255,7 +255,7 @@ final class SupportedEllipticCurvesExtension extends HelloExtension {
...
@@ -255,7 +255,7 @@ final class SupportedEllipticCurvesExtension extends HelloExtension {
return
getActiveCurves
(
constraints
)
>=
0
;
return
getActiveCurves
(
constraints
)
>=
0
;
}
}
static
Supported
EllipticCurvesExtension
createExtension
(
static
EllipticCurvesExtension
createExtension
(
AlgorithmConstraints
constraints
)
{
AlgorithmConstraints
constraints
)
{
ArrayList
<
Integer
>
idList
=
new
ArrayList
<>(
supportedCurveIds
.
length
);
ArrayList
<
Integer
>
idList
=
new
ArrayList
<>(
supportedCurveIds
.
length
);
...
@@ -274,7 +274,7 @@ final class SupportedEllipticCurvesExtension extends HelloExtension {
...
@@ -274,7 +274,7 @@ final class SupportedEllipticCurvesExtension extends HelloExtension {
ids
[
i
++]
=
id
;
ids
[
i
++]
=
id
;
}
}
return
new
Supported
EllipticCurvesExtension
(
ids
);
return
new
EllipticCurvesExtension
(
ids
);
}
}
return
null
;
return
null
;
...
...
src/share/classes/sun/security/ssl/
Supported
EllipticPointFormatsExtension.java
→
src/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java
浏览文件 @
6a158108
/*
/*
* Copyright (c) 2006, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -31,24 +31,24 @@ import java.util.List;
...
@@ -31,24 +31,24 @@ import java.util.List;
import
javax.net.ssl.SSLProtocolException
;
import
javax.net.ssl.SSLProtocolException
;
final
class
Supported
EllipticPointFormatsExtension
extends
HelloExtension
{
final
class
EllipticPointFormatsExtension
extends
HelloExtension
{
final
static
int
FMT_UNCOMPRESSED
=
0
;
final
static
int
FMT_UNCOMPRESSED
=
0
;
final
static
int
FMT_ANSIX962_COMPRESSED_PRIME
=
1
;
final
static
int
FMT_ANSIX962_COMPRESSED_PRIME
=
1
;
final
static
int
FMT_ANSIX962_COMPRESSED_CHAR2
=
2
;
final
static
int
FMT_ANSIX962_COMPRESSED_CHAR2
=
2
;
static
final
HelloExtension
DEFAULT
=
static
final
HelloExtension
DEFAULT
=
new
Supported
EllipticPointFormatsExtension
(
new
EllipticPointFormatsExtension
(
new
byte
[]
{
FMT_UNCOMPRESSED
});
new
byte
[]
{
FMT_UNCOMPRESSED
});
private
final
byte
[]
formats
;
private
final
byte
[]
formats
;
private
Supported
EllipticPointFormatsExtension
(
byte
[]
formats
)
{
private
EllipticPointFormatsExtension
(
byte
[]
formats
)
{
super
(
ExtensionType
.
EXT_EC_POINT_FORMATS
);
super
(
ExtensionType
.
EXT_EC_POINT_FORMATS
);
this
.
formats
=
formats
;
this
.
formats
=
formats
;
}
}
Supported
EllipticPointFormatsExtension
(
HandshakeInStream
s
,
int
len
)
EllipticPointFormatsExtension
(
HandshakeInStream
s
,
int
len
)
throws
IOException
{
throws
IOException
{
super
(
ExtensionType
.
EXT_EC_POINT_FORMATS
);
super
(
ExtensionType
.
EXT_EC_POINT_FORMATS
);
formats
=
s
.
getBytes8
();
formats
=
s
.
getBytes8
();
...
...
src/share/classes/sun/security/ssl/HandshakeMessage.java
浏览文件 @
6a158108
...
@@ -1010,7 +1010,7 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
...
@@ -1010,7 +1010,7 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
ECParameterSpec
params
=
publicKey
.
getParams
();
ECParameterSpec
params
=
publicKey
.
getParams
();
ECPoint
point
=
publicKey
.
getW
();
ECPoint
point
=
publicKey
.
getW
();
pointBytes
=
JsseJce
.
encodePoint
(
point
,
params
.
getCurve
());
pointBytes
=
JsseJce
.
encodePoint
(
point
,
params
.
getCurve
());
curveId
=
Supported
EllipticCurvesExtension
.
getCurveIndex
(
params
);
curveId
=
EllipticCurvesExtension
.
getCurveIndex
(
params
);
if
(
privateKey
==
null
)
{
if
(
privateKey
==
null
)
{
// ECDH_anon
// ECDH_anon
...
@@ -1048,13 +1048,11 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
...
@@ -1048,13 +1048,11 @@ class ECDH_ServerKeyExchange extends ServerKeyExchange {
// the supported curves during the exchange of the Hello messages.
// the supported curves during the exchange of the Hello messages.
if
(
curveType
==
CURVE_NAMED_CURVE
)
{
if
(
curveType
==
CURVE_NAMED_CURVE
)
{
curveId
=
input
.
getInt16
();
curveId
=
input
.
getInt16
();
if
(
SupportedEllipticCurvesExtension
.
isSupported
(
curveId
)
if
(!
EllipticCurvesExtension
.
isSupported
(
curveId
))
{
==
false
)
{
throw
new
SSLHandshakeException
(
throw
new
SSLHandshakeException
(
"Unsupported curveId: "
+
curveId
);
"Unsupported curveId: "
+
curveId
);
}
}
String
curveOid
=
String
curveOid
=
EllipticCurvesExtension
.
getCurveOid
(
curveId
);
SupportedEllipticCurvesExtension
.
getCurveOid
(
curveId
);
if
(
curveOid
==
null
)
{
if
(
curveOid
==
null
)
{
throw
new
SSLHandshakeException
(
throw
new
SSLHandshakeException
(
"Unknown named curve: "
+
curveId
);
"Unknown named curve: "
+
curveId
);
...
...
src/share/classes/sun/security/ssl/Handshaker.java
浏览文件 @
6a158108
...
@@ -647,7 +647,7 @@ abstract class Handshaker {
...
@@ -647,7 +647,7 @@ abstract class Handshaker {
boolean
available
=
true
;
boolean
available
=
true
;
if
(
suite
.
keyExchange
.
isEC
)
{
if
(
suite
.
keyExchange
.
isEC
)
{
if
(!
checkedCurves
)
{
if
(!
checkedCurves
)
{
hasCurves
=
Supported
EllipticCurvesExtension
hasCurves
=
EllipticCurvesExtension
.
hasActiveCurves
(
algorithmConstraints
);
.
hasActiveCurves
(
algorithmConstraints
);
checkedCurves
=
true
;
checkedCurves
=
true
;
...
@@ -738,7 +738,7 @@ abstract class Handshaker {
...
@@ -738,7 +738,7 @@ abstract class Handshaker {
boolean
available
=
true
;
boolean
available
=
true
;
if
(
suite
.
keyExchange
.
isEC
)
{
if
(
suite
.
keyExchange
.
isEC
)
{
if
(!
checkedCurves
)
{
if
(!
checkedCurves
)
{
hasCurves
=
Supported
EllipticCurvesExtension
hasCurves
=
EllipticCurvesExtension
.
hasActiveCurves
(
algorithmConstraints
);
.
hasActiveCurves
(
algorithmConstraints
);
checkedCurves
=
true
;
checkedCurves
=
true
;
...
...
src/share/classes/sun/security/ssl/HelloExtensions.java
浏览文件 @
6a158108
/*
/*
* Copyright (c) 2006, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2006, 201
6
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -49,8 +49,8 @@ import javax.net.ssl.*;
...
@@ -49,8 +49,8 @@ import javax.net.ssl.*;
* explicitly support.
* explicitly support.
* . ServerNameExtension: the server_name extension.
* . ServerNameExtension: the server_name extension.
* . SignatureAlgorithmsExtension: the signature_algorithms extension.
* . SignatureAlgorithmsExtension: the signature_algorithms extension.
* .
Supported
EllipticCurvesExtension: the ECC supported curves extension.
* . EllipticCurvesExtension: the ECC supported curves extension.
* .
Supported
EllipticPointFormatsExtension: the ECC supported point formats
* . EllipticPointFormatsExtension: the ECC supported point formats
* (compressed/uncompressed) extension.
* (compressed/uncompressed) extension.
*
*
* @since 1.6
* @since 1.6
...
@@ -79,10 +79,9 @@ final class HelloExtensions {
...
@@ -79,10 +79,9 @@ final class HelloExtensions {
}
else
if
(
extType
==
ExtensionType
.
EXT_SIGNATURE_ALGORITHMS
)
{
}
else
if
(
extType
==
ExtensionType
.
EXT_SIGNATURE_ALGORITHMS
)
{
extension
=
new
SignatureAlgorithmsExtension
(
s
,
extlen
);
extension
=
new
SignatureAlgorithmsExtension
(
s
,
extlen
);
}
else
if
(
extType
==
ExtensionType
.
EXT_ELLIPTIC_CURVES
)
{
}
else
if
(
extType
==
ExtensionType
.
EXT_ELLIPTIC_CURVES
)
{
extension
=
new
Supported
EllipticCurvesExtension
(
s
,
extlen
);
extension
=
new
EllipticCurvesExtension
(
s
,
extlen
);
}
else
if
(
extType
==
ExtensionType
.
EXT_EC_POINT_FORMATS
)
{
}
else
if
(
extType
==
ExtensionType
.
EXT_EC_POINT_FORMATS
)
{
extension
=
extension
=
new
EllipticPointFormatsExtension
(
s
,
extlen
);
new
SupportedEllipticPointFormatsExtension
(
s
,
extlen
);
}
else
if
(
extType
==
ExtensionType
.
EXT_RENEGOTIATION_INFO
)
{
}
else
if
(
extType
==
ExtensionType
.
EXT_RENEGOTIATION_INFO
)
{
extension
=
new
RenegotiationInfoExtension
(
s
,
extlen
);
extension
=
new
RenegotiationInfoExtension
(
s
,
extlen
);
}
else
{
}
else
{
...
...
src/share/classes/sun/security/ssl/ServerHandshaker.java
浏览文件 @
6a158108
...
@@ -93,7 +93,7 @@ final class ServerHandshaker extends Handshaker {
...
@@ -93,7 +93,7 @@ final class ServerHandshaker extends Handshaker {
private
ProtocolVersion
clientRequestedVersion
;
private
ProtocolVersion
clientRequestedVersion
;
// client supported elliptic curves
// client supported elliptic curves
private
Supported
EllipticCurvesExtension
requestedCurves
;
private
EllipticCurvesExtension
requestedCurves
;
// the preferable signature algorithm used by ServerKeyExchange message
// the preferable signature algorithm used by ServerKeyExchange message
SignatureAndHashAlgorithm
preferableSignatureAlgorithm
;
SignatureAndHashAlgorithm
preferableSignatureAlgorithm
;
...
@@ -683,7 +683,7 @@ final class ServerHandshaker extends Handshaker {
...
@@ -683,7 +683,7 @@ final class ServerHandshaker extends Handshaker {
throw
new
SSLException
(
"Client did not resume a session"
);
throw
new
SSLException
(
"Client did not resume a session"
);
}
}
requestedCurves
=
(
Supported
EllipticCurvesExtension
)
requestedCurves
=
(
EllipticCurvesExtension
)
mesg
.
extensions
.
get
(
ExtensionType
.
EXT_ELLIPTIC_CURVES
);
mesg
.
extensions
.
get
(
ExtensionType
.
EXT_ELLIPTIC_CURVES
);
// We only need to handle the "signature_algorithm" extension
// We only need to handle the "signature_algorithm" extension
...
@@ -1422,7 +1422,7 @@ final class ServerHandshaker extends Handshaker {
...
@@ -1422,7 +1422,7 @@ final class ServerHandshaker extends Handshaker {
private
boolean
setupEphemeralECDHKeys
()
{
private
boolean
setupEphemeralECDHKeys
()
{
int
index
=
(
requestedCurves
!=
null
)
?
int
index
=
(
requestedCurves
!=
null
)
?
requestedCurves
.
getPreferredCurve
(
algorithmConstraints
)
:
requestedCurves
.
getPreferredCurve
(
algorithmConstraints
)
:
Supported
EllipticCurvesExtension
.
getActiveCurves
(
algorithmConstraints
);
EllipticCurvesExtension
.
getActiveCurves
(
algorithmConstraints
);
if
(
index
<
0
)
{
if
(
index
<
0
)
{
// no match found, cannot use this ciphersuite
// no match found, cannot use this ciphersuite
return
false
;
return
false
;
...
@@ -1477,8 +1477,8 @@ final class ServerHandshaker extends Handshaker {
...
@@ -1477,8 +1477,8 @@ final class ServerHandshaker extends Handshaker {
return
false
;
return
false
;
}
}
ECParameterSpec
params
=
((
ECPublicKey
)
publicKey
).
getParams
();
ECParameterSpec
params
=
((
ECPublicKey
)
publicKey
).
getParams
();
int
id
=
Supported
EllipticCurvesExtension
.
getCurveIndex
(
params
);
int
id
=
EllipticCurvesExtension
.
getCurveIndex
(
params
);
if
((
id
<=
0
)
||
!
Supported
EllipticCurvesExtension
.
isSupported
(
id
)
||
if
((
id
<=
0
)
||
!
EllipticCurvesExtension
.
isSupported
(
id
)
||
((
requestedCurves
!=
null
)
&&
!
requestedCurves
.
contains
(
id
)))
{
((
requestedCurves
!=
null
)
&&
!
requestedCurves
.
contains
(
id
)))
{
return
false
;
return
false
;
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录