Mercurial > hg > nginx
comparison src/core/ngx_md5.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 |
---|---|
105 result[12] = (u_char) ctx->d; | 105 result[12] = (u_char) ctx->d; |
106 result[13] = (u_char) (ctx->d >> 8); | 106 result[13] = (u_char) (ctx->d >> 8); |
107 result[14] = (u_char) (ctx->d >> 16); | 107 result[14] = (u_char) (ctx->d >> 16); |
108 result[15] = (u_char) (ctx->d >> 24); | 108 result[15] = (u_char) (ctx->d >> 24); |
109 | 109 |
110 ngx_memzero(ctx, sizeof(*ctx)); | 110 ngx_explicit_memzero(ctx, sizeof(*ctx)); |
111 } | 111 } |
112 | 112 |
113 | 113 |
114 /* | 114 /* |
115 * The basic MD5 functions. | 115 * The basic MD5 functions. |