Firma TLS 1.2 ECDHE_RSA

Actualmente estoy trabajando en un servidor Java TLS. Estoy tratando de que funcione el siguiente CipherSuite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA

Cuando lo pruebo usando openssl s_client, aparece el siguiente error después del mensaje ServerKeyExchange:

140735242416208: error: 1414D172: rutinas SSL: tls12_check_peer_sigalg: tipo de firma incorrecto: t1_lib.c: 1130:

Aquí está el mensaje TLS como se ve en Wireshark

El apretón de manos falla en un error fatal decode_error.

Así que supongo que al cliente no le gusta el algoritmo de firma elegido.

Pero solo estoy usando el SignatureAndHashAlgorithm predeterminado por ahora segúnRFC 5246 Sección-7.4.1.4.1

Si el algoritmo de intercambio de claves negociado es uno de (RSA, DHE_RSA, DH_RSA, RSA_PSK, ECDH_RSA, ECDHE_RSA), compórtese como si el cliente hubiera enviado el valor {sha1, rsa}.

(Todavía estoy comprobando si el cliente ofrece estos valores predeterminados)

Como estoy haciendo ECDHE_RSA, creo que debería hacer hash y firmar el servidor ECDHparams según RFC 4492 Sección 5.4 (Primera publicación aquí, así que solo 2 enlaces lo siento :))

ServerKeyExchange.signed_params.sha_hash
        SHA(ClientHello.random + ServerHello.random +
                                          ServerKeyExchange.params);
struct {
    select (KeyExchangeAlgorithm) {
        case ec_diffie_hellman:
            ServerECDHParams params;
            Signature signed_params;
    };
} ServerKeyExchange;

Y debería hacer esto según RFC 2246 Sección 7.4.3

select (SignatureAlgorithm) {   
    case rsa:
        digitally-signed struct {
            opaque md5_hash[16];
            opaque sha_hash[20];
        };
} Signature;


md5_hash
MD5(ClientHello.random + ServerHello.random + ServerParams);

sha_hash
SHA(ClientHello.random + ServerHello.random + ServerParams);

Mi código Java con respecto a la firma de los parámetros del servidor:

private byte[] getSignedParams(ChannelBuffer params)
        throws NoSuchAlgorithmException, DigestException, 
        SignatureException, InvalidKeyException {
    byte[] signedParams = null;
    ChannelBuffer signAlg = ChannelBuffers.buffer(2);
    MessageDigest md5 = MessageDigest.getInstance("MD5");
    MessageDigest sha = MessageDigest.getInstance("SHA-1");
    switch (session.cipherSuite.sign) {
        case rsa:
            signAlg.writeByte(2); // 2 for SHA1
            sha.update(clientRandom);
            sha.update(serverRandom);
            sha.update(params.toByteBuffer());
            md5.update(clientRandom);
            md5.update(serverRandom);
            md5.update(params.toByteBuffer());
            signedParams = concat(md5.digest(), sha.digest());
        break;
    }
    signAlg.writeByte(session.cipherSuite.sign.value); // for RSA he byte is one
    ChannelBuffer signLength = ChannelBuffers.buffer(2);
    signLength.writeShort(signedParams.length);
    return concat(signAlg.array(),concat(signLength.array(),signedParams));
}

Entonces mi pregunta es básicamente: ¿Estoy equivocado acerca de todo esto? y si es así, ¿qué estoy haciendo mal?

Gracias por tu tiempo ! :)