Changeset 5285 for pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
- Timestamp:
- May 10, 2016 6:32:30 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r5238 r5285 838 838 static pj_status_t set_cipher_list(pj_ssl_sock_t *ssock) 839 839 { 840 char buf[1024]; 840 pj_pool_t *tmp_pool = NULL; 841 char *buf = NULL; 842 enum { BUF_SIZE = 8192 }; 841 843 pj_str_t cipher_list; 842 844 STACK_OF(SSL_CIPHER) *sk_cipher; … … 852 854 return PJ_SUCCESS; 853 855 } 856 857 /* Create temporary pool. */ 858 tmp_pool = pj_pool_create(ssock->pool->factory, "ciphpool", BUF_SIZE, 859 BUF_SIZE/2 , NULL); 860 if (!tmp_pool) 861 return PJ_ENOMEM; 862 863 buf = (char *)pj_pool_zalloc(tmp_pool, BUF_SIZE); 854 864 855 865 pj_strset(&cipher_list, buf, 0); … … 873 883 /* Check buffer size */ 874 884 if (cipher_list.slen + pj_ansi_strlen(c_name) + 2 > 875 sizeof(buf))885 BUF_SIZE) 876 886 { 877 887 pj_assert(!"Insufficient temporary buffer for cipher"); … … 896 906 ret = SSL_set_cipher_list(ssock->ossl_ssl, buf); 897 907 if (ret < 1) { 908 pj_pool_release(tmp_pool); 898 909 return GET_SSL_STATUS(ssock); 899 910 } 900 911 912 pj_pool_release(tmp_pool); 901 913 return PJ_SUCCESS; 902 914 }
Note: See TracChangeset
for help on using the changeset viewer.