Don't round up partitioned premaster secret length if there is only one
authorDr. Stephen Henson <steve@openssl.org>
Tue, 31 May 2011 10:34:43 +0000 (10:34 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Tue, 31 May 2011 10:34:43 +0000 (10:34 +0000)
digest in use: this caused the PRF to fail for an odd premaster secret
length.

ssl/t1_enc.c

index 36128dc..d180bfc 100644 (file)
@@ -265,6 +265,8 @@ static int tls1_PRF(long digest_mask,
                if ((m<<TLS1_PRF_DGST_SHIFT) & digest_mask) count++;
        }       
        len=slen/count;
+       if (count == 1)
+               slen = 0;
        S1=sec;
        memset(out1,0,olen);
        for (idx=0;ssl_get_handshake_digest(idx,&m,&md);idx++) {