OpenVAS Libraries  9.0.3
smb_crypt2.c File Reference
#include <ctype.h>
#include "hmacmd5.h"
Include dependency graph for smb_crypt2.c:

Go to the source code of this file.

Functions

smb_ucs2_t toupper_w (smb_ucs2_t val)
 
int strupper_w (smb_ucs2_t *s)
 
void SMBOWFencrypt_ntv2_ntlmssp (const uchar *kr, const uchar *srv_chal_data, int srv_chal_len, const uchar *cli_chal_data, int cli_chal_len, uchar resp_buf[16])
 

Function Documentation

◆ SMBOWFencrypt_ntv2_ntlmssp()

void SMBOWFencrypt_ntv2_ntlmssp ( const uchar kr,
const uchar srv_chal_data,
int  srv_chal_len,
const uchar cli_chal_data,
int  cli_chal_len,
uchar  resp_buf[16] 
)

Definition at line 57 of file smb_crypt2.c.

References hmac_md5_final(), hmac_md5_init_limK_to_64(), and hmac_md5_update().

63 {
64  HMACMD5Context ctx;
65 
66  hmac_md5_init_limK_to_64(kr, 16, &ctx);
67  hmac_md5_update(srv_chal_data, srv_chal_len, &ctx);
68  hmac_md5_update(cli_chal_data, cli_chal_len, &ctx);
69  hmac_md5_final(resp_buf, &ctx);
70 }
void hmac_md5_init_limK_to_64(const uchar *key, int key_len, HMACMD5Context *ctx)
The microsoft version of hmac_md5 initialisation.
Definition: hmacmd5.c:33
void hmac_md5_final(uchar *digest, HMACMD5Context *ctx)
Finish off hmac_md5 "inner" buffer and generate outer one.
Definition: hmacmd5.c:71
void hmac_md5_update(const uchar *text, int text_len, HMACMD5Context *ctx)
Update hmac_md5 "inner" buffer.
Definition: hmacmd5.c:63
Here is the call graph for this function:

◆ strupper_w()

int strupper_w ( smb_ucs2_t s)

Definition at line 42 of file smb_crypt2.c.

References toupper_w().

Referenced by nasl_ntv2_owf_gen().

43 {
44  int ret = 0;
45  while (*s) {
46  smb_ucs2_t v = toupper_w(*s);
47  if (v != *s) {
48  *s = v;
49  ret = 1;
50  }
51  s++;
52  }
53  return ret;
54 }
smb_ucs2_t toupper_w(smb_ucs2_t val)
Definition: smb_crypt2.c:33
uint16 smb_ucs2_t
Definition: hmacmd5.h:68
Here is the call graph for this function:
Here is the caller graph for this function:

◆ toupper_w()

smb_ucs2_t toupper_w ( smb_ucs2_t  val)

Definition at line 33 of file smb_crypt2.c.

References UCS2_CHAR, and val.

Referenced by strupper_w().

34 {
35  return UCS2_CHAR(islower(val)?toupper(val):val);
36 }
const char * val
Definition: nasl_init.c:525
#define UCS2_CHAR(c)
Definition: hmacmd5.h:77
Here is the caller graph for this function: