]> git.lizzy.rs Git - plan9front.git/blob - sys/man/2/pushssl
/sys/man/*/*: fix perms (sorry)
[plan9front.git] / sys / man / 2 / pushssl
1 .TH PUSHSSL 2
2 .SH NAME
3 pushssl \- attach SSL version 2 encryption to a communication channel
4 .SH SYNOPSIS
5 .B #include <u.h>
6 .br
7 .B #include <libc.h>
8 .PP
9 .B
10 int pushssl(int fd, char *alg, char *secin, char *secout, int *cfd)
11 .SH DESCRIPTION
12 .I Pushssl
13 opens an
14 .IR ssl (3)
15 device, connects it to the communications channel
16 .IR fd ,
17 and starts up encryption and message authentication as specified
18 in
19 .IR alg .
20 The algorithms are separated by a space and either can be first.
21 See
22 .IR ssl (3)
23 for the possible algorithms.
24 .I Secin
25 and
26 .I secout
27 contain the encryption keys for the two directions.
28 If either is nil, the other is used in both directions.
29 If
30 .I cfd
31 is non-nil, the SSL control channel is opened and its fd
32 returned.
33 .PP
34 .I Pushssl
35 returns a file descriptor for the SSL data channel.  Anything written to this
36 descriptor will get encrypted and authenticated and then written to the
37 file descriptor,
38 .IR fd .
39 .I Pushssl
40 closes the original file descriptor
41 .IR fd
42 on success.
43 .SH SOURCE
44 .B /sys/src/libc/9sys
45 .SH "SEE ALSO"
46 .IR dial (2),
47 .IR ssl (3),
48 .SH DIAGNOSTICS
49 return \-1 on failure.