OpenVAS Libraries
6.0+beta5
Main Page
Related Pages
Data Structures
Files
File List
Globals
nasl
hmacmd5.h
Go to the documentation of this file.
1
/*
2
Unix SMB/CIFS implementation.
3
Interface header: Scheduler service
4
Copyright (C) Luke Kenneth Casson Leighton 1996-1999
5
Copyright (C) Andrew Tridgell 1992-1999
6
7
This program is free software; you can redistribute it and/or modify
8
it under the terms of the GNU General Public License as published by
9
the Free Software Foundation; either version 2 of the License, or
10
(at your option) any later version.
11
12
This program is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU General Public License for more details.
16
17
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20
*/
21
22
#ifndef _HMAC_MD5_H
23
#define _HMAC_MD5_H
24
25
#include "
md5.h
"
26
27
#ifndef uchar
28
#define uchar unsigned char
29
#endif
30
31
/* zero a structure */
32
#define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
33
34
typedef
struct
35
{
36
struct
MD5Context
ctx;
37
uchar
k_ipad[65];
38
uchar
k_opad[65];
39
40
}
HMACMD5Context
;
41
42
#ifndef SAFE_FREE
43
49
#define SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0)
50
#endif
51
52
/*
53
* Note we duplicate the size tests in the unsigned
54
* case as int16 may be a typedef from rpc/rpc.h
55
*/
56
57
#if !defined(uint16) && !defined(HAVE_UINT16_FROM_RPC_RPC_H)
58
#if (SIZEOF_SHORT == 4)
59
#define uint16 __ERROR___CANNOT_DETERMINE_TYPE_FOR_INT16;
60
#else
/* SIZEOF_SHORT != 4 */
61
#define uint16 unsigned short
62
#endif
/* SIZEOF_SHORT != 4 */
63
#endif
64
65
/*
66
* SMB UCS2 (16-bit unicode) internal type.
67
*/
68
typedef
uint16
smb_ucs2_t
;
69
70
#ifdef WORDS_BIGENDIAN
71
#define UCS2_SHIFT 8
72
#else
73
#define UCS2_SHIFT 0
74
#endif
75
76
/* turn a 7 bit character into a ucs2 character */
77
#define UCS2_CHAR(c) ((c) << UCS2_SHIFT)
78
void
hmac_md5_init_rfc2104
(
uchar
* key,
int
key_len,
HMACMD5Context
*ctx);
79
void
hmac_md5_init_limK_to_64
(
const
uchar
* key,
int
key_len,
HMACMD5Context
*ctx);
80
81
void
hmac_md5_update
(
const
uchar
* text,
int
text_len,
HMACMD5Context
*ctx);
82
void
hmac_md5_final
(
uchar
*digest,
HMACMD5Context
*ctx);
83
84
void
hmac_md5
(
uchar
key[16],
uchar
* data,
int
data_len,
uchar
* digest);
85
86
#endif
/* _HMAC_MD5_H */
Generated by
1.8.4