cherry-pick 4821395c06b0786e19b1a3153be65f39a2a524d9: Ensured SignatureAlgorithm `PS256`, `PS384`, and `PS512` worked properly on JDK 11 and later without requiring BouncyCastle. (#555)

This commit is contained in:
Les Hazlewood 2020-02-04 00:10:39 -08:00 committed by GitHub
parent 9481f317e1
commit 950e6fbcc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 364 additions and 16 deletions

View File

@ -58,6 +58,16 @@ compile 'io.jsonwebtoken:jjwt-jackson:0.11.0:deprecated'
**Note:** that the first option is recommended since the second option will not be available starting with the 1.0 release.
### 0.10.8
This patch release:
* Ensures that SignatureAlgorithms `PS256`, `PS384`, and `PS512` work properly on JDK 11 and later without the need
for BouncyCastle. Previous releases referenced a BouncyCastle-specific
algorithm name instead of the Java Security Standard Algorithm Name of
[`RSASSA-PSS`](https://docs.oracle.com/en/java/javase/11/docs/specs/security/standard-names.html#signature-algorithms).
This release ensures the standard name is used moving forward.
### 0.10.7
This patch release:

View File

@ -88,25 +88,25 @@ public enum SignatureAlgorithm {
ES512("ES512", "ECDSA using P-521 and SHA-512", "ECDSA", "SHA512withECDSA", true, 512, 521),
/**
* JWA algorithm name for {@code RSASSA-PSS using SHA-256 and MGF1 with SHA-256}. <b>This is not a JDK standard
* algorithm and requires that a JCA provider like BouncyCastle be in the runtime classpath.</b> BouncyCastle
* will be used automatically if found in the runtime classpath.
* JWA algorithm name for {@code RSASSA-PSS using SHA-256 and MGF1 with SHA-256}. <b>This algorithm requires
* Java 11 or later or a JCA provider like BouncyCastle to be in the runtime classpath.</b> If on Java 10 or
* earlier, BouncyCastle will be used automatically if found in the runtime classpath.
*/
PS256("PS256", "RSASSA-PSS using SHA-256 and MGF1 with SHA-256", "RSA", "SHA256withRSAandMGF1", false, 256, 2048),
PS256("PS256", "RSASSA-PSS using SHA-256 and MGF1 with SHA-256", "RSA", "RSASSA-PSS", false, 256, 2048),
/**
* JWA algorithm name for {@code RSASSA-PSS using SHA-384 and MGF1 with SHA-384}. <b>This is not a JDK standard
* algorithm and requires that a JCA provider like BouncyCastle be in the runtime classpath.</b> BouncyCastle
* will be used automatically if found in the runtime classpath.
* JWA algorithm name for {@code RSASSA-PSS using SHA-384 and MGF1 with SHA-384}. <b>This algorithm requires
* Java 11 or later or a JCA provider like BouncyCastle to be in the runtime classpath.</b> If on Java 10 or
* earlier, BouncyCastle will be used automatically if found in the runtime classpath.
*/
PS384("PS384", "RSASSA-PSS using SHA-384 and MGF1 with SHA-384", "RSA", "SHA384withRSAandMGF1", false, 384, 2048),
PS384("PS384", "RSASSA-PSS using SHA-384 and MGF1 with SHA-384", "RSA", "RSASSA-PSS", false, 384, 2048),
/**
* JWA algorithm name for {@code RSASSA-PSS using SHA-512 and MGF1 with SHA-512}. <b>This is not a JDK standard
* algorithm and requires that a JCA provider like BouncyCastle be in the classpath.</b> BouncyCastle will be used
* automatically if found in the runtime classpath.
* JWA algorithm name for {@code RSASSA-PSS using SHA-512 and MGF1 with SHA-512}. <b>This algorithm requires
* Java 11 or later or a JCA provider like BouncyCastle to be in the runtime classpath.</b> If on Java 10 or
* earlier, BouncyCastle will be used automatically if found in the runtime classpath.
*/
PS512("PS512", "RSASSA-PSS using SHA-512 and MGF1 with SHA-512", "RSA", "SHA512withRSAandMGF1", false, 512, 2048);
PS512("PS512", "RSASSA-PSS using SHA-512 and MGF1 with SHA-512", "RSA", "RSASSA-PSS", false, 512, 2048);
//purposefully ordered higher to lower:
private static final List<SignatureAlgorithm> PREFERRED_HMAC_ALGS = Collections.unmodifiableList(Arrays.asList(

View File

@ -44,6 +44,11 @@
<artifactId>bcprov-jdk15on</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>

View File

@ -0,0 +1,95 @@
package io.jsonwebtoken.impl.crypto
import io.jsonwebtoken.Jwts
import io.jsonwebtoken.SignatureAlgorithm
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo
import org.bouncycastle.cert.X509CertificateHolder
import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter
import org.bouncycastle.openssl.PEMParser
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter
import org.junit.Test
import java.nio.charset.StandardCharsets
import java.security.PrivateKey
import java.security.PublicKey
/**
* Asserts backwards-compatibility for 0.10.8 and later per https://github.com/jwtk/jjwt/issues/542
*/
class Issue542Test {
/**
* The following 3 strings were generated using the 0.10.7 implementation by calling this
* class's `main` method below.
*
* DO NOT UPDATE THESE VALUES. THEIR EXACT VALUES IS WHAT GUARANTEES BACKWARDS-COMPATIBILITY.
*
* Changing the values could reflect newer implementation behavior which defeats the entire purpose of the test :)
*/
private static String PS256_0_10_7 = 'eyJhbGciOiJQUzI1NiJ9.eyJpc3MiOiJqb2UifQ.kvOr6hW_Bg6AjH8wmJd7C6S6xow1UaL3xIRrsxrZIgNYN912mHU_-QX_vggaQLLYZLZMWSuqqY_byFgiJ6c0814uf4PhzlkUL6P4FAqKvRMuazN0FMxK-oSt37jKzbLLfLQ2aNZ6jOMoUGn1zreITcm4oVYoZs1c4p8d-OMXjvzwO2rPTSyqrzvrmFF-ufh0gAAA9W8aDeFNPIcm66BC_RK9nhSfJaBdFGzN1dgZKRx8S5DwKurlJkfG6uESGG4pvhlQRtn8dmY_1HHsvKIBQD02zy1KyB3EYXJRtVSIUWY0lhhe7-AoE2TwfYQRaS38ReIhGLFzUIjUDYbxlBljeg'
private static String PS384_0_10_7 = 'eyJhbGciOiJQUzM4NCJ9.eyJpc3MiOiJqb2UifQ.mlPowjRz0cP5J-MmCoegKHYagOHZ_ArXOR91_u8jMdwmOfdfEQIcC6K5hAgQGSZQC_pQDA51RUoUHatsQgXtHlSDC_VP9ZxcPkOptWScOUMXriLH31bTcrg0YhlYL-A7TTHLMhbUrOCKqjpWjU-GxcnOkM86e0joZgJUL7CpHUtyCFRrxOXtuT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V7k'
private static Map<SignatureAlgorithm, String> JWS_0_10_7_VALUES = [
(SignatureAlgorithm.PS256): PS256_0_10_7,
(SignatureAlgorithm.PS384): PS384_0_10_7,
(SignatureAlgorithm.PS512): PS512_0_10_7
]
private static JcaX509CertificateConverter X509_CERT_CONVERTER = new JcaX509CertificateConverter()
private static JcaPEMKeyConverter PEM_KEY_CONVERTER = new JcaPEMKeyConverter()
private static PEMParser getParser(String filename) {
InputStream is = Issue542Test.class.getResourceAsStream(filename)
return new PEMParser(new BufferedReader(new InputStreamReader(is, StandardCharsets.ISO_8859_1)))
}
private static PublicKey readTestPublicKey(SignatureAlgorithm alg) {
PEMParser parser = getParser(alg.name() + '.crt.pem')
X509CertificateHolder holder = parser.readObject() as X509CertificateHolder
try {
return X509_CERT_CONVERTER.getCertificate(holder).getPublicKey()
} finally {
parser.close()
}
}
private static PrivateKey readTestPrivateKey(SignatureAlgorithm alg) {
PEMParser parser = getParser(alg.name() + '.key.pem')
PrivateKeyInfo info = parser.readObject() as PrivateKeyInfo
try {
return PEM_KEY_CONVERTER.getPrivateKey(info)
} finally {
parser.close()
}
}
/**
* Asserts backwards-compatibility for https://github.com/jwtk/jjwt/issues/542
*/
@Test
void testRsaSsaPssBackwardsCompatibility() {
def algs = [SignatureAlgorithm.PS256, SignatureAlgorithm.PS384, SignatureAlgorithm.PS512]
for (alg in algs) {
PublicKey key = readTestPublicKey(alg)
String jws = JWS_0_10_7_VALUES[alg]
def token = Jwts.parser().setSigningKey(key).parseClaimsJws(jws)
assert 'joe' == token.body.getIssuer()
}
}
/**
* Used to generate 0.10.7 strings. DO NOT call this method and replace the values at the top of this
* class. This method implementation was retained only to demonstrate how they were created for future reference.
*/
static void main(String[] args) {
def algs = [SignatureAlgorithm.PS256, SignatureAlgorithm.PS384, SignatureAlgorithm.PS512]
for (alg in algs) {
PrivateKey privateKey = readTestPrivateKey(alg)
String jws = Jwts.builder().setIssuer('joe').signWith(privateKey, alg).compact()
println "private static String ${alg.name()}_0_10_7 = '$jws'"
}
}
}

View File

@ -0,0 +1 @@
rsa2048.crt.pem

View File

@ -0,0 +1 @@
rsa2048.key.pem

View File

@ -0,0 +1 @@
rsa3072.crt.pem

View File

@ -0,0 +1 @@
rsa3072.key.pem

View File

@ -0,0 +1 @@
rsa4096.crt.pem

View File

@ -0,0 +1 @@
rsa4096.key.pem

View File

@ -0,0 +1,14 @@
The `*.key.pem` and `*.crt.pem` files in this directory were created for testing as follows:
openssl req -x509 -newkey rsa:2048 -keyout rsa2048.key.pem -out rsa2048.crt.pem -days 365250 -nodes -subj '/C=US/ST=California/L=San Francisco/O=jsonwebtoken.io/OU=jjwt'
openssl req -x509 -newkey rsa:3072 -keyout rsa3072.key.pem -out rsa3072.crt.pem -days 365250 -nodes -subj '/C=US/ST=California/L=San Francisco/O=jsonwebtoken.io/OU=jjwt'
openssl req -x509 -newkey rsa:4096 -keyout rsa4096.key.pem -out rsa4096.crt.pem -days 365250 -nodes -subj '/C=US/ST=California/L=San Francisco/O=jsonwebtoken.io/OU=jjwt'
The only difference is the key size and file names using sizes of `2048`, `3072`, and `4096`.
Each command creates a (non-password-protected) private key and a self-signed certificate for the associated key size,
valid for 1000 years. These files are intended for testing purposes only and shouldn't be used in a production system.
Finally, the `RS*` and `PS*` files in this directory are just are symlinks back to these files based on the JWT alg
names and their respective key sizes. This enables easy file lookup based on the `SignatureAlgorithm` `name()` value
when authoring tests.

View File

@ -0,0 +1 @@
rsa2048.crt.pem

View File

@ -0,0 +1 @@
rsa2048.key.pem

View File

@ -0,0 +1 @@
rsa3072.crt.pem

View File

@ -0,0 +1 @@
rsa3072.key.pem

View File

@ -0,0 +1 @@
rsa4096.crt.pem

View File

@ -0,0 +1 @@
rsa4096.key.pem

View File

@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDRDCCAiwCCQCgd9OzR40NCDANBgkqhkiG9w0BAQsFADBjMQswCQYDVQQGEwJV
UzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UE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zPWXH86XVonqnjQgu3SDkclPbkjg4HVj
athb6h5RN5bYx1cbUvo3JssBYl92FlXPU9lLzgv4nALUdVSi8PjbjQ7WXdxaKPdf
lczRTJNTE/KNUE0pkC5P4c/e0A1OFu0=
-----END PRIVATE KEY-----

22
pom.xml
View File

@ -89,7 +89,9 @@
<jjwt.previousVersion>0.10.7</jjwt.previousVersion>
<maven.jar.version>3.0.2</maven.jar.version>
<maven.compiler.version>3.6.1</maven.compiler.version>
<maven.compiler.version>3.8.0</maven.compiler.version>
<maven.javadoc.version>3.1.1</maven.javadoc.version>
<gmavenplus.version>1.6.1</gmavenplus.version>
<jdk.version>1.7</jdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@ -103,7 +105,7 @@
<bouncycastle.version>1.60</bouncycastle.version>
<!-- Test Dependencies: Only required for testing when building. Not required by users at runtime: -->
<groovy.version>2.5.8</groovy.version>
<groovy.version>2.5.9</groovy.version>
<logback.version>1.2.3</logback.version>
<easymock.version>3.6</easymock.version>
<junit.version>4.12</junit.version>
@ -167,6 +169,12 @@
<version>${bouncycastle.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>${bouncycastle.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
@ -373,7 +381,7 @@
<plugin>
<groupId>org.codehaus.gmavenplus</groupId>
<artifactId>gmavenplus-plugin</artifactId>
<version>1.6.1</version>
<version>${gmavenplus.version}</version>
<executions>
<execution>
<goals>
@ -521,6 +529,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>
@ -529,6 +538,9 @@
</goals>
</execution>
</executions>
<configuration>
<failOnError>false</failOnError>
</configuration>
<dependencies>
<!-- Workaround for Java 9 -->
<dependency>
@ -549,6 +561,9 @@
<properties>
<!-- Turn off JDK >= 8's lint checks: -->
<additionalparam>-Xdoclint:none</additionalparam>
<gmavenplus.version>1.8.1</gmavenplus.version>
<easymock.version>4.2</easymock.version>
<powermock.version>2.0.2</powermock.version>
</properties>
</profile>
<profile>
@ -602,6 +617,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.version}</version>
<executions>
<execution>
<id>attach-javadocs</id>