Classes | Macros | Functions | Variables
ykey.c File Reference
#include "ykey.h"
#include <string.h>
#include "yproto.h"
Include dependency graph for ykey.c:

Go to the source code of this file.

Classes

struct  WPA_CALC_STATE
 

Macros

#define __FILE_ID__   "ydef"
 
#define byteReverse(buf, len)
 
#define F1(x, y, z)   (z ^ (x & (y ^ z)))
 
#define F2(x, y, z)   F1(z, x, y)
 
#define F3(x, y, z)   (x ^ y ^ z)
 
#define F4(x, y, z)   (y ^ (x | ~z))
 
#define MD5STEP(f, w, x, y, z, data, s)   ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )
 

Functions

void bin2str (char *to, const u8 *p, u16 len, u8 addnull)
 
static char btohexa_low_high (u8 b)
 
static char btohexa_low_low (u8 b)
 
int CheckWSAuth (u32 nonce, const u8 *ha1, const u8 *to_verify, u8 *out)
 
void ComputeAuthHA1 (u8 *ha1, const char *user, const char *pass, const char *realm)
 
void ComputeAuthHA2 (u8 *ha2, const char *method, const char *uri)
 
void ComputeAuthResponse (char *buf, const u8 *ha1, const char *nonce, const char *nc, const char *cnonce, const u8 *ha2)
 
static void initshaw (const char *s, u16 ofs, u8 pad, u16 xinit)
 
static void itershaw (const u32 *s)
 
void MD5AddData (HASH_SUM *ctx, const u8 *buf, u32 len)
 
void MD5Calculate (HASH_SUM *ctx, u8 digest[16])
 
void MD5Initialize (HASH_SUM *ctx)
 
static void MD5Transform (u32 buf[4], u32 const in[16])
 
u32 yapiGetCNonce (u32 nc)
 
void yDigestAuthorization (char *buf, int bufsize, const char *user, const char *realm, const u8 *ha1, const char *nonce, const char *opaque, u32 *nc, const char *method, const char *uri)
 
void yInitPsk (const char *pass, const char *ssid)
 
int yIterPsk (u8 *res, const char *ssid)
 
int yParseWWWAuthenticate (char *replybuf, int replysize, char **method, char **realm, char **qop, char **nonce, char **opaque)
 
u8 * ySHA1 (const char *text)
 

Variables

const u32 sha1_init [5] = { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }
 
static WPA_CALC_STATE wpak = { -1 }
 

Macro Definition Documentation

#define __FILE_ID__   "ydef"

Definition at line 39 of file ykey.c.

#define byteReverse (   buf,
  len 
)

Definition at line 517 of file ykey.c.

#define F1 (   x,
  y,
 
)    (z ^ (x & (y ^ z)))

Definition at line 530 of file ykey.c.

#define F2 (   x,
  y,
 
)    F1(z, x, y)

Definition at line 531 of file ykey.c.

#define F3 (   x,
  y,
 
)    (x ^ y ^ z)

Definition at line 532 of file ykey.c.

#define F4 (   x,
  y,
 
)    (y ^ (x | ~z))

Definition at line 533 of file ykey.c.

#define MD5STEP (   f,
  w,
  x,
  y,
  z,
  data,
  s 
)    ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x )

Definition at line 535 of file ykey.c.

Function Documentation

void bin2str ( char *  to,
const u8 *  p,
u16  len,
u8  addnull 
)

Definition at line 63 of file ykey.c.

static char btohexa_low_high ( u8  b)
static

Definition at line 51 of file ykey.c.

static char btohexa_low_low ( u8  b)
static

Definition at line 57 of file ykey.c.

int CheckWSAuth ( u32  nonce,
const u8 *  ha1,
const u8 *  to_verify,
u8 *  out 
)

Definition at line 158 of file ykey.c.

void ComputeAuthHA1 ( u8 *  ha1,
const char *  user,
const char *  pass,
const char *  realm 
)

Definition at line 77 of file ykey.c.

void ComputeAuthHA2 ( u8 *  ha2,
const char *  method,
const char *  uri 
)

Definition at line 98 of file ykey.c.

void ComputeAuthResponse ( char *  buf,
const u8 *  ha1,
const char *  nonce,
const char *  nc,
const char *  cnonce,
const u8 *  ha2 
)

Definition at line 118 of file ykey.c.

static void initshaw ( const char *  s,
u16  ofs,
u8  pad,
u16  xinit 
)
static

Definition at line 329 of file ykey.c.

static void itershaw ( const u32 *  s)
static

Definition at line 372 of file ykey.c.

void MD5AddData ( HASH_SUM ctx,
const u8 *  buf,
u32  len 
)

Definition at line 634 of file ykey.c.

void MD5Calculate ( HASH_SUM ctx,
u8  digest[16] 
)

Definition at line 671 of file ykey.c.

void MD5Initialize ( HASH_SUM ctx)

Definition at line 540 of file ykey.c.

static void MD5Transform ( u32  buf[4],
u32 const  in[16] 
)
static

Definition at line 551 of file ykey.c.

u32 yapiGetCNonce ( u32  nc)

Definition at line 2750 of file yapi.c.

void yDigestAuthorization ( char *  buf,
int  bufsize,
const char *  user,
const char *  realm,
const u8 *  ha1,
const char *  nonce,
const char *  opaque,
u32 *  nc,
const char *  method,
const char *  uri 
)

Definition at line 269 of file ykey.c.

void yInitPsk ( const char *  pass,
const char *  ssid 
)

Definition at line 445 of file ykey.c.

int yIterPsk ( u8 *  res,
const char *  ssid 
)

Definition at line 463 of file ykey.c.

int yParseWWWAuthenticate ( char *  replybuf,
int  replysize,
char **  method,
char **  realm,
char **  qop,
char **  nonce,
char **  opaque 
)

Definition at line 192 of file ykey.c.

u8* ySHA1 ( const char *  text)

Definition at line 425 of file ykey.c.

Variable Documentation

const u32 sha1_init[5] = { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }

Definition at line 327 of file ykey.c.

WPA_CALC_STATE wpak = { -1 }
static

Definition at line 325 of file ykey.c.



yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:13