diff options
Diffstat (limited to 'src/daemon/https/tls/gnutls_record.c')
-rw-r--r-- | src/daemon/https/tls/gnutls_record.c | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/src/daemon/https/tls/gnutls_record.c b/src/daemon/https/tls/gnutls_record.c index 80d5f70f..e1667105 100644 --- a/src/daemon/https/tls/gnutls_record.c +++ b/src/daemon/https/tls/gnutls_record.c | |||
@@ -81,24 +81,6 @@ MHD__gnutls_transport_set_lowat (MHD_gtls_session_t session, int num) | |||
81 | } | 81 | } |
82 | 82 | ||
83 | /** | 83 | /** |
84 | * MHD_gtls_record_disable_padding - Used to disabled padding in TLS 1.0 and above | ||
85 | * @session: is a #MHD_gtls_session_t structure. | ||
86 | * | ||
87 | * Used to disabled padding in TLS 1.0 and above. Normally you do | ||
88 | * not need to use this function, but there are buggy clients that | ||
89 | * complain if a server pads the encrypted data. This of course will | ||
90 | * disable protection against statistical attacks on the data. | ||
91 | * | ||
92 | * Normally only servers that require maximum compatibility with everything | ||
93 | * out there, need to call this function. | ||
94 | **/ | ||
95 | void | ||
96 | MHD_gtls_record_disable_padding (MHD_gtls_session_t session) | ||
97 | { | ||
98 | session->internals.priorities.no_padding = 1; | ||
99 | } | ||
100 | |||
101 | /** | ||
102 | * MHD__gnutls_transport_set_ptr - Used to set first argument of the transport functions | 84 | * MHD__gnutls_transport_set_ptr - Used to set first argument of the transport functions |
103 | * @session: is a #MHD_gtls_session_t structure. | 85 | * @session: is a #MHD_gtls_session_t structure. |
104 | * @ptr: is the value. | 86 | * @ptr: is the value. |
@@ -116,26 +98,6 @@ MHD__gnutls_transport_set_ptr (MHD_gtls_session_t session, | |||
116 | } | 98 | } |
117 | 99 | ||
118 | /** | 100 | /** |
119 | * MHD__gnutls_transport_set_ptr2 - Used to set first argument of the transport functions | ||
120 | * @session: is a #MHD_gtls_session_t structure. | ||
121 | * @recv_ptr: is the value for the pull function | ||
122 | * @send_ptr: is the value for the push function | ||
123 | * | ||
124 | * Used to set the first argument of the transport function (like | ||
125 | * PUSH and PULL). In berkeley style sockets this function will set | ||
126 | * the connection handle. With this function you can use two | ||
127 | * different pointers for receiving and sending. | ||
128 | **/ | ||
129 | void | ||
130 | MHD__gnutls_transport_set_ptr2 (MHD_gtls_session_t session, | ||
131 | MHD_gnutls_transport_ptr_t recv_ptr, | ||
132 | MHD_gnutls_transport_ptr_t send_ptr) | ||
133 | { | ||
134 | session->internals.transport_send_ptr = send_ptr; | ||
135 | session->internals.transport_recv_ptr = recv_ptr; | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * MHD__gnutls_bye - This function terminates the current TLS/SSL connection. | 101 | * MHD__gnutls_bye - This function terminates the current TLS/SSL connection. |
140 | * @session: is a #MHD_gtls_session_t structure. | 102 | * @session: is a #MHD_gtls_session_t structure. |
141 | * @how: is an integer | 103 | * @how: is an integer |
@@ -1128,59 +1090,3 @@ MHD__gnutls_record_recv (MHD_gtls_session_t session, void *data, | |||
1128 | sizeofdata); | 1090 | sizeofdata); |
1129 | } | 1091 | } |
1130 | 1092 | ||
1131 | /** | ||
1132 | * MHD__gnutls_record_get_max_size - returns the maximum record size | ||
1133 | * @session: is a #MHD_gtls_session_t structure. | ||
1134 | * | ||
1135 | * This function returns the maximum record packet size in this | ||
1136 | * connection. The maximum record size is negotiated by the client | ||
1137 | * after the first handshake message. | ||
1138 | **/ | ||
1139 | size_t | ||
1140 | MHD__gnutls_record_get_max_size (MHD_gtls_session_t session) | ||
1141 | { | ||
1142 | /* Recv will hold the negotiated max record size | ||
1143 | * always. | ||
1144 | */ | ||
1145 | return session->security_parameters.max_record_recv_size; | ||
1146 | } | ||
1147 | |||
1148 | /** | ||
1149 | * MHD__gnutls_record_set_max_size - sets the maximum record size | ||
1150 | * @session: is a #MHD_gtls_session_t structure. | ||
1151 | * @size: is the new size | ||
1152 | * | ||
1153 | * This function sets the maximum record packet size in this | ||
1154 | * connection. This property can only be set to clients. The server | ||
1155 | * may choose not to accept the requested size. | ||
1156 | * | ||
1157 | * Acceptable values are 512(=2^9), 1024(=2^10), 2048(=2^11) and | ||
1158 | * 4096(=2^12). Returns 0 on success. The requested record size does | ||
1159 | * get in effect immediately only while sending data. The receive | ||
1160 | * part will take effect after a successful handshake. | ||
1161 | * | ||
1162 | * This function uses a TLS extension called 'max record size'. Not | ||
1163 | * all TLS implementations use or even understand this extension. | ||
1164 | **/ | ||
1165 | ssize_t | ||
1166 | MHD__gnutls_record_set_max_size (MHD_gtls_session_t session, size_t size) | ||
1167 | { | ||
1168 | ssize_t new_size; | ||
1169 | |||
1170 | if (session->security_parameters.entity == GNUTLS_SERVER) | ||
1171 | return GNUTLS_E_INVALID_REQUEST; | ||
1172 | |||
1173 | new_size = MHD_gtls_mre_record2num (size); | ||
1174 | |||
1175 | if (new_size < 0) | ||
1176 | { | ||
1177 | MHD_gnutls_assert (); | ||
1178 | return new_size; | ||
1179 | } | ||
1180 | |||
1181 | session->security_parameters.max_record_send_size = size; | ||
1182 | |||
1183 | session->internals.proposed_record_size = size; | ||
1184 | |||
1185 | return 0; | ||
1186 | } | ||