Changeset 5990 for pjproject/trunk/pjlib/src/pj/ssl_sock_imp_common.c
- Timestamp:
- May 15, 2019 2:43:01 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjlib/src/pj/ssl_sock_imp_common.c
r5980 r5990 597 597 } 598 598 599 600 static void wipe_buf(pj_str_t *buf) 601 { 602 volatile char *p = buf->ptr; 603 pj_ssize_t len = buf->slen; 604 while (len--) *p++ = 0; 605 buf->slen = 0; 606 } 607 608 static void wipe_cert_buffer(pj_ssl_cert_t *cert) 609 { 610 wipe_buf(&cert->CA_file); 611 wipe_buf(&cert->CA_path); 612 wipe_buf(&cert->cert_file); 613 wipe_buf(&cert->privkey_file); 614 wipe_buf(&cert->privkey_pass); 615 wipe_buf(&cert->CA_buf); 616 wipe_buf(&cert->cert_buf); 617 wipe_buf(&cert->privkey_buf); 618 } 619 599 620 static void ssl_on_destroy(void *arg) 600 621 { … … 614 635 } 615 636 616 pj_pool_safe_release(&ssock->pool); 637 /* Wipe out cert & key buffer, note that they may not be allocated 638 * using SSL socket memory pool. 639 */ 640 if (ssock->cert) { 641 wipe_cert_buffer(ssock->cert); 642 } 643 644 /* Secure release pool, i.e: all memory blocks will be zeroed first */ 645 pj_pool_secure_release(&ssock->pool); 617 646 } 618 647
Note: See TracChangeset
for help on using the changeset viewer.