1
#ifndef __LIBSSH2_MAC_H
2
#define __LIBSSH2_MAC_H
4
/* Copyright (C) 2009-2010 by Daniel Stenberg
6
* Redistribution and use in source and binary forms,
7
* with or without modification, are permitted provided
8
* that the following conditions are met:
10
* Redistributions of source code must retain the above
11
* copyright notice, this list of conditions and the
12
* following disclaimer.
14
* Redistributions in binary form must reproduce the above
15
* copyright notice, this list of conditions and the following
16
* disclaimer in the documentation and/or other materials
17
* provided with the distribution.
19
* Neither the name of the copyright holder nor the names
20
* of any other contributors may be used to endorse or
21
* promote products derived from this software without
22
* specific prior written permission.
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
25
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
26
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
29
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
31
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
34
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
36
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
41
#include "libssh2_priv.h"
43
struct _LIBSSH2_MAC_METHOD
47
/* The length of a given MAC packet */
50
/* integrity key length */
53
/* Message Authentication Code Hashing algo */
54
int (*init) (LIBSSH2_SESSION * session, unsigned char *key, int *free_key,
56
int (*hash) (LIBSSH2_SESSION * session, unsigned char *buf,
57
uint32_t seqno, const unsigned char *packet,
58
uint32_t packet_len, const unsigned char *addtl,
59
uint32_t addtl_len, void **abstract);
60
int (*dtor) (LIBSSH2_SESSION * session, void **abstract);
63
typedef struct _LIBSSH2_MAC_METHOD LIBSSH2_MAC_METHOD;
65
const LIBSSH2_MAC_METHOD **_libssh2_mac_methods(void);
67
#endif /* __LIBSSH2_MAC_H */