8279043: Some Security Exception Messages Miss Spaces

Reviewed-by: weijun
This commit is contained in:
Daniel Jelinski 2021-12-21 18:24:31 +00:00 committed by Weijun Wang
parent f7309060de
commit f31dead6c5
16 changed files with 21 additions and 21 deletions

View File

@ -1304,7 +1304,7 @@ abstract class GaloisCounterMode extends CipherSpi {
// 'len' includes ibuffer data
checkDataLength(len, tagLenBytes);
if (dst.remaining() < len + tagLenBytes) {
throw new ShortBufferException("Output buffer too small, must" +
throw new ShortBufferException("Output buffer too small, must " +
"be at least " + (len + tagLenBytes) + " bytes long");
}
@ -1472,7 +1472,7 @@ abstract class GaloisCounterMode extends CipherSpi {
}
if (len - tagLenBytes > out.length - outOfs) {
throw new ShortBufferException("Output buffer too small, must" +
throw new ShortBufferException("Output buffer too small, must " +
"be at least " + (len - tagLenBytes) + " bytes long");
}

View File

@ -213,7 +213,7 @@ public final class TlsKeyMaterialGenerator extends KeyGeneratorSpi {
if (protocolVersion >= 0x0302) {
// TLS 1.1+
throw new RuntimeException(
"Internal Error: TLS 1.1+ should not be negotiating" +
"Internal Error: TLS 1.1+ should not be negotiating " +
"exportable ciphersuites");
} else if (protocolVersion == 0x0301) {
// TLS 1.0

View File

@ -340,7 +340,7 @@ public class Cipher {
"format:" + transformation);
}
if ((parts[0] == null) || (parts[0].isEmpty())) {
throw new NoSuchAlgorithmException("Invalid transformation:" +
throw new NoSuchAlgorithmException("Invalid transformation: " +
"algorithm not specified-"
+ transformation);
}

View File

@ -481,12 +481,12 @@ public class PKCS9Attribute implements DerEncoder {
"attribute not supported.");
// break unnecessary
case 10: // issuerAndserialNumber attribute -- not supported
throw new IOException("PKCS9 IssuerAndSerialNumber" +
throw new IOException("PKCS9 IssuerAndSerialNumber " +
"attribute not supported.");
// break unnecessary
case 11: // RSA DSI proprietary
case 12: // RSA DSI proprietary
throw new IOException("PKCS9 RSA DSI attributes" +
throw new IOException("PKCS9 RSA DSI attributes " +
"11 and 12, not supported.");
// break unnecessary
case 13: // S/MIME unused attribute
@ -604,12 +604,12 @@ public class PKCS9Attribute implements DerEncoder {
"attribute not supported.");
// break unnecessary
case 10: // issuerAndserialNumber attribute -- not supported
throw new IOException("PKCS9 IssuerAndSerialNumber" +
throw new IOException("PKCS9 IssuerAndSerialNumber " +
"attribute not supported.");
// break unnecessary
case 11: // RSA DSI proprietary
case 12: // RSA DSI proprietary
throw new IOException("PKCS9 RSA DSI attributes" +
throw new IOException("PKCS9 RSA DSI attributes " +
"11 and 12, not supported.");
// break unnecessary
case 13: // S/MIME unused attribute

View File

@ -635,7 +635,7 @@ public final class PKCS12KeyStore extends KeyStoreSpi {
}
}
} else {
throw new KeyStoreException("Private key is not encoded" +
throw new KeyStoreException("Private key is not encoded " +
"as PKCS#8");
}

View File

@ -270,7 +270,7 @@ public final class RSAPadding {
*/
public byte[] unpad(byte[] padded) throws BadPaddingException {
if (padded.length != paddedSize) {
throw new BadPaddingException("Decryption error." +
throw new BadPaddingException("Decryption error. " +
"The padded array length (" + padded.length +
") is not the specified padded size (" + paddedSize + ")");
}

View File

@ -211,7 +211,7 @@ final class CertificateAuthoritiesExtension {
if (encodedCAs.isEmpty()) {
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
SSLLogger.warning(
"The number of CAs exceeds the maximum size" +
"The number of CAs exceeds the maximum size " +
"of the certificate_authorities extension");
}

View File

@ -451,7 +451,7 @@ public class DisabledAlgorithmConstraints extends AbstractAlgorithmConstraints {
for (Constraint constraint : list) {
if (!constraint.permits(key)) {
if (debug != null) {
debug.println("Constraints: failed key size" +
debug.println("Constraints: failed key size " +
"constraint check " + KeyUtil.getKeySize(key));
}
return false;

View File

@ -154,7 +154,7 @@ implements CertAttrSet<String> {
if (next.isContextSpecific(TAG_REQUIRE) && !next.isConstructed()) {
if (this.require != -1)
throw new IOException("Duplicate requireExplicitPolicy" +
throw new IOException("Duplicate requireExplicitPolicy " +
"found in the PolicyConstraintsExtension");
next.resetTag(DerValue.tag_Integer);
this.require = next.getInteger();
@ -162,7 +162,7 @@ implements CertAttrSet<String> {
} else if (next.isContextSpecific(TAG_INHIBIT) &&
!next.isConstructed()) {
if (this.inhibit != -1)
throw new IOException("Duplicate inhibitPolicyMapping" +
throw new IOException("Duplicate inhibitPolicyMapping " +
"found in the PolicyConstraintsExtension");
next.resetTag(DerValue.tag_Integer);
this.inhibit = next.getInteger();

View File

@ -202,7 +202,7 @@ public class PolicyInformation {
if (obj instanceof Set) {
for (Object obj1 : (Set<?>) obj) {
if (!(obj1 instanceof PolicyQualifierInfo)) {
throw new IOException("Attribute value must be a" +
throw new IOException("Attribute value must be a " +
"Set of PolicyQualifierInfo objects.");
}
}

View File

@ -154,7 +154,7 @@ public final class Krb5MechFactory implements MechanismFactory {
sm.checkPermission(perm);
} catch (SecurityException e) {
if (DEBUG) {
System.out.println("Permission to initiate" +
System.out.println("Permission to initiate " +
"kerberos init credential" + e.getMessage());
}
throw e;

View File

@ -258,7 +258,7 @@ public class GCMBufferTest implements Cloneable {
// If incrementalSegments is enabled, run through that test only
if (incremental) {
if (ops.size() < 2) {
throw new Exception("To do incrementalSegments you must" +
throw new Exception("To do incrementalSegments you must " +
"have more that 1 dtype in the list");
}
sizes = new int[ops.size()];

View File

@ -57,7 +57,7 @@ public class GCMShortBuffer {
int r = c.doFinal(cipherText, 1, len, pt, 0);
if (r != pt.length) {
System.out.println(
"doFinal() return ( " + r + ") is not the same" +
"doFinal() return ( " + r + ") is not the same " +
"as getOutputSize returned" + pt.length);
error = true;
}

View File

@ -110,7 +110,7 @@ public class PrincipalExpansionError {
("PrincipalExpansionError test failed (file not found)");
java.io.FileNotFoundException fnfe =
(java.io.FileNotFoundException)e;
throw new SecurityException("PrincipalExpansionError" +
throw new SecurityException("PrincipalExpansionError " +
"test failed (file not found)");
} else {
// i don't know???

View File

@ -69,7 +69,7 @@ public class CacertsLimit {
throw new Exception(
"There are too many trusted CAs in cacerts. The " +
"certificate_authorities extension cannot be used " +
"for TLS connections. Please rethink about the size" +
"for TLS connections. Please rethink about the size " +
"of the cacerts, or have a release note for the " +
"impacted behaviors");
} else if (sizeAccount > 0x4000) {

View File

@ -71,7 +71,7 @@ public final class ECKeyPairGenerator extends KeyPairGeneratorSpi {
break;
default:
throw new AssertionError("SunEC ECKeyPairGenerator" +
"has been patched. Key size " + keySize +
" has been patched. Key size " + keySize +
" is not supported");
}
ECParameterSpec ecParams = ECUtil.getECParameterSpec(null, keySize);