Mercurial > hg > nginx
comparison src/core/ngx_sha1.c @ 9325:0086f8da5d8d
Usage of ngx_explicit_memzero() in internal md5 and sha1.
The goal of the context cleanup in ngx_md5_final() and ngx_sha1_final()
is to clear potentially sensitive data, so ngx_explicit_memzero() is
appropriate.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sat, 31 Aug 2024 00:30:44 +0300 |
parents | 9eefb38f0005 |
children |
comparison
equal
deleted
inserted
replaced
9324:03cdd806c0f2 | 9325:0086f8da5d8d |
---|---|
111 result[16] = (u_char) (ctx->e >> 24); | 111 result[16] = (u_char) (ctx->e >> 24); |
112 result[17] = (u_char) (ctx->e >> 16); | 112 result[17] = (u_char) (ctx->e >> 16); |
113 result[18] = (u_char) (ctx->e >> 8); | 113 result[18] = (u_char) (ctx->e >> 8); |
114 result[19] = (u_char) ctx->e; | 114 result[19] = (u_char) ctx->e; |
115 | 115 |
116 ngx_memzero(ctx, sizeof(*ctx)); | 116 ngx_explicit_memzero(ctx, sizeof(*ctx)); |
117 } | 117 } |
118 | 118 |
119 | 119 |
120 /* | 120 /* |
121 * Helper functions. | 121 * Helper functions. |