am 9c94365f: am 3a160bcf: am 7f1b2d5d: am 6da3c4a6: am ef6e14e8: SSLEngine: Verify server RSA params signature
* commit '9c94365f8732636914f934163287907a3576413f':
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 839237b..5d2521b 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
@@ -416,6 +416,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 {