forked from gyepisam/spiped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proto_handshake.h
26 lines (22 loc) · 1.03 KB
/
proto_handshake.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef _PROTO_HANDSHAKE_H_
#define _PROTO_HANDSHAKE_H_
struct proto_keys;
/**
* proto_handshake(s, decr, nofps, kfhash, callback, cookie):
* Perform a protocol handshake on socket ${s}. If ${decr} is non-zero we are
* at the receiving end of the connection; otherwise at the sending end. If
* ${nofps} is non-zero, perform a "weak" handshake without forward perfect
* secrecy. The key file's hash is ${kfhash}. Upon completion, invoke
* ${callback}(${cookie}, f, r) where f contains the keys needed for the
* forward direction and r contains the keys needed for the reverse direction;
* or w = r = NULL if the handshake failed. Return a cookie which can be
* passed to proto_handshake_cancel to cancel the handshake.
*/
void * proto_handshake(int, int, int, const uint8_t[32],
int (*)(void *, struct proto_keys *, struct proto_keys *), void *);
/**
* proto_handshake_cancel(cookie):
* Cancel the handshake for which proto_handshake returned ${cookie}.
*/
void proto_handshake_cancel(void *);
#endif /* !_PROTO_HANDSHAKE_H_ */