~ubuntu-branches/ubuntu/gutsy/openssl/gutsy-security

« back to all changes in this revision

Viewing changes to ssl/s3_srvr.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2007-03-10 17:11:46 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20070310171146-ekahy2avht7qdc4f
Tags: 0.9.8e-4
openssl should depend on libssl0.9.8 0.9.8e-1 since it 
uses some of the defines that changed to functions.
Other things build against libssl or libcrypto shouldn't 
have this problem since they use the old headers.
(Closes: #414283)

Show diffs side-by-side

added added

removed removed

Lines of Context:
300
300
 
301
301
                case SSL3_ST_SW_CERT_A:
302
302
                case SSL3_ST_SW_CERT_B:
303
 
                        /* Check if it is anon DH or anon ECDH */
304
 
                        if (!(s->s3->tmp.new_cipher->algorithms & SSL_aNULL))
 
303
                        /* Check if it is anon DH or anon ECDH or KRB5 */
 
304
                        if (!(s->s3->tmp.new_cipher->algorithms & SSL_aNULL)
 
305
                                && !(s->s3->tmp.new_cipher->algorithms & SSL_aKRB5))
305
306
                                {
306
307
                                ret=ssl3_send_server_certificate(s);
307
308
                                if (ret <= 0) goto end;
679
680
         */
680
681
        if (s->state == SSL3_ST_SR_CLNT_HELLO_A)
681
682
                {
682
 
                s->first_packet=1;
683
683
                s->state=SSL3_ST_SR_CLNT_HELLO_B;
684
684
                }
 
685
        s->first_packet=1;
685
686
        n=s->method->ssl_get_message(s,
686
687
                SSL3_ST_SR_CLNT_HELLO_B,
687
688
                SSL3_ST_SR_CLNT_HELLO_C,
690
691
                &ok);
691
692
 
692
693
        if (!ok) return((int)n);
 
694
        s->first_packet=0;
693
695
        d=p=(unsigned char *)s->init_msg;
694
696
 
695
697
        /* use version from inside client hello, not from record header
1995
1997
                                SSL_R_DATA_LENGTH_TOO_LONG);
1996
1998
                        goto err;
1997
1999
                        }
 
2000
                if (!((p[0] == (s->client_version>>8)) && (p[1] == (s->client_version & 0xff))))
 
2001
                    {
 
2002
                    /* The premaster secret must contain the same version number as the
 
2003
                     * ClientHello to detect version rollback attacks (strangely, the
 
2004
                     * protocol does not offer such protection for DH ciphersuites).
 
2005
                     * However, buggy clients exist that send random bytes instead of
 
2006
                     * the protocol version.
 
2007
                     * If SSL_OP_TLS_ROLLBACK_BUG is set, tolerate such clients. 
 
2008
                     * (Perhaps we should have a separate BUG value for the Kerberos cipher)
 
2009
                     */
 
2010
                    if (!((s->options & SSL_OP_TLS_ROLLBACK_BUG) &&
 
2011
                           (p[0] == (s->version>>8)) && (p[1] == (s->version & 0xff))))
 
2012
                        {
 
2013
                        SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE,
 
2014
                               SSL_AD_DECODE_ERROR);
 
2015
                        goto err;
 
2016
                        }
 
2017
                    }
 
2018
 
1998
2019
                EVP_CIPHER_CTX_cleanup(&ciph_ctx);
1999
2020
 
2000
2021
                s->session->master_key_length=
2042
2063
                if (l & SSL_kECDH) 
2043
2064
                        { 
2044
2065
                        /* use the certificate */
2045
 
                        tkey = s->cert->key->privatekey->pkey.ec;
 
2066
                        tkey = s->cert->pkeys[SSL_PKEY_ECC].privatekey->pkey.ec;
2046
2067
                        }
2047
2068
                else
2048
2069
                        {