mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
8208602: Cannot read PEM X.509 cert if there is whitespace after the header or footer
Reviewed-by: xuelei
This commit is contained in:
parent
d4381002ac
commit
b9bfd45c73
2 changed files with 16 additions and 8 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1998, 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
|
||||
|
@ -635,7 +635,8 @@ public class X509Factory extends CertificateFactorySpi {
|
|||
if (next != '\r') footer.append((char)next);
|
||||
}
|
||||
|
||||
checkHeaderFooter(header.toString(), footer.toString());
|
||||
checkHeaderFooter(header.toString().stripTrailing(),
|
||||
footer.toString().stripTrailing());
|
||||
|
||||
try {
|
||||
return Base64.getDecoder().decode(data.toByteArray());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue