~ubuntu-branches/ubuntu/oneiric/wpasupplicant/oneiric

« back to all changes in this revision

Viewing changes to md5.h

  • Committer: Bazaar Package Importer
  • Author(s): Kel Modderman
  • Date: 2006-10-05 08:04:01 UTC
  • mfrom: (1.2.1 upstream) (2.1.14 edgy)
  • Revision ID: james.westby@ubuntu.com-20061005080401-myfwjtq7di70dyeo
* 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:
 
1
/*
 
2
 * MD5 hash implementation and interface functions
 
3
 * Copyright (c) 2003-2005, Jouni Malinen <jkmaline@cc.hut.fi>
 
4
 *
 
5
 * This program is free software; you can redistribute it and/or modify
 
6
 * it under the terms of the GNU General Public License version 2 as
 
7
 * published by the Free Software Foundation.
 
8
 *
 
9
 * Alternatively, this software may be distributed under the terms of BSD
 
10
 * license.
 
11
 *
 
12
 * See README and COPYING for more details.
 
13
 */
 
14
 
1
15
#ifndef MD5_H
2
16
#define MD5_H
3
17
 
4
 
#ifdef EAP_TLS_FUNCS
5
 
 
6
 
#include <openssl/md5.h>
7
 
 
8
 
#define MD5Init MD5_Init
9
 
#define MD5Update MD5_Update
10
 
#define MD5Final MD5_Final
11
 
#define MD5Transform MD5_Transform
12
 
 
13
 
#define MD5_MAC_LEN MD5_DIGEST_LENGTH
14
 
 
15
 
#else /* EAP_TLS_FUNCS */
16
 
 
17
18
#define MD5_MAC_LEN 16
18
19
 
19
 
struct MD5Context {
20
 
        u32 buf[4];
21
 
        u32 bits[2];
22
 
        u8 in[64];
23
 
};
24
 
 
25
 
void MD5Init(struct MD5Context *context);
26
 
void MD5Update(struct MD5Context *context, unsigned char const *buf,
27
 
               unsigned len);
28
 
void MD5Final(unsigned char digest[16], struct MD5Context *context);
29
 
void MD5Transform(u32 buf[4], u32 const in[16]);
30
 
 
31
 
typedef struct MD5Context MD5_CTX;
32
 
 
33
 
#endif /* EAP_TLS_FUNCS */
34
 
 
35
 
 
36
 
void md5_mac(const u8 *key, size_t key_len, const u8 *data, size_t data_len,
37
 
             u8 *mac);
38
20
void hmac_md5_vector(const u8 *key, size_t key_len, size_t num_elem,
39
21
                     const u8 *addr[], const size_t *len, u8 *mac);
40
22
void hmac_md5(const u8 *key, size_t key_len, const u8 *data, size_t data_len,