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

« back to all changes in this revision

Viewing changes to eap_ttls.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:
1579
1579
                        }
1580
1580
                        data->resuming = 0;
1581
1581
                }
 
1582
 
 
1583
                if (res == 2) {
 
1584
                        /*
 
1585
                         * Application data included in the handshake message.
 
1586
                         */
 
1587
                        free(data->pending_phase2_req);
 
1588
                        data->pending_phase2_req = resp;
 
1589
                        data->pending_phase2_req_len = *respDataLen;
 
1590
                        resp = NULL;
 
1591
                        *respDataLen = 0;
 
1592
                        res = eap_ttls_decrypt(sm, data, ret, req, pos, left,
 
1593
                                               &resp, respDataLen);
 
1594
                }
1582
1595
        }
1583
1596
 
1584
1597
        if (data->ttls_version == 0 && ret->methodState == METHOD_DONE) {
1631
1644
                free(data);
1632
1645
                return NULL;
1633
1646
        }
 
1647
        if (data->phase2_priv && data->phase2_method &&
 
1648
            data->phase2_method->init_for_reauth)
 
1649
                data->phase2_method->init_for_reauth(sm, data->phase2_priv);
1634
1650
        data->phase2_start = 0;
1635
1651
        data->phase2_success = 0;
1636
1652
        data->resuming = 1;
1643
1659
                               size_t buflen, int verbose)
1644
1660
{
1645
1661
        struct eap_ttls_data *data = priv;
1646
 
        int len;
 
1662
        int len, ret;
1647
1663
 
1648
1664
        len = eap_tls_status(sm, &data->ssl, buf, buflen, verbose);
1649
 
        len += snprintf(buf + len, buflen - len, "EAP-TTLSv%d Phase2 method=",
1650
 
                        data->ttls_version);
 
1665
        ret = snprintf(buf + len, buflen - len, "EAP-TTLSv%d Phase2 method=",
 
1666
                       data->ttls_version);
 
1667
        if (ret < 0 || (size_t) ret >= buflen - len)
 
1668
                return len;
 
1669
        len += ret;
1651
1670
        switch (data->phase2_type) {
1652
1671
        case EAP_TTLS_PHASE2_EAP:
1653
 
                len += snprintf(buf + len, buflen - len, "EAP-%s\n",
1654
 
                                data->phase2_method ? data->phase2_method->name
1655
 
                                : "?");
 
1672
                ret = snprintf(buf + len, buflen - len, "EAP-%s\n",
 
1673
                               data->phase2_method ? data->phase2_method->name
 
1674
                               : "?");
1656
1675
                break;
1657
1676
        case EAP_TTLS_PHASE2_MSCHAPV2:
1658
 
                len += snprintf(buf + len, buflen - len, "MSCHAPV2\n");
 
1677
                ret = snprintf(buf + len, buflen - len, "MSCHAPV2\n");
1659
1678
                break;
1660
1679
        case EAP_TTLS_PHASE2_MSCHAP:
1661
 
                len += snprintf(buf + len, buflen - len, "MSCHAP\n");
 
1680
                ret = snprintf(buf + len, buflen - len, "MSCHAP\n");
1662
1681
                break;
1663
1682
        case EAP_TTLS_PHASE2_PAP:
1664
 
                len += snprintf(buf + len, buflen - len, "PAP\n");
 
1683
                ret = snprintf(buf + len, buflen - len, "PAP\n");
1665
1684
                break;
1666
1685
        case EAP_TTLS_PHASE2_CHAP:
1667
 
                len += snprintf(buf + len, buflen - len, "CHAP\n");
 
1686
                ret = snprintf(buf + len, buflen - len, "CHAP\n");
 
1687
                break;
 
1688
        default:
 
1689
                ret = 0;
1668
1690
                break;
1669
1691
        }
 
1692
        if (ret < 0 || (size_t) ret >= buflen - len)
 
1693
                return len;
 
1694
        len += ret;
1670
1695
 
1671
1696
        return len;
1672
1697
}