Skip to content

Commit add3c80

Browse files
committed
Strip whitespace from license key before verification
1 parent 137dccf commit add3c80

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

domain/src/main/java/org/cryptomator/domain/usecases/DoLicenseCheck.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import com.auth0.jwt.exceptions.SignatureVerificationException;
77
import com.auth0.jwt.interfaces.DecodedJWT;
88
import com.auth0.jwt.interfaces.JWTVerifier;
9+
import com.google.common.base.CharMatcher;
910
import com.google.common.io.BaseEncoding;
1011

1112
import org.cryptomator.domain.exception.BackendException;
@@ -45,6 +46,7 @@ public class DoLicenseCheck {
4546

4647
public LicenseCheck execute() throws BackendException {
4748
license = useLicenseOrRetrieveFromDb(license);
49+
license = CharMatcher.whitespace().removeFrom(license);
4850
try {
4951
Algorithm algorithm = Algorithm.ECDSA512(getPublicKey(ANDROID_PUB_KEY), null);
5052
JWTVerifier verifier = JWT.require(algorithm).build();

0 commit comments

Comments
 (0)