~ubuntu-branches/ubuntu/lucid/wpasupplicant/lucid-updates

« back to all changes in this revision

Viewing changes to tlsv1_client.c

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2006-10-05 08:04:01 UTC
  • mfrom: (1.1.5 upstream) (3 etch)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20061005080401-r8lqlix4390yos7b
Tags: 0.5.5-2
* Update madwifi headers to latest SVN. (Closes: #388316)
* Remove failed attempt at action locking. [debian/functions.sh,
  debian/wpa_action.sh]
* Add hysteresis checking functions, to avoid "event loops" while
  using wpa-roam. [debian/functions.sh, debian/wpa_action.sh]
* Change of co-maintainer email address.
* Add ishex() function to functions.sh to determine wpa-psk value type in
  plaintext or hex. This effectively eliminates the need for the bogus and
  somewhat confusing wpa-passphrase contruct specific to our scripts and
  allows wpa-psk to work with either a 8 to 63 character long plaintext
  string or 64 character long hex string.
* Adjust README.modes to not refer to the redundant wpa-passphrase stuff.
* Add big fat NOTE about acceptable wpa-psk's to top of example gallery.
* Strip surrounding quotes from wpa-ssid if present, instead of just whining
  about them.
* Update email address in copyright blurb of functions.sh, ifupdown.sh and
  wpa_action.sh.  

Show diffs side-by-side

added added

removed removed

Lines of Context:
582
582
                goto fail;
583
583
        conn->dh_p_len = WPA_GET_BE16(pos);
584
584
        pos += 2;
585
 
        if (conn->dh_p_len == 0 || end - pos < conn->dh_p_len)
 
585
        if (conn->dh_p_len == 0 || end - pos < (int) conn->dh_p_len)
586
586
                goto fail;
587
587
        conn->dh_p = malloc(conn->dh_p_len);
588
588
        if (conn->dh_p == NULL)
596
596
                goto fail;
597
597
        conn->dh_g_len = WPA_GET_BE16(pos);
598
598
        pos += 2;
599
 
        if (conn->dh_g_len == 0 || end - pos < conn->dh_g_len)
 
599
        if (conn->dh_g_len == 0 || end - pos < (int) conn->dh_g_len)
600
600
                goto fail;
601
601
        conn->dh_g = malloc(conn->dh_g_len);
602
602
        if (conn->dh_g == NULL)
612
612
                goto fail;
613
613
        conn->dh_ys_len = WPA_GET_BE16(pos);
614
614
        pos += 2;
615
 
        if (conn->dh_ys_len == 0 || end - pos < conn->dh_ys_len)
 
615
        if (conn->dh_ys_len == 0 || end - pos < (int) conn->dh_ys_len)
616
616
                goto fail;
617
617
        conn->dh_ys = malloc(conn->dh_ys_len);
618
618
        if (conn->dh_ys == NULL)
1985
1985
}
1986
1986
 
1987
1987
 
1988
 
int tlsv1_client_set_anon_dh(struct tlsv1_client *conn)
 
1988
int tlsv1_client_set_cipher_list(struct tlsv1_client *conn, u8 *ciphers)
1989
1989
{
1990
1990
#ifdef EAP_FAST
1991
1991
        size_t count;
1992
1992
        u16 *suites;
1993
1993
 
1994
 
        count = 0;
1995
 
        suites = conn->cipher_suites;
1996
 
        suites[count++] = TLS_DH_anon_WITH_AES_256_CBC_SHA;
1997
 
        suites[count++] = TLS_DH_anon_WITH_AES_128_CBC_SHA;
1998
 
        suites[count++] = TLS_DH_anon_WITH_3DES_EDE_CBC_SHA;
1999
 
        suites[count++] = TLS_DH_anon_WITH_RC4_128_MD5;
2000
 
        suites[count++] = TLS_DH_anon_WITH_DES_CBC_SHA;
2001
 
        conn->num_cipher_suites = count;
 
1994
        /* TODO: implement proper configuration of cipher suites */
 
1995
        if (ciphers[0] == TLS_CIPHER_ANON_DH_AES128_SHA) {
 
1996
                count = 0;
 
1997
                suites = conn->cipher_suites;
 
1998
                suites[count++] = TLS_DH_anon_WITH_AES_256_CBC_SHA;
 
1999
                suites[count++] = TLS_DH_anon_WITH_AES_128_CBC_SHA;
 
2000
                suites[count++] = TLS_DH_anon_WITH_3DES_EDE_CBC_SHA;
 
2001
                suites[count++] = TLS_DH_anon_WITH_RC4_128_MD5;
 
2002
                suites[count++] = TLS_DH_anon_WITH_DES_CBC_SHA;
 
2003
                conn->num_cipher_suites = count;
 
2004
        }
2002
2005
 
2003
2006
        return 0;
2004
2007
#else /* EAP_FAST */