diff options
author | schwarze <> | 2016-11-02 09:11:53 +0000 |
---|---|---|
committer | schwarze <> | 2016-11-02 09:11:53 +0000 |
commit | b50ac7faef96a45291b0c3201b82185f7579e826 (patch) | |
tree | 9166b196a2c833fc7a0154973d11551824a6bfb9 /src/lib/libcrypto/man/DH_generate_key.3 | |
parent | 506350d1237710b9d86fdb3a794c6e6265f71221 (diff) | |
download | openbsd-b50ac7faef96a45291b0c3201b82185f7579e826.tar.gz openbsd-b50ac7faef96a45291b0c3201b82185f7579e826.tar.bz2 openbsd-b50ac7faef96a45291b0c3201b82185f7579e826.zip |
convert DES and DH manuals from pod to mdoc
Diffstat (limited to 'src/lib/libcrypto/man/DH_generate_key.3')
-rw-r--r-- | src/lib/libcrypto/man/DH_generate_key.3 | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/DH_generate_key.3 b/src/lib/libcrypto/man/DH_generate_key.3 new file mode 100644 index 0000000000..6e2edbadb3 --- /dev/null +++ b/src/lib/libcrypto/man/DH_generate_key.3 | |||
@@ -0,0 +1,71 @@ | |||
1 | .Dd $Mdocdate: November 2 2016 $ | ||
2 | .Dt DH_GENERATE_KEY 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm DH_generate_key , | ||
6 | .Nm DH_compute_key | ||
7 | .Nd perform Diffie-Hellman key exchange | ||
8 | .Sh SYNOPSIS | ||
9 | .In openssl/dh.h | ||
10 | .Ft int | ||
11 | .Fo DH_generate_key | ||
12 | .Fa "DH *dh" | ||
13 | .Fc | ||
14 | .Ft int | ||
15 | .Fo DH_compute_key | ||
16 | .Fa "unsigned char *key" | ||
17 | .Fa "BIGNUM *pub_key" | ||
18 | .Fa "DH *dh" | ||
19 | .Fc | ||
20 | .Sh DESCRIPTION | ||
21 | .Fn DH_generate_key | ||
22 | performs the first step of a Diffie-Hellman key exchange by generating | ||
23 | private and public DH values. | ||
24 | By calling | ||
25 | .Fn DH_compute_key , | ||
26 | these are combined with the other party's public value to compute the | ||
27 | shared key. | ||
28 | .Pp | ||
29 | .Fn DH_generate_key | ||
30 | expects | ||
31 | .Fa dh | ||
32 | to contain the shared parameters | ||
33 | .Sy dh->p | ||
34 | and | ||
35 | .Sy dh->g . | ||
36 | It generates a random private DH value unless | ||
37 | .Sy dh->priv_key | ||
38 | is already set, and computes the corresponding public value | ||
39 | .Sy dh->pub_key , | ||
40 | which can then be published. | ||
41 | .Pp | ||
42 | .Fn DH_compute_key | ||
43 | computes the shared secret from the private DH value in | ||
44 | .Fa dh | ||
45 | and the other party's public value in | ||
46 | .Fa pub_key | ||
47 | and stores it in | ||
48 | .Fa key . | ||
49 | .Fa key | ||
50 | must point to | ||
51 | .Fn DH_size dh | ||
52 | bytes of memory. | ||
53 | .Sh RETURN VALUES | ||
54 | .Fn DH_generate_key | ||
55 | returns 1 on success, 0 otherwise. | ||
56 | .Pp | ||
57 | .Fn DH_compute_key | ||
58 | returns the size of the shared secret on success, -1 on error. | ||
59 | .Pp | ||
60 | The error codes can be obtained by | ||
61 | .Xr ERR_get_error 3 . | ||
62 | .Sh SEE ALSO | ||
63 | .Xr dh 3 , | ||
64 | .Xr DH_size 3 , | ||
65 | .Xr ERR_get_error 3 , | ||
66 | .Xr rand 3 | ||
67 | .Sh HISTORY | ||
68 | .Fn DH_generate_key | ||
69 | and | ||
70 | .Fn DH_compute_key | ||
71 | are available in all versions of SSLeay and OpenSSL. | ||