summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2016-12-01 16:02:14 +0000
committerschwarze <>2016-12-01 16:02:14 +0000
commitb7efc38e2e1de628f298b7136f9395112718cc5b (patch)
tree0da5bd2b85dd1a82f34d2e5c64df2d626db5a2e4
parenta19fc3196269c5b6b10b7c00798eca9136c26613 (diff)
downloadopenbsd-b7efc38e2e1de628f298b7136f9395112718cc5b.tar.gz
openbsd-b7efc38e2e1de628f298b7136f9395112718cc5b.tar.bz2
openbsd-b7efc38e2e1de628f298b7136f9395112718cc5b.zip
garbage collect PSK remnants
-rw-r--r--src/lib/libssl/man/Makefile5
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_psk_client_callback.368
-rw-r--r--src/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3110
-rw-r--r--src/lib/libssl/man/SSL_get_psk_identity.344
-rw-r--r--src/lib/libssl/man/ssl.355
5 files changed, 3 insertions, 279 deletions
diff --git a/src/lib/libssl/man/Makefile b/src/lib/libssl/man/Makefile
index cf4675b840..3078a76008 100644
--- a/src/lib/libssl/man/Makefile
+++ b/src/lib/libssl/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.40 2016/11/30 16:46:56 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.41 2016/12/01 16:02:14 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -33,7 +33,6 @@ MAN = BIO_f_ssl.3 \
33 SSL_CTX_set_mode.3 \ 33 SSL_CTX_set_mode.3 \
34 SSL_CTX_set_msg_callback.3 \ 34 SSL_CTX_set_msg_callback.3 \
35 SSL_CTX_set_options.3 \ 35 SSL_CTX_set_options.3 \
36 SSL_CTX_set_psk_client_callback.3 \
37 SSL_CTX_set_quiet_shutdown.3 \ 36 SSL_CTX_set_quiet_shutdown.3 \
38 SSL_CTX_set_session_cache_mode.3 \ 37 SSL_CTX_set_session_cache_mode.3 \
39 SSL_CTX_set_session_id_context.3 \ 38 SSL_CTX_set_session_id_context.3 \
@@ -43,7 +42,6 @@ MAN = BIO_f_ssl.3 \
43 SSL_CTX_set_tmp_rsa_callback.3 \ 42 SSL_CTX_set_tmp_rsa_callback.3 \
44 SSL_CTX_set_verify.3 \ 43 SSL_CTX_set_verify.3 \
45 SSL_CTX_use_certificate.3 \ 44 SSL_CTX_use_certificate.3 \
46 SSL_CTX_use_psk_identity_hint.3 \
47 SSL_SESSION_free.3 \ 45 SSL_SESSION_free.3 \
48 SSL_SESSION_get_ex_new_index.3 \ 46 SSL_SESSION_get_ex_new_index.3 \
49 SSL_SESSION_get_time.3 \ 47 SSL_SESSION_get_time.3 \
@@ -64,7 +62,6 @@ MAN = BIO_f_ssl.3 \
64 SSL_get_fd.3 \ 62 SSL_get_fd.3 \
65 SSL_get_peer_cert_chain.3 \ 63 SSL_get_peer_cert_chain.3 \
66 SSL_get_peer_certificate.3 \ 64 SSL_get_peer_certificate.3 \
67 SSL_get_psk_identity.3 \
68 SSL_get_rbio.3 \ 65 SSL_get_rbio.3 \
69 SSL_get_session.3 \ 66 SSL_get_session.3 \
70 SSL_get_verify_result.3 \ 67 SSL_get_verify_result.3 \
diff --git a/src/lib/libssl/man/SSL_CTX_set_psk_client_callback.3 b/src/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
deleted file mode 100644
index 0325a9405a..0000000000
--- a/src/lib/libssl/man/SSL_CTX_set_psk_client_callback.3
+++ /dev/null
@@ -1,68 +0,0 @@
1.\"
2.\" $OpenBSD: SSL_CTX_set_psk_client_callback.3,v 1.1 2016/11/05 15:32:19 schwarze Exp $
3.\"
4.Dd $Mdocdate: November 5 2016 $
5.Dt SSL_CTX_SET_PSK_CLIENT_CALLBACK 3
6.Os
7.Sh NAME
8.Nm SSL_CTX_set_psk_client_callback ,
9.Nm SSL_set_psk_client_callback
10.Nd set PSK client callback
11.Sh SYNOPSIS
12.In openssl/ssl.h
13.Ft void
14.Fo SSL_CTX_set_psk_client_callback
15.Fa "SSL_CTX *ctx"
16.Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \
17unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)"
18.Fc
19.Ft void
20.Fo SSL_set_psk_client_callback
21.Fa "SSL *ssl"
22.Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \
23unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)"
24.Fc
25.Sh DESCRIPTION
26A client application must provide a callback function which is called
27when the client is sending the ClientKeyExchange message to the server.
28.Pp
29The purpose of the callback function is to select the PSK identity and
30the pre-shared key to use during the connection setup phase.
31.Pp
32The callback is set using functions
33.Fn SSL_CTX_set_psk_client_callback
34or
35.Fn SSL_set_psk_client_callback .
36The callback function is given the connection in parameter
37.Fa ssl ,
38a
39.Dv NULL Ns
40-terminated PSK identity hint sent by the server in parameter
41.Fa hint ,
42a buffer
43.Fa identity
44of length
45.Fa max_identity_len
46bytes where the resulting
47.Dv NULL Ns
48-terminated identity is to be stored, and a buffer
49.Fa psk
50of
51length
52.Fa max_psk_len
53bytes where the resulting pre-shared key is to be stored.
54.Sh NOTES
55Note that parameter
56.Fa hint
57given to the callback may be
58.Dv NULL .
59.Sh RETURN VALUES
60Return values from the client callback are interpreted as follows:
61.Pp
62On success (callback found a PSK identity and a pre-shared key to use)
63the length (> 0) of
64.Fa psk
65in bytes is returned.
66.Pp
67Otherwise or on errors callback should return 0.
68In this case the connection setup fails.
diff --git a/src/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3 b/src/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
deleted file mode 100644
index 7d5d6b1dfd..0000000000
--- a/src/lib/libssl/man/SSL_CTX_use_psk_identity_hint.3
+++ /dev/null
@@ -1,110 +0,0 @@
1.\"
2.\" $OpenBSD: SSL_CTX_use_psk_identity_hint.3,v 1.1 2016/11/05 15:32:20 schwarze Exp $
3.\"
4.Dd $Mdocdate: November 5 2016 $
5.Dt SSL_CTX_USE_PSK_IDENTITY_HINT 3
6.Os
7.Sh NAME
8.Nm SSL_CTX_use_psk_identity_hint ,
9.Nm SSL_use_psk_identity_hint ,
10.Nm SSL_CTX_set_psk_server_callback ,
11.Nm SSL_set_psk_server_callback
12.Nd set PSK identity hint to use
13.Sh SYNOPSIS
14.In openssl/ssl.h
15.Ft int
16.Fn SSL_CTX_use_psk_identity_hint "SSL_CTX *ctx" "const char *hint"
17.Ft int
18.Fn SSL_use_psk_identity_hint "SSL *ssl" "const char *hint"
19.Ft void
20.Fo SSL_CTX_set_psk_server_callback
21.Fa "SSL_CTX *ctx"
22.Fa "unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)"
23.Fc
24.Ft void
25.Fo SSL_set_psk_server_callback
26.Fa "SSL *ssl"
27.Fa "unsigned int (*callback)(SSL *ssl, const char *identity, unsigned char *psk, int max_psk_len)"
28.Fc
29.Sh DESCRIPTION
30.Fn SSL_CTX_use_psk_identity_hint
31sets the given
32.Dv NULL Ns
33-terminated PSK identity hint
34.Fa hint
35to SSL context object
36.Fa ctx .
37.Fn SSL_use_psk_identity_hint
38sets the given
39.Dv NULL Ns
40-terminated
41PSK identity hint
42.Fa hint
43to SSL connection object
44.Fa ssl .
45If
46.Fa hint
47is
48.Dv NULL
49the current hint from
50.Fa ctx
51or
52.Fa ssl
53is deleted.
54.Pp
55In the case where PSK identity hint is
56.Dv NULL ,
57the server does not send the
58.Em ServerKeyExchange
59message to the client.
60.Pp
61A server application must provide a callback function which is called when the
62server receives the
63.Em ClientKeyExchange
64message from the client.
65The purpose of the callback function is to validate the received PSK identity
66and to fetch the pre-shared key used during the connection setup phase.
67The callback is set using functions
68.Fn SSL_CTX_set_psk_server_callback
69or
70.Fn SSL_set_psk_server_callback .
71The callback function is given the connection in parameter
72.Fa ssl ,
73.Dv NULL Ns
74-terminated PSK identity sent by the client in parameter
75.Fa identity ,
76and a buffer
77.Fa psk
78of length
79.Fa max_psk_len
80bytes where the pre-shared key is to be stored.
81.Sh RETURN VALUES
82.Fn SSL_CTX_use_psk_identity_hint
83and
84.Fn SSL_use_psk_identity_hint
85return 1 on success, 0 otherwise.
86.Pp
87Return values from the server callback are interpreted as follows:
88.Bl -tag -width Ds
89.It >0
90PSK identity was found and the server callback has provided the PSK
91successfully in parameter
92.Fa psk .
93Return value is the length of
94.Fa psk
95in bytes.
96It is an error to return a value greater than
97.Fa max_psk_len .
98.Pp
99If the PSK identity was not found but the callback instructs the protocol to
100continue anyway, the callback must provide some random data to
101.Fa psk
102and return the length of the random data, so the connection will fail with
103.Dq decryption_error
104before it will be finished completely.
105.It 0
106PSK identity was not found.
107An
108.Dq unknown_psk_identity
109alert message will be sent and the connection setup fails.
110.El
diff --git a/src/lib/libssl/man/SSL_get_psk_identity.3 b/src/lib/libssl/man/SSL_get_psk_identity.3
deleted file mode 100644
index a2f91ee1c7..0000000000
--- a/src/lib/libssl/man/SSL_get_psk_identity.3
+++ /dev/null
@@ -1,44 +0,0 @@
1.\"
2.\" $OpenBSD: SSL_get_psk_identity.3,v 1.1 2016/11/05 15:32:20 schwarze Exp $
3.\"
4.Dd $Mdocdate: November 5 2016 $
5.Dt SSL_GET_PSK_IDENTITY 3
6.Os
7.Sh NAME
8.Nm SSL_get_psk_identity ,
9.Nm SSL_get_psk_identity_hint
10.Nd get PSK client identity and hint
11.Sh SYNOPSIS
12.In openssl/ssl.h
13.Ft const char *
14.Fn SSL_get_psk_identity_hint "const SSL *ssl"
15.Ft const char *
16.Fn SSL_get_psk_identity "const SSL *ssl"
17.Sh DESCRIPTION
18.Fn SSL_get_psk_identity_hint
19is used to retrieve the PSK identity hint used during the connection setup
20related to
21.Vt SSL
22object
23.Fa ssl .
24Similarly,
25.Fn SSL_get_psk_identity
26is used to retrieve the PSK identity used during the connection setup.
27.Sh RETURN VALUES
28If
29.Pf non- Dv NULL ,
30.Fn SSL_get_psk_identity_hint
31returns the PSK identity hint and
32.Fn SSL_get_psk_identity
33returns the PSK identity.
34Both are
35.Dv NULL Ns -terminated.
36.Fn SSL_get_psk_identity_hint
37may return
38.Dv NULL
39if no PSK identity hint was used during the connection setup.
40.Pp
41Note that the return value is valid only during the lifetime of the
42.Vt SSL
43object
44.Fa ssl .
diff --git a/src/lib/libssl/man/ssl.3 b/src/lib/libssl/man/ssl.3
index 77a24144fe..283340e228 100644
--- a/src/lib/libssl/man/ssl.3
+++ b/src/lib/libssl/man/ssl.3
@@ -1,7 +1,7 @@
1.\" 1.\"
2.\" $OpenBSD: ssl.3,v 1.2 2016/11/30 16:21:53 schwarze Exp $ 2.\" $OpenBSD: ssl.3,v 1.3 2016/12/01 16:02:14 schwarze Exp $
3.\" 3.\"
4.Dd $Mdocdate: November 30 2016 $ 4.Dd $Mdocdate: December 1 2016 $
5.Dt SSL 3 5.Dt SSL 3
6.Os 6.Os
7.Sh NAME 7.Sh NAME
@@ -594,26 +594,6 @@ session instead of a context.
594.Ft int 594.Ft int
595.Fn SSL_CTX_use_certificate_file "SSL_CTX *ctx" "char *file" "int type" 595.Fn SSL_CTX_use_certificate_file "SSL_CTX *ctx" "char *file" "int type"
596.Xc 596.Xc
597.It Xo
598.Ft void
599.Fo SSL_CTX_set_psk_client_callback
600.Fa "SSL_CTX *ctx"
601.Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \
602unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)"
603.Fc
604.Xc
605.It Xo
606.Ft int
607.Fn SSL_CTX_use_psk_identity_hint "SSL_CTX *ctx" "const char *hint"
608.Xc
609.It Xo
610.Ft void
611.Fo SSL_CTX_set_psk_server_callback
612.Fa "SSL_CTX *ctx"
613.Fa "unsigned int (*callback)(SSL *ssl, const char *identity, \
614unsigned char *psk, int max_psk_len)"
615.Fc
616.Xc
617.El 597.El
618.Ss DEALING WITH SESSIONS 598.Ss DEALING WITH SESSIONS
619Here we document the various API functions which deal with the SSL/TLS sessions 599Here we document the various API functions which deal with the SSL/TLS sessions
@@ -1159,34 +1139,6 @@ size_t len, SSL *ssl, void *arg)"
1159.Ft int 1139.Ft int
1160.Fn SSL_write "SSL *ssl" "const void *buf" "int num" 1140.Fn SSL_write "SSL *ssl" "const void *buf" "int num"
1161.Xc 1141.Xc
1162.It Xo
1163.Ft void
1164.Fo SSL_set_psk_client_callback
1165.Fa "SSL *ssl"
1166.Fa "unsigned int (*callback)(SSL *ssl, const char *hint, char *identity, \
1167unsigned int max_identity_len, unsigned char *psk, unsigned int max_psk_len)"
1168.Fc
1169.Xc
1170.It Xo
1171.Ft int
1172.Fn SSL_use_psk_identity_hint "SSL *ssl" "const char *hint"
1173.Xc
1174.It Xo
1175.Ft void
1176.Fo SSL_set_psk_server_callback
1177.Fa "SSL *ssl"
1178.Fa "unsigned int (*callback)(SSL *ssl, const char *identity, \
1179unsigned char *psk, int max_psk_len)"
1180.Fc
1181.Xc
1182.It Xo
1183.Ft const char *
1184.Fn SSL_get_psk_identity_hint "SSL *ssl"
1185.Xc
1186.It Xo
1187.Ft const char *
1188.Fn SSL_get_psk_identity "SSL *ssl"
1189.Xc
1190.El 1142.El
1191.Sh SEE ALSO 1143.Sh SEE ALSO
1192.Xr openssl 1 , 1144.Xr openssl 1 ,
@@ -1222,7 +1174,6 @@ unsigned char *psk, int max_psk_len)"
1222.Xr SSL_CTX_set_mode 3 , 1174.Xr SSL_CTX_set_mode 3 ,
1223.Xr SSL_CTX_set_msg_callback 3 , 1175.Xr SSL_CTX_set_msg_callback 3 ,
1224.Xr SSL_CTX_set_options 3 , 1176.Xr SSL_CTX_set_options 3 ,
1225.Xr SSL_CTX_set_psk_client_callback 3 ,
1226.Xr SSL_CTX_set_quiet_shutdown 3 , 1177.Xr SSL_CTX_set_quiet_shutdown 3 ,
1227.Xr SSL_CTX_set_session_cache_mode 3 , 1178.Xr SSL_CTX_set_session_cache_mode 3 ,
1228.Xr SSL_CTX_set_session_id_context 3 , 1179.Xr SSL_CTX_set_session_id_context 3 ,
@@ -1232,7 +1183,6 @@ unsigned char *psk, int max_psk_len)"
1232.Xr SSL_CTX_set_tmp_rsa_callback 3 , 1183.Xr SSL_CTX_set_tmp_rsa_callback 3 ,
1233.Xr SSL_CTX_set_verify 3 , 1184.Xr SSL_CTX_set_verify 3 ,
1234.Xr SSL_CTX_use_certificate 3 , 1185.Xr SSL_CTX_use_certificate 3 ,
1235.Xr SSL_CTX_use_psk_identity_hint 3 ,
1236.Xr SSL_do_handshake 3 , 1186.Xr SSL_do_handshake 3 ,
1237.Xr SSL_get_ciphers 3 , 1187.Xr SSL_get_ciphers 3 ,
1238.Xr SSL_get_client_CA_list 3 , 1188.Xr SSL_get_client_CA_list 3 ,
@@ -1242,7 +1192,6 @@ unsigned char *psk, int max_psk_len)"
1242.Xr SSL_get_ex_new_index 3 , 1192.Xr SSL_get_ex_new_index 3 ,
1243.Xr SSL_get_fd 3 , 1193.Xr SSL_get_fd 3 ,
1244.Xr SSL_get_peer_cert_chain 3 , 1194.Xr SSL_get_peer_cert_chain 3 ,
1245.Xr SSL_get_psk_identity 3 ,
1246.Xr SSL_get_rbio 3 , 1195.Xr SSL_get_rbio 3 ,
1247.Xr SSL_get_session 3 , 1196.Xr SSL_get_session 3 ,
1248.Xr SSL_get_SSL_CTX 3 , 1197.Xr SSL_get_SSL_CTX 3 ,