提交 9b75bf32 编写于 作者: I igerasim

8146725: Issues with SignatureAndHashAlgorithm.getSupportedAlgorithms

Reviewed-by: weijun, wetmore
上级 c963df82
/* /*
* Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2010, 2016, 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
...@@ -152,13 +152,11 @@ final class SignatureAndHashAlgorithm { ...@@ -152,13 +152,11 @@ final class SignatureAndHashAlgorithm {
getSupportedAlgorithms(AlgorithmConstraints constraints) { getSupportedAlgorithms(AlgorithmConstraints constraints) {
Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>(); Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>();
synchronized (priorityMap) { for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) {
for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) { if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM &&
if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && constraints.permits(SIGNATURE_PRIMITIVE_SET,
constraints.permits(SIGNATURE_PRIMITIVE_SET, sigAlg.algorithm, null)) {
sigAlg.algorithm, null)) { supported.add(sigAlg);
supported.add(sigAlg);
}
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册