diff options
author | Michael Paquier | 2020-12-14 03:38:13 +0000 |
---|---|---|
committer | Michael Paquier | 2020-12-14 03:38:13 +0000 |
commit | 9b584953e7bf91e342af87ef44606acd6206cd1c (patch) | |
tree | 878bf508cb9e6c6f484ea502ad3f383783d89120 /src/include | |
parent | df9274adf3096feafbbde2562311c8ab80405267 (diff) |
Improve some code around cryptohash functions
This adjusts some code related to recent changes for cryptohash
functions:
- Add a variable in md5.h to track down the size of a computed result,
moved from pgcrypto. Note that pg_md5_hash() assumed a result of this
size already.
- Call explicit_bzero() on the hashed data when freeing the context for
fallback implementations. For MD5, particularly, it would be annoying
to leave some non-zeroed data around.
- Clean up some code related to recent changes of uuid-ossp. .gitignore
still included md5.c and a comment was incorrect.
Discussion: https://postgr.es/m/X9HXKTgrvJvYO7Oh@paquier.xyz
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/common/md5.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/common/md5.h b/src/include/common/md5.h index 53036d2d17e..5dac70cbc50 100644 --- a/src/include/common/md5.h +++ b/src/include/common/md5.h @@ -16,6 +16,10 @@ #ifndef PG_MD5_H #define PG_MD5_H +/* Size of result generated by MD5 computation */ +#define MD5_DIGEST_LENGTH 16 + +/* password-related data */ #define MD5_PASSWD_CHARSET "0123456789abcdef" #define MD5_PASSWD_LEN 35 |