@Test
public void testZeroSaltLength() throws Exception {

  if (TestUtil.isTsan()) {
    // This test times out when running under thread sanitizer, so we just skip.
    return;
  }
  int keySize = 2048;
  KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA");
  keyGen.initialize(keySize);
  KeyPair keyPair = keyGen.generateKeyPair();
  RSAPublicKey pub = (RSAPublicKey) keyPair.getPublic();
  RSAPrivateCrtKey priv = (RSAPrivateCrtKey) keyPair.getPrivate();
  // Sign with RsaSsaPssSignJce.
  byte[] message = "Hello".getBytes(UTF_8);
  RsaSsaPssSignJce signer = new RsaSsaPssSignJce(priv, HashType.SHA256, HashType.SHA256, 0);
  byte[] signature = signer.sign(message);
  // Verify with JCE's Signature.
  RsaSsaPssVerifyJce verifier = new RsaSsaPssVerifyJce(pub, HashType.SHA256, HashType.SHA256, 0);
  try {
    verifier.verify(signature, message);
  } catch (GeneralSecurityException e) {
    throw new AssertionError("Valid signature, shouldn't throw exception", e);
  }
}