diff options
Diffstat (limited to 'pjlib/src/pj/ssl_sock_symbian.cpp')
-rw-r--r-- | pjlib/src/pj/ssl_sock_symbian.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pjlib/src/pj/ssl_sock_symbian.cpp b/pjlib/src/pj/ssl_sock_symbian.cpp index 47288fae..013318b2 100644 --- a/pjlib/src/pj/ssl_sock_symbian.cpp +++ b/pjlib/src/pj/ssl_sock_symbian.cpp @@ -42,6 +42,7 @@ typedef struct cipher_name_t { /* Cipher name constants */ static cipher_name_t cipher_names[] = { + {PJ_TLS_UNKNOWN_CIPHER, "UNKNOWN"}, {PJ_TLS_NULL_WITH_NULL_NULL, "NULL"}, /* TLS/SSLv3 */ @@ -759,6 +760,26 @@ PJ_DEF(const char*) pj_ssl_cipher_name(pj_ssl_cipher cipher) } +/* Get cipher identifier */ +PJ_DEF(pj_ssl_cipher) pj_ssl_cipher_id(const char *cipher_name) +{ + unsigned i; + + if (ciphers_num_ == 0) { + pj_ssl_cipher c[1]; + i = 0; + pj_ssl_cipher_get_availables(c, &i); + } + + for (i = 0; i < ciphers_num_; ++i) { + if (!pj_ansi_stricmp(ciphers_[i].name, cipher_name)) + return ciphers_[i].id; + } + + return PJ_TLS_UNKNOWN_CIPHER; +} + + /* Check if the specified cipher is supported by SSL/TLS backend. */ PJ_DEF(pj_bool_t) pj_ssl_cipher_is_supported(pj_ssl_cipher cipher) { |