- Timestamp:
- Jan 18, 2017 10:55:35 AM (8 years ago)
- Location:
- pjproject/branches/projects/uwp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/uwp
- Property svn:mergeinfo changed
/pjproject/trunk merged: 5516-5525,5527,5530-5531
- Property svn:mergeinfo changed
-
pjproject/branches/projects/uwp/pjsip/src/pjsua2/endpoint.cpp
r5513 r5532 45 45 /////////////////////////////////////////////////////////////////////////////// 46 46 47 TlsInfo::TlsInfo() 48 : empty(true) 49 { 50 } 51 52 bool TlsInfo::isEmpty() const 53 { 54 return empty; 55 } 56 57 void TlsInfo::fromPj(const pjsip_tls_state_info &info) 58 { 59 #if defined(PJ_HAS_SSL_SOCK) && PJ_HAS_SSL_SOCK != 0 60 pj_ssl_sock_info *ssock_info = info.ssl_sock_info; 61 char straddr[PJ_INET6_ADDRSTRLEN+10]; 62 const char *verif_msgs[32]; 63 unsigned verif_msg_cnt; 64 65 empty = false; 66 established = PJ2BOOL(ssock_info->established); 67 protocol = ssock_info->proto; 68 cipher = ssock_info->cipher; 69 cipherName = pj_ssl_cipher_name(ssock_info->cipher); 70 pj_sockaddr_print(&ssock_info->local_addr, straddr, sizeof(straddr), 3); 71 localAddr = straddr; 72 pj_sockaddr_print(&ssock_info->remote_addr, straddr, sizeof(straddr),3); 73 remoteAddr = straddr; 74 verifyStatus = ssock_info->verify_status; 75 if (ssock_info->local_cert_info) 76 localCertInfo.fromPj(*ssock_info->local_cert_info); 77 if (ssock_info->remote_cert_info) 78 remoteCertInfo.fromPj(*ssock_info->remote_cert_info); 79 80 /* Dump server TLS certificate verification result */ 81 verif_msg_cnt = PJ_ARRAY_SIZE(verif_msgs); 82 pj_ssl_cert_get_verify_status_strings(ssock_info->verify_status, 83 verif_msgs, &verif_msg_cnt); 84 for (unsigned i = 0; i < verif_msg_cnt; ++i) { 85 verifyMsgs.push_back(verif_msgs[i]); 86 } 87 #endif 88 } 89 90 SslCertInfo::SslCertInfo() 91 : empty(true) 92 { 93 } 94 95 bool SslCertInfo::isEmpty() const 96 { 97 return empty; 98 } 99 100 void SslCertInfo::fromPj(const pj_ssl_cert_info &info) 101 { 102 empty = false; 103 version = info.version; 104 pj_memcpy(serialNo, info.serial_no, sizeof(info.serial_no)); 105 subjectCn = pj2Str(info.subject.cn); 106 subjectInfo = pj2Str(info.subject.info); 107 issuerCn = pj2Str(info.issuer.cn); 108 issuerInfo = pj2Str(info.issuer.info); 109 validityStart.fromPj(info.validity.start); 110 validityEnd.fromPj(info.validity.end); 111 validityGmt = PJ2BOOL(info.validity.gmt); 112 raw = pj2Str(info.raw); 113 114 for (unsigned i = 0; i < info.subj_alt_name.cnt; i++) { 115 SslCertName cname; 116 cname.type = info.subj_alt_name.entry[i].type; 117 cname.name = pj2Str(info.subj_alt_name.entry[i].name); 118 subjectAltName.push_back(cname); 119 } 120 } 121 122 /////////////////////////////////////////////////////////////////////////////// 123 47 124 UaConfig::UaConfig() 48 125 : mainThreadOnly(false) … … 559 636 560 637 prm.hnd = (TransportHandle)tp; 638 prm.type = tp->type_name; 561 639 prm.state = state; 562 640 prm.lastError = info ? info->status : PJ_SUCCESS; 641 642 #if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 643 if (!pj_ansi_stricmp(tp->type_name, "tls") && info->ext_info && 644 (state == PJSIP_TP_STATE_CONNECTED || 645 ((pjsip_tls_state_info*)info->ext_info)-> 646 ssl_sock_info->verify_status != PJ_SUCCESS)) 647 { 648 prm.tlsInfo.fromPj(*((pjsip_tls_state_info*)info->ext_info)); 649 } 650 #endif 563 651 564 652 ep.onTransportState(prm); … … 1695 1783 } 1696 1784 1785 void Endpoint::transportShutdown(TransportHandle tp) throw(Error) 1786 { 1787 PJSUA2_CHECK_EXPR( pjsip_transport_shutdown((pjsip_transport *)tp) ); 1788 } 1789 1697 1790 /////////////////////////////////////////////////////////////////////////////// 1698 1791 /*
Note: See TracChangeset
for help on using the changeset viewer.