From 658aff501c64d2403b3846d62f3036268b4d7b2c Mon Sep 17 00:00:00 2001 From: OllisGit <24205767+OllisGit@users.noreply.github.com> Date: Thu, 17 Jun 2021 08:54:27 +0200 Subject: [PATCH] Assert Error-Messages already includes dashes When the cert-content is not valid, the assert output message is not correct. Because it outputs too many dashes .The const X509- and PKCS8-PEM_HEADER already includes the dashes. I took the output message via copy and paste, but it was still not valid ;-( Only the output is affected, the checks itself is correct. --- .../springframework/security/converter/RsaKeyConverters.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/springframework/security/converter/RsaKeyConverters.java b/core/src/main/java/org/springframework/security/converter/RsaKeyConverters.java index 94cd0e2bed..eb4dca3605 100644 --- a/core/src/main/java/org/springframework/security/converter/RsaKeyConverters.java +++ b/core/src/main/java/org/springframework/security/converter/RsaKeyConverters.java @@ -83,8 +83,8 @@ public final class RsaKeyConverters { return (source) -> { List lines = readAllLines(source); Assert.isTrue(!lines.isEmpty() && lines.get(0).startsWith(PKCS8_PEM_HEADER), - "Key is not in PEM-encoded PKCS#8 format, please check that the header begins with -----" - + PKCS8_PEM_HEADER + "-----"); + "Key is not in PEM-encoded PKCS#8 format, please check that the header begins with " + + PKCS8_PEM_HEADER); StringBuilder base64Encoded = new StringBuilder(); for (String line : lines) { if (RsaKeyConverters.isNotPkcs8Wrapper(line)) {