am ef6e14e8: SSLEngine: Verify server RSA params signature
* commit 'ef6e14e8527eab91e6266942f48b8bf08e762004':
SSLEngine: Verify server RSA params signature
diff --git a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java
index 128787b..732457b 100644
--- a/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java
+++ b/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/ClientHandshakeImpl.java
@@ -415,6 +415,16 @@
try {
c = Cipher.getInstance("RSA/ECB/PKCS1Padding");
if (serverKeyExchange != null) {
+ if (!session.cipherSuite.isAnonymous()) {
+ DigitalSignature ds = new DigitalSignature(serverCert.getAuthType());
+ ds.init(serverCert.certs[0]);
+ ds.update(clientHello.getRandom());
+ ds.update(serverHello.getRandom());
+ if (!serverKeyExchange.verifySignature(ds)) {
+ fatalAlert(AlertProtocol.DECRYPT_ERROR, "Cannot verify RSA params");
+ return;
+ }
+ }
c.init(Cipher.WRAP_MODE, serverKeyExchange
.getRSAPublicKey());
} else {