Changeset 4829
- Timestamp:
- Apr 30, 2014 8:21:28 AM (11 years ago)
- Location:
- pjproject/trunk/pjlib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/include/pj/ssl_sock.h
r4506 r4829 243 243 */ 244 244 typedef enum pj_ssl_cipher { 245 246 /* Unsupported cipher */ 247 PJ_TLS_UNKNOWN_CIPHER = -1, 245 248 246 249 /* NULL */ … … 354 357 355 358 /** 356 * Get cipher ID from cipher name string. 359 * Get cipher ID from cipher name string. Note that on different backends 360 * (e.g. OpenSSL or Symbian implementation), cipher names may not be 361 * equivalent for the same cipher ID. 357 362 * 358 363 * @param cipher_name The cipher name string. -
pjproject/trunk/pjlib/src/pj/ssl_sock_ossl.c
r4624 r4829 1889 1889 } 1890 1890 1891 /* Get cipher identifier */ 1892 PJ_DEF(pj_ssl_cipher) pj_ssl_cipher_id(const char *cipher_name) 1893 { 1894 unsigned i; 1895 1896 if (openssl_cipher_num == 0) { 1897 init_openssl(); 1898 shutdown_openssl(); 1899 } 1900 1901 for (i = 0; i < openssl_cipher_num; ++i) { 1902 if (!pj_ansi_stricmp(openssl_ciphers[i].name, cipher_name)) 1903 return openssl_ciphers[i].id; 1904 } 1905 1906 return PJ_TLS_UNKNOWN_CIPHER; 1907 } 1908 1891 1909 /* Check if the specified cipher is supported by SSL/TLS backend. */ 1892 1910 PJ_DEF(pj_bool_t) pj_ssl_cipher_is_supported(pj_ssl_cipher cipher) -
pjproject/trunk/pjlib/src/pj/ssl_sock_symbian.cpp
r3999 r4829 43 43 static cipher_name_t cipher_names[] = 44 44 { 45 {PJ_TLS_UNKNOWN_CIPHER, "UNKNOWN"}, 45 46 {PJ_TLS_NULL_WITH_NULL_NULL, "NULL"}, 46 47 … … 760 761 761 762 763 /* Get cipher identifier */ 764 PJ_DEF(pj_ssl_cipher) pj_ssl_cipher_id(const char *cipher_name) 765 { 766 unsigned i; 767 768 if (ciphers_num_ == 0) { 769 pj_ssl_cipher c[1]; 770 i = 0; 771 pj_ssl_cipher_get_availables(c, &i); 772 } 773 774 for (i = 0; i < ciphers_num_; ++i) { 775 if (!pj_ansi_stricmp(ciphers_[i].name, cipher_name)) 776 return ciphers_[i].id; 777 } 778 779 return PJ_TLS_UNKNOWN_CIPHER; 780 } 781 782 762 783 /* Check if the specified cipher is supported by SSL/TLS backend. */ 763 784 PJ_DEF(pj_bool_t) pj_ssl_cipher_is_supported(pj_ssl_cipher cipher)
Note: See TracChangeset
for help on using the changeset viewer.