Klaus Demo nginx / 6c3838f
Core: ngx_explicit_memzero(). Maxim Dounin 3 years ago
3 changed file(s) with 12 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
20122012 }
20132013
20142014
2015 void
2016 ngx_explicit_memzero(void *buf, size_t n)
2017 {
2018 ngx_memzero(buf, n);
2019 ngx_memory_barrier();
2020 }
2021
2022
20152023 #if (NGX_MEMCPY_LIMIT)
20162024
20172025 void *
8686 */
8787 #define ngx_memzero(buf, n) (void) memset(buf, 0, n)
8888 #define ngx_memset(buf, c, n) (void) memset(buf, c, n)
89
90 void ngx_explicit_memzero(void *buf, size_t n);
8991
9092
9193 #if (NGX_MEMCPY_LIMIT)
10501050 ngx_close_file_n " \"%s\" failed", file->data);
10511051 }
10521052
1053 ngx_memzero(buf, NGX_SSL_PASSWORD_BUFFER_SIZE);
1053 ngx_explicit_memzero(buf, NGX_SSL_PASSWORD_BUFFER_SIZE);
10541054
10551055 return passwords;
10561056 }
10671067 pwd = passwords->elts;
10681068
10691069 for (i = 0; i < passwords->nelts; i++) {
1070 ngx_memzero(pwd[i].data, pwd[i].len);
1070 ngx_explicit_memzero(pwd[i].data, pwd[i].len);
10711071 }
10721072 }
10731073