~yolanda.robla/ubuntu/saucy/freeradius/dep-8-tests

« back to all changes in this revision

Viewing changes to src/modules/rlm_eap/libeap/mppe_keys.c

  • Committer: Bazaar Package Importer
  • Author(s): Josip Rodin
  • Date: 2009-11-23 03:57:37 UTC
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20091123035737-snauioz5r9tf8sdr
Tags: upstream-2.1.7+dfsg
ImportĀ upstreamĀ versionĀ 2.1.7+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * mppe_keys.c
3
3
 *
4
 
 * Version:     $Id: mppe_keys.c,v 1.5 2007/11/25 14:02:08 aland Exp $
 
4
 * Version:     $Id$
5
5
 *
6
6
 *   This program is free software; you can redistribute it and/or modify
7
7
 *   it under the terms of the GNU General Public License as published by
23
23
 */
24
24
 
25
25
#include <freeradius-devel/ident.h>
26
 
RCSID("$Id: mppe_keys.c,v 1.5 2007/11/25 14:02:08 aland Exp $")
 
26
RCSID("$Id$")
27
27
 
28
28
#include <openssl/hmac.h>
29
29
#include "eap_tls.h"
39
39
        if (!reply_attr) {
40
40
                DEBUG("rlm_eap_tls: "
41
41
                      "add_reply failed to create attribute %s: %s\n",
42
 
                      name, librad_errstr);
 
42
                      name, fr_strerror());
43
43
                return;
44
44
        }
45
45
 
127
127
void eaptls_gen_mppe_keys(VALUE_PAIR **reply_vps, SSL *s,
128
128
                          const char *prf_label)
129
129
{
130
 
        unsigned char out[2*EAPTLS_MPPE_KEY_LEN], buf[2*EAPTLS_MPPE_KEY_LEN];
 
130
        unsigned char out[4*EAPTLS_MPPE_KEY_LEN], buf[4*EAPTLS_MPPE_KEY_LEN];
131
131
        unsigned char seed[64 + 2*SSL3_RANDOM_SIZE];
132
132
        unsigned char *p = seed;
133
133
        size_t prf_size;
151
151
        add_reply(reply_vps, "MS-MPPE-Recv-Key", p, EAPTLS_MPPE_KEY_LEN);
152
152
        p += EAPTLS_MPPE_KEY_LEN;
153
153
        add_reply(reply_vps, "MS-MPPE-Send-Key", p, EAPTLS_MPPE_KEY_LEN);
 
154
 
 
155
        add_reply(reply_vps, "EAP-MSK", out, 64);
 
156
        add_reply(reply_vps, "EAP-EMSK", out + 64, 64);
154
157
}
155
158
 
156
159