1
0

pushssl 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. .SH SOURCE
  40. .B /sys/src/libc/9sys
  41. .SH "SEE ALSO"
  42. .IR dial (2),
  43. .IR ssl (3),
  44. .SH DIAGNOSTICS
  45. return \-1 on failure.