Changeset 6054
- Timestamp:
- Aug 28, 2019 12:02:50 PM (5 years ago)
- Location:
- pjproject/trunk/pjlib/src/pj
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ssl_sock_imp_common.c
r6004 r6054 1282 1282 pj_ioqueue_op_key_init(&ssock->handshake_op_key, 1283 1283 sizeof(pj_ioqueue_op_key_t)); 1284 pj_ioqueue_op_key_init(&ssock->shutdown_op_key, 1285 sizeof(pj_ioqueue_op_key_t)); 1284 1286 1285 1287 /* Create secure socket mutex */ -
pjproject/trunk/pjlib/src/pj/ssl_sock_imp_common.h
r6022 r6054 108 108 enum ssl_state ssl_state; 109 109 pj_ioqueue_op_key_t handshake_op_key; 110 pj_ioqueue_op_key_t shutdown_op_key; 110 111 pj_timer_entry timer; 111 112 pj_status_t verify_status; -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r6053 r6054 1169 1169 /* Destroy SSL instance */ 1170 1170 if (ossock->ossl_ssl) { 1171 /**1172 * Avoid calling SSL_shutdown() if handshake wasn't completed.1173 * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an1174 * SSL handshake, while previous versions always return 0.1175 */1176 if (SSL_in_init(ossock->ossl_ssl) == 0) {1177 SSL_shutdown(ossock->ossl_ssl);1178 }1179 1171 SSL_free(ossock->ossl_ssl); /* this will also close BIOs */ 1180 1172 ossock->ossl_ssl = NULL; … … 1197 1189 static void ssl_reset_sock_state(pj_ssl_sock_t *ssock) 1198 1190 { 1191 ossl_sock_t *ossock = (ossl_sock_t *)ssock; 1192 /** 1193 * Avoid calling SSL_shutdown() if handshake wasn't completed. 1194 * OpenSSL 1.0.2f complains if SSL_shutdown() is called during an 1195 * SSL handshake, while previous versions always return 0. 1196 */ 1197 if (ossock->ossl_ssl && SSL_in_init(ossock->ossl_ssl) == 0) { 1198 int ret = SSL_shutdown(ossock->ossl_ssl); 1199 if (ret == 0) { 1200 /* Flush data to send close notify. */ 1201 flush_circ_buf_output(ssock, &ssock->shutdown_op_key, 0, 0); 1202 } 1203 } 1204 1199 1205 pj_lock_acquire(ssock->write_mutex); 1200 1206 ssock->ssl_state = SSL_STATE_NULL;
Note: See TracChangeset
for help on using the changeset viewer.