mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8226307: Curve names should be case-insensitive
Reviewed-by: igerasim, jnimeh, wetmore
This commit is contained in:
parent
66e90a11f9
commit
a7a94701fe
2 changed files with 8 additions and 7 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 2006, 2019, 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
|
||||
|
@ -68,7 +68,7 @@ public class CurveDB {
|
|||
return spec;
|
||||
}
|
||||
|
||||
return nameMap.get(name);
|
||||
return nameMap.get(name.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
// Return EC parameters for the specified field size. If there are known
|
||||
|
@ -151,7 +151,8 @@ public class CurveDB {
|
|||
|
||||
String[] commonNames = nameSplitPattern.split(name);
|
||||
for (String commonName : commonNames) {
|
||||
if (nameMap.put(commonName.trim(), params) != null) {
|
||||
if (nameMap.put(commonName.trim().toLowerCase(Locale.ENGLISH),
|
||||
params) != null) {
|
||||
throw new RuntimeException("Duplication name: " + commonName);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue