OpenVAS Scanner 23.23.1
hmacmd5.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Greenbone AG
2 * SPDX-FileCopyrightText: 1996-1999 Luke Kenneth Casson Leighton
3 * SPDX-FileCopyrightText: 1992-1999 Andrew Tridgell
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7
15
16#ifndef NASL_HMACMD5_H
17#define NASL_HMACMD5_H
18
19#include "md5.h"
20
21#ifndef uchar
22#define uchar unsigned char
23#endif
24
25/* zero a structure */
26#define ZERO_STRUCT(x) memset ((char *) &(x), 0, sizeof (x))
27
28typedef struct
29{
33
35
36/*
37 * Note we duplicate the size tests in the unsigned
38 * case as int16 may be a typedef from rpc/rpc.h
39 */
40
41#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
42#if (SIZEOF_SHORT == 4)
43#define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
44#else /* SIZEOF_SHORT != 4 */
45#define uint16 unsigned short
46#endif /* SIZEOF_SHORT != 4 */
47#endif
48
49/*
50 * SMB UCS2 (16-bit unicode) internal type.
51 */
53
54#ifdef WORDS_BIGENDIAN
55#define UCS2_SHIFT 8
56#else
57#define UCS2_SHIFT 0
58#endif
59
60/* turn a 7 bit character into a ucs2 character */
61#define UCS2_CHAR(c) ((c) << UCS2_SHIFT)
62void
63hmac_md5_init_limK_to_64 (const uchar *key, int key_len, HMACMD5Context *ctx);
64
65void
66hmac_md5_update (const uchar *text, int text_len, HMACMD5Context *ctx);
67void
68hmac_md5_final (uchar *digest, HMACMD5Context *ctx);
69
70void
71hmac_md5 (uchar key[16], uchar *data, int data_len, uchar *digest);
72
73#endif /* NASL_HMACMD5_H */
#define uint16
Definition charcnv.c:49
void hmac_md5_final(uchar *digest, HMACMD5Context *ctx)
Finish off hmac_md5 "inner" buffer and generate outer one.
Definition hmacmd5.c:64
void hmac_md5_update(const uchar *text, int text_len, HMACMD5Context *ctx)
Update hmac_md5 "inner" buffer.
Definition hmacmd5.c:55
#define uchar
Definition hmacmd5.h:22
void hmac_md5(uchar key[16], uchar *data, int data_len, uchar *digest)
Function to calculate an HMAC MD5 digest from data. Use the microsoft hmacmd5 init method because the...
Definition hmacmd5.c:82
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:24
uint16 smb_ucs2_t
Definition hmacmd5.h:52
Definition hmacmd5.h:29
uchar k_ipad[65]
Definition hmacmd5.h:31
struct MD5Context ctx
Definition hmacmd5.h:30
uchar k_opad[65]
Definition hmacmd5.h:32
Definition md5.h:52