Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
d088b4be
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看板
提交
d088b4be
编写于
2月 07, 2019
作者:
C
coffeys
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8218553: Enhance keystore load debug output
Reviewed-by: weijun, sgehwolf
上级
17a5a1d6
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
52 addition
and
24 deletion
+52
-24
src/macosx/classes/apple/security/KeychainStore.java
src/macosx/classes/apple/security/KeychainStore.java
+7
-1
src/share/classes/com/sun/crypto/provider/JceKeyStore.java
src/share/classes/com/sun/crypto/provider/JceKeyStore.java
+17
-5
src/share/classes/sun/security/pkcs11/P11KeyStore.java
src/share/classes/sun/security/pkcs11/P11KeyStore.java
+3
-1
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
+3
-12
src/share/classes/sun/security/provider/JavaKeyStore.java
src/share/classes/sun/security/provider/JavaKeyStore.java
+13
-4
src/windows/classes/sun/security/mscapi/KeyStore.java
src/windows/classes/sun/security/mscapi/KeyStore.java
+9
-1
未找到文件。
src/macosx/classes/apple/security/KeychainStore.java
浏览文件 @
d088b4be
/*
/*
* Copyright (c) 2011, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 201
9
, 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
...
@@ -102,6 +102,8 @@ public final class KeychainStore extends KeyStoreSpi {
...
@@ -102,6 +102,8 @@ public final class KeychainStore extends KeyStoreSpi {
private
static
final
int
iterationCount
=
1024
;
private
static
final
int
iterationCount
=
1024
;
private
static
final
int
SALT_LEN
=
20
;
private
static
final
int
SALT_LEN
=
20
;
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"keystore"
);
static
{
static
{
AccessController
.
doPrivileged
(
AccessController
.
doPrivileged
(
new
PrivilegedAction
<
Void
>()
{
new
PrivilegedAction
<
Void
>()
{
...
@@ -771,6 +773,10 @@ public final class KeychainStore extends KeyStoreSpi {
...
@@ -771,6 +773,10 @@ public final class KeychainStore extends KeyStoreSpi {
entries
.
clear
();
entries
.
clear
();
_scanKeychain
();
_scanKeychain
();
if
(
debug
!=
null
)
{
debug
.
println
(
"KeychainStore load entry count: "
+
entries
.
size
());
}
}
}
}
}
...
...
src/share/classes/com/sun/crypto/provider/JceKeyStore.java
浏览文件 @
d088b4be
/*
/*
* Copyright (c) 1998, 201
8
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 201
9
, 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
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
package
com.sun.crypto.provider
;
package
com.sun.crypto.provider
;
import
sun.security.util.Debug
;
import
java.io.*
;
import
java.io.*
;
import
java.util.*
;
import
java.util.*
;
import
java.security.AccessController
;
import
java.security.AccessController
;
...
@@ -61,6 +63,7 @@ import sun.misc.ObjectInputFilter;
...
@@ -61,6 +63,7 @@ import sun.misc.ObjectInputFilter;
public
final
class
JceKeyStore
extends
KeyStoreSpi
{
public
final
class
JceKeyStore
extends
KeyStoreSpi
{
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"keystore"
);
private
static
final
int
JCEKS_MAGIC
=
0xcececece
;
private
static
final
int
JCEKS_MAGIC
=
0xcececece
;
private
static
final
int
JKS_MAGIC
=
0xfeedfeed
;
private
static
final
int
JKS_MAGIC
=
0xfeedfeed
;
private
static
final
int
VERSION_1
=
0x01
;
private
static
final
int
VERSION_1
=
0x01
;
...
@@ -682,6 +685,7 @@ public final class JceKeyStore extends KeyStoreSpi {
...
@@ -682,6 +685,7 @@ public final class JceKeyStore extends KeyStoreSpi {
Hashtable
<
String
,
CertificateFactory
>
cfs
=
null
;
Hashtable
<
String
,
CertificateFactory
>
cfs
=
null
;
ByteArrayInputStream
bais
=
null
;
ByteArrayInputStream
bais
=
null
;
byte
[]
encoded
=
null
;
byte
[]
encoded
=
null
;
int
trustedKeyCount
=
0
,
privateKeyCount
=
0
,
secretKeyCount
=
0
;
if
(
stream
==
null
)
if
(
stream
==
null
)
return
;
return
;
...
@@ -728,7 +732,7 @@ public final class JceKeyStore extends KeyStoreSpi {
...
@@ -728,7 +732,7 @@ public final class JceKeyStore extends KeyStoreSpi {
tag
=
dis
.
readInt
();
tag
=
dis
.
readInt
();
if
(
tag
==
1
)
{
// private-key entry
if
(
tag
==
1
)
{
// private-key entry
privateKeyCount
++;
PrivateKeyEntry
entry
=
new
PrivateKeyEntry
();
PrivateKeyEntry
entry
=
new
PrivateKeyEntry
();
// read the alias
// read the alias
...
@@ -788,7 +792,7 @@ public final class JceKeyStore extends KeyStoreSpi {
...
@@ -788,7 +792,7 @@ public final class JceKeyStore extends KeyStoreSpi {
entries
.
put
(
alias
,
entry
);
entries
.
put
(
alias
,
entry
);
}
else
if
(
tag
==
2
)
{
// trusted certificate entry
}
else
if
(
tag
==
2
)
{
// trusted certificate entry
trustedKeyCount
++;
TrustedCertEntry
entry
=
new
TrustedCertEntry
();
TrustedCertEntry
entry
=
new
TrustedCertEntry
();
// read the alias
// read the alias
...
@@ -827,7 +831,7 @@ public final class JceKeyStore extends KeyStoreSpi {
...
@@ -827,7 +831,7 @@ public final class JceKeyStore extends KeyStoreSpi {
entries
.
put
(
alias
,
entry
);
entries
.
put
(
alias
,
entry
);
}
else
if
(
tag
==
3
)
{
// secret-key entry
}
else
if
(
tag
==
3
)
{
// secret-key entry
secretKeyCount
++;
SecretKeyEntry
entry
=
new
SecretKeyEntry
();
SecretKeyEntry
entry
=
new
SecretKeyEntry
();
// read the alias
// read the alias
...
@@ -860,10 +864,18 @@ public final class JceKeyStore extends KeyStoreSpi {
...
@@ -860,10 +864,18 @@ public final class JceKeyStore extends KeyStoreSpi {
entries
.
put
(
alias
,
entry
);
entries
.
put
(
alias
,
entry
);
}
else
{
}
else
{
throw
new
IOException
(
"Unrecognized keystore entry"
);
throw
new
IOException
(
"Unrecognized keystore entry: "
+
tag
);
}
}
}
}
if
(
debug
!=
null
)
{
debug
.
println
(
"JceKeyStore load: private key count: "
+
privateKeyCount
+
". trusted key count: "
+
trustedKeyCount
+
". secret key count: "
+
secretKeyCount
);
}
/*
/*
* If a password has been provided, we check the keyed digest
* If a password has been provided, we check the keyed digest
* at the end. If this check fails, the store has been tampered
* at the end. If this check fails, the store has been tampered
...
...
src/share/classes/sun/security/pkcs11/P11KeyStore.java
浏览文件 @
d088b4be
/*
/*
* Copyright (c) 2003, 201
8
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 201
9
, 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
...
@@ -773,6 +773,8 @@ final class P11KeyStore extends KeyStoreSpi {
...
@@ -773,6 +773,8 @@ final class P11KeyStore extends KeyStoreSpi {
}
}
if
(
debug
!=
null
)
{
if
(
debug
!=
null
)
{
dumpTokenMap
();
dumpTokenMap
();
debug
.
println
(
"P11KeyStore load. Entry count: "
+
aliasMap
.
size
());
}
}
}
catch
(
KeyStoreException
|
PKCS11Exception
e
)
{
}
catch
(
KeyStoreException
|
PKCS11Exception
e
)
{
throw
new
IOException
(
"load failed"
,
e
);
throw
new
IOException
(
"load failed"
,
e
);
...
...
src/share/classes/sun/security/pkcs12/PKCS12KeyStore.java
浏览文件 @
d088b4be
...
@@ -2152,18 +2152,9 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
...
@@ -2152,18 +2152,9 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
}
}
if
(
debug
!=
null
)
{
if
(
debug
!=
null
)
{
if
(
privateKeyCount
>
0
)
{
debug
.
println
(
"PKCS12KeyStore load: private key count: "
+
debug
.
println
(
"Loaded "
+
privateKeyCount
+
privateKeyCount
+
". secret key count: "
+
secretKeyCount
+
" protected private key(s)"
);
". certificate count: "
+
certificateCount
);
}
if
(
secretKeyCount
>
0
)
{
debug
.
println
(
"Loaded "
+
secretKeyCount
+
" protected secret key(s)"
);
}
if
(
certificateCount
>
0
)
{
debug
.
println
(
"Loaded "
+
certificateCount
+
" certificate(s)"
);
}
}
}
certEntries
.
clear
();
certEntries
.
clear
();
...
...
src/share/classes/sun/security/provider/JavaKeyStore.java
浏览文件 @
d088b4be
/*
/*
* Copyright (c) 1997, 201
8
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
9
, 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
...
@@ -35,6 +35,7 @@ import java.util.*;
...
@@ -35,6 +35,7 @@ import java.util.*;
import
sun.misc.IOUtils
;
import
sun.misc.IOUtils
;
import
sun.security.pkcs.EncryptedPrivateKeyInfo
;
import
sun.security.pkcs.EncryptedPrivateKeyInfo
;
import
sun.security.pkcs12.PKCS12KeyStore
;
import
sun.security.pkcs12.PKCS12KeyStore
;
import
sun.security.util.Debug
;
/**
/**
* This class provides the keystore implementation referred to as "JKS".
* This class provides the keystore implementation referred to as "JKS".
...
@@ -73,6 +74,7 @@ abstract class JavaKeyStore extends KeyStoreSpi {
...
@@ -73,6 +74,7 @@ abstract class JavaKeyStore extends KeyStoreSpi {
}
}
}
}
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"keystore"
);
private
static
final
int
MAGIC
=
0xfeedfeed
;
private
static
final
int
MAGIC
=
0xfeedfeed
;
private
static
final
int
VERSION_1
=
0x01
;
private
static
final
int
VERSION_1
=
0x01
;
private
static
final
int
VERSION_2
=
0x02
;
private
static
final
int
VERSION_2
=
0x02
;
...
@@ -642,6 +644,7 @@ abstract class JavaKeyStore extends KeyStoreSpi {
...
@@ -642,6 +644,7 @@ abstract class JavaKeyStore extends KeyStoreSpi {
Hashtable
<
String
,
CertificateFactory
>
cfs
=
null
;
Hashtable
<
String
,
CertificateFactory
>
cfs
=
null
;
ByteArrayInputStream
bais
=
null
;
ByteArrayInputStream
bais
=
null
;
byte
[]
encoded
=
null
;
byte
[]
encoded
=
null
;
int
trustedKeyCount
=
0
,
privateKeyCount
=
0
;
if
(
stream
==
null
)
if
(
stream
==
null
)
return
;
return
;
...
@@ -680,7 +683,7 @@ abstract class JavaKeyStore extends KeyStoreSpi {
...
@@ -680,7 +683,7 @@ abstract class JavaKeyStore extends KeyStoreSpi {
tag
=
dis
.
readInt
();
tag
=
dis
.
readInt
();
if
(
tag
==
1
)
{
// private key entry
if
(
tag
==
1
)
{
// private key entry
privateKeyCount
++;
KeyEntry
entry
=
new
KeyEntry
();
KeyEntry
entry
=
new
KeyEntry
();
// Read the alias
// Read the alias
...
@@ -729,7 +732,7 @@ abstract class JavaKeyStore extends KeyStoreSpi {
...
@@ -729,7 +732,7 @@ abstract class JavaKeyStore extends KeyStoreSpi {
entries
.
put
(
alias
,
entry
);
entries
.
put
(
alias
,
entry
);
}
else
if
(
tag
==
2
)
{
// trusted certificate entry
}
else
if
(
tag
==
2
)
{
// trusted certificate entry
trustedKeyCount
++;
TrustedCertEntry
entry
=
new
TrustedCertEntry
();
TrustedCertEntry
entry
=
new
TrustedCertEntry
();
// Read the alias
// Read the alias
...
@@ -764,10 +767,16 @@ abstract class JavaKeyStore extends KeyStoreSpi {
...
@@ -764,10 +767,16 @@ abstract class JavaKeyStore extends KeyStoreSpi {
entries
.
put
(
alias
,
entry
);
entries
.
put
(
alias
,
entry
);
}
else
{
}
else
{
throw
new
IOException
(
"Unrecognized keystore entry"
);
throw
new
IOException
(
"Unrecognized keystore entry: "
+
tag
);
}
}
}
}
if
(
debug
!=
null
)
{
debug
.
println
(
"JavaKeyStore load: private key count: "
+
privateKeyCount
+
". trusted key count: "
+
trustedKeyCount
);
}
/*
/*
* If a password has been provided, we check the keyed digest
* If a password has been provided, we check the keyed digest
* at the end. If this check fails, the store has been tampered
* at the end. If this check fails, the store has been tampered
...
...
src/windows/classes/sun/security/mscapi/KeyStore.java
浏览文件 @
d088b4be
/*
/*
* Copyright (c) 2005, 201
6
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
9
, 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
...
@@ -45,6 +45,8 @@ import java.util.*;
...
@@ -45,6 +45,8 @@ import java.util.*;
import
sun.security.action.GetPropertyAction
;
import
sun.security.action.GetPropertyAction
;
import
sun.security.util.Debug
;
/**
/**
* Implementation of key store for Windows using the Microsoft Crypto API.
* Implementation of key store for Windows using the Microsoft Crypto API.
*
*
...
@@ -186,6 +188,7 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -186,6 +188,7 @@ abstract class KeyStore extends KeyStoreSpi {
private
static
final
String
KEYSTORE_COMPATIBILITY_MODE_PROP
=
private
static
final
String
KEYSTORE_COMPATIBILITY_MODE_PROP
=
"sun.security.mscapi.keyStoreCompatibilityMode"
;
"sun.security.mscapi.keyStoreCompatibilityMode"
;
private
final
boolean
keyStoreCompatibilityMode
;
private
final
boolean
keyStoreCompatibilityMode
;
private
static
final
Debug
debug
=
Debug
.
getInstance
(
"keystore"
);
/*
/*
* The keystore entries.
* The keystore entries.
...
@@ -728,6 +731,11 @@ abstract class KeyStore extends KeyStoreSpi {
...
@@ -728,6 +731,11 @@ abstract class KeyStore extends KeyStoreSpi {
}
catch
(
KeyStoreException
e
)
{
}
catch
(
KeyStoreException
e
)
{
throw
new
IOException
(
e
);
throw
new
IOException
(
e
);
}
}
if
(
debug
!=
null
)
{
debug
.
println
(
"MSCAPI keystore load: entry count: "
+
entries
.
size
());
}
}
}
/**
/**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录