We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 196569e commit 782cc3bCopy full SHA for 782cc3b
pg/src/main/java/org/bouncycastle/openpgp/api/OpenPGPKeyGenerator.java
@@ -380,9 +380,13 @@ public WithPrimaryKey addUserId(
380
throws PGPException
381
{
382
// care - needs to run with Java 5.
383
- if (userId == null || userId.trim().length() == 0)
+ if (userId == null)
384
385
- throw new IllegalArgumentException("User-ID cannot be null or empty.");
+ throw new IllegalArgumentException("User-ID cannot be null.");
386
+ }
387
+ if (userId.contains("\n") || userId.contains("\r"))
388
+ {
389
+ throw new IllegalArgumentException("User-ID cannot contain newlines and/or carriage returns.");
390
}
391
392
SignatureParameters parameters = Utils.applySignatureParameters(signatureParameters,
0 commit comments