Skip to content

Commit f31dead

Browse files
djelinskiwangweij
authored andcommittedDec 21, 2021
8279043: Some Security Exception Messages Miss Spaces
Reviewed-by: weijun
1 parent f730906 commit f31dead

File tree

16 files changed

+21
-21
lines changed

16 files changed

+21
-21
lines changed
 

‎src/java.base/share/classes/com/sun/crypto/provider/GaloisCounterMode.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ public int doFinal(ByteBuffer src, ByteBuffer dst) throws
13041304
// 'len' includes ibuffer data
13051305
checkDataLength(len, tagLenBytes);
13061306
if (dst.remaining() < len + tagLenBytes) {
1307-
throw new ShortBufferException("Output buffer too small, must" +
1307+
throw new ShortBufferException("Output buffer too small, must " +
13081308
"be at least " + (len + tagLenBytes) + " bytes long");
13091309
}
13101310

@@ -1472,7 +1472,7 @@ public int doFinal(byte[] in, int inOfs, int inLen, byte[] out,
14721472
}
14731473

14741474
if (len - tagLenBytes > out.length - outOfs) {
1475-
throw new ShortBufferException("Output buffer too small, must" +
1475+
throw new ShortBufferException("Output buffer too small, must " +
14761476
"be at least " + (len - tagLenBytes) + " bytes long");
14771477
}
14781478

‎src/java.base/share/classes/com/sun/crypto/provider/TlsKeyMaterialGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private SecretKey engineGenerateKey0(byte[] masterSecret) throws GeneralSecurity
213213
if (protocolVersion >= 0x0302) {
214214
// TLS 1.1+
215215
throw new RuntimeException(
216-
"Internal Error: TLS 1.1+ should not be negotiating" +
216+
"Internal Error: TLS 1.1+ should not be negotiating " +
217217
"exportable ciphersuites");
218218
} else if (protocolVersion == 0x0301) {
219219
// TLS 1.0

‎src/java.base/share/classes/javax/crypto/Cipher.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ private static String[] tokenizeTransformation(String transformation)
340340
"format:" + transformation);
341341
}
342342
if ((parts[0] == null) || (parts[0].isEmpty())) {
343-
throw new NoSuchAlgorithmException("Invalid transformation:" +
343+
throw new NoSuchAlgorithmException("Invalid transformation: " +
344344
"algorithm not specified-"
345345
+ transformation);
346346
}

‎src/java.base/share/classes/sun/security/pkcs/PKCS9Attribute.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -481,12 +481,12 @@ public PKCS9Attribute(DerValue derVal) throws IOException {
481481
"attribute not supported.");
482482
// break unnecessary
483483
case 10: // issuerAndserialNumber attribute -- not supported
484-
throw new IOException("PKCS9 IssuerAndSerialNumber" +
484+
throw new IOException("PKCS9 IssuerAndSerialNumber " +
485485
"attribute not supported.");
486486
// break unnecessary
487487
case 11: // RSA DSI proprietary
488488
case 12: // RSA DSI proprietary
489-
throw new IOException("PKCS9 RSA DSI attributes" +
489+
throw new IOException("PKCS9 RSA DSI attributes " +
490490
"11 and 12, not supported.");
491491
// break unnecessary
492492
case 13: // S/MIME unused attribute
@@ -604,12 +604,12 @@ public void derEncode(OutputStream out) throws IOException {
604604
"attribute not supported.");
605605
// break unnecessary
606606
case 10: // issuerAndserialNumber attribute -- not supported
607-
throw new IOException("PKCS9 IssuerAndSerialNumber" +
607+
throw new IOException("PKCS9 IssuerAndSerialNumber " +
608608
"attribute not supported.");
609609
// break unnecessary
610610
case 11: // RSA DSI proprietary
611611
case 12: // RSA DSI proprietary
612-
throw new IOException("PKCS9 RSA DSI attributes" +
612+
throw new IOException("PKCS9 RSA DSI attributes " +
613613
"11 and 12, not supported.");
614614
// break unnecessary
615615
case 13: // S/MIME unused attribute

‎src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ private void setKeyEntry(String alias, Key key,
635635
}
636636
}
637637
} else {
638-
throw new KeyStoreException("Private key is not encoded" +
638+
throw new KeyStoreException("Private key is not encoded " +
639639
"as PKCS#8");
640640
}
641641

‎src/java.base/share/classes/sun/security/rsa/RSAPadding.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public byte[] pad(byte[] data, int ofs, int len)
270270
*/
271271
public byte[] unpad(byte[] padded) throws BadPaddingException {
272272
if (padded.length != paddedSize) {
273-
throw new BadPaddingException("Decryption error." +
273+
throw new BadPaddingException("Decryption error. " +
274274
"The padded array length (" + padded.length +
275275
") is not the specified padded size (" + paddedSize + ")");
276276
}

‎src/java.base/share/classes/sun/security/ssl/CertificateAuthoritiesExtension.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public byte[] produce(ConnectionContext context,
211211
if (encodedCAs.isEmpty()) {
212212
if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
213213
SSLLogger.warning(
214-
"The number of CAs exceeds the maximum size" +
214+
"The number of CAs exceeds the maximum size " +
215215
"of the certificate_authorities extension");
216216
}
217217

‎src/java.base/share/classes/sun/security/util/DisabledAlgorithmConstraints.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ public boolean permits(Key key) {
451451
for (Constraint constraint : list) {
452452
if (!constraint.permits(key)) {
453453
if (debug != null) {
454-
debug.println("Constraints: failed key size" +
454+
debug.println("Constraints: failed key size " +
455455
"constraint check " + KeyUtil.getKeySize(key));
456456
}
457457
return false;

‎src/java.base/share/classes/sun/security/x509/PolicyConstraintsExtension.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,15 +154,15 @@ public PolicyConstraintsExtension(Boolean critical, Object value)
154154

155155
if (next.isContextSpecific(TAG_REQUIRE) && !next.isConstructed()) {
156156
if (this.require != -1)
157-
throw new IOException("Duplicate requireExplicitPolicy" +
157+
throw new IOException("Duplicate requireExplicitPolicy " +
158158
"found in the PolicyConstraintsExtension");
159159
next.resetTag(DerValue.tag_Integer);
160160
this.require = next.getInteger();
161161

162162
} else if (next.isContextSpecific(TAG_INHIBIT) &&
163163
!next.isConstructed()) {
164164
if (this.inhibit != -1)
165-
throw new IOException("Duplicate inhibitPolicyMapping" +
165+
throw new IOException("Duplicate inhibitPolicyMapping " +
166166
"found in the PolicyConstraintsExtension");
167167
next.resetTag(DerValue.tag_Integer);
168168
this.inhibit = next.getInteger();

‎src/java.base/share/classes/sun/security/x509/PolicyInformation.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public void set(String name, Object obj) throws IOException {
202202
if (obj instanceof Set) {
203203
for (Object obj1 : (Set<?>) obj) {
204204
if (!(obj1 instanceof PolicyQualifierInfo)) {
205-
throw new IOException("Attribute value must be a" +
205+
throw new IOException("Attribute value must be a " +
206206
"Set of PolicyQualifierInfo objects.");
207207
}
208208
}

‎src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5MechFactory.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public static void checkInitCredPermission(Krb5NameElement name) {
154154
sm.checkPermission(perm);
155155
} catch (SecurityException e) {
156156
if (DEBUG) {
157-
System.out.println("Permission to initiate" +
157+
System.out.println("Permission to initiate " +
158158
"kerberos init credential" + e.getMessage());
159159
}
160160
throw e;

‎test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMBufferTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ void test() throws Exception {
258258
// If incrementalSegments is enabled, run through that test only
259259
if (incremental) {
260260
if (ops.size() < 2) {
261-
throw new Exception("To do incrementalSegments you must" +
261+
throw new Exception("To do incrementalSegments you must " +
262262
"have more that 1 dtype in the list");
263263
}
264264
sizes = new int[ops.size()];

‎test/jdk/com/sun/crypto/provider/Cipher/AEAD/GCMShortBuffer.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class GCMShortBuffer {
5757
int r = c.doFinal(cipherText, 1, len, pt, 0);
5858
if (r != pt.length) {
5959
System.out.println(
60-
"doFinal() return ( " + r + ") is not the same" +
60+
"doFinal() return ( " + r + ") is not the same " +
6161
"as getOutputSize returned" + pt.length);
6262
error = true;
6363
}

‎test/jdk/sun/security/provider/PolicyParser/PrincipalExpansionError.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public static void main(String[] args) {
110110
("PrincipalExpansionError test failed (file not found)");
111111
java.io.FileNotFoundException fnfe =
112112
(java.io.FileNotFoundException)e;
113-
throw new SecurityException("PrincipalExpansionError" +
113+
throw new SecurityException("PrincipalExpansionError " +
114114
"test failed (file not found)");
115115
} else {
116116
// i don't know???

‎test/jdk/sun/security/ssl/X509TrustManagerImpl/CacertsLimit.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ private static void checkLimit(
6969
throw new Exception(
7070
"There are too many trusted CAs in cacerts. The " +
7171
"certificate_authorities extension cannot be used " +
72-
"for TLS connections. Please rethink about the size" +
72+
"for TLS connections. Please rethink about the size " +
7373
"of the cacerts, or have a release note for the " +
7474
"impacted behaviors");
7575
} else if (sizeAccount > 0x4000) {

‎test/jdk/sun/security/tools/keytool/fakegen/jdk.crypto.ec/sun/security/ec/ECKeyPairGenerator.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public KeyPair generateKeyPair() {
7171
break;
7272
default:
7373
throw new AssertionError("SunEC ECKeyPairGenerator" +
74-
"has been patched. Key size " + keySize +
74+
" has been patched. Key size " + keySize +
7575
" is not supported");
7676
}
7777
ECParameterSpec ecParams = ECUtil.getECParameterSpec(null, keySize);

0 commit comments

Comments
 (0)
Please sign in to comment.