diff options
author | pjd <pjd@FreeBSD.org> | 2006-03-30 18:50:00 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2006-03-30 18:50:00 +0000 |
commit | f0667561aafda6d724304328a9441ef3d978e30e (patch) | |
tree | bb9b3ea2cc737d070700319b9e702f431b62176a | |
parent | e23555c1ae0ad4ec7daf34e76d9e2f44b33043a9 (diff) | |
download | FreeBSD-src-f0667561aafda6d724304328a9441ef3d978e30e.zip FreeBSD-src-f0667561aafda6d724304328a9441ef3d978e30e.tar.gz |
Revert previous change, as I fixed MD5(9).
-rw-r--r-- | sys/geom/eli/g_eli.h | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/geom/eli/g_eli.h b/sys/geom/eli/g_eli.h index 4f56b36..363b38b 100644 --- a/sys/geom/eli/g_eli.h +++ b/sys/geom/eli/g_eli.h @@ -159,7 +159,6 @@ static __inline void eli_metadata_encode(struct g_eli_metadata *md, u_char *data) { MD5_CTX ctx; - uint32_t hash[4]; /* Need proper aligment here. */ u_char *p; p = data; @@ -176,15 +175,13 @@ eli_metadata_encode(struct g_eli_metadata *md, u_char *data) bcopy(md->md_mkeys, p, sizeof(md->md_mkeys)); p += sizeof(md->md_mkeys); MD5Init(&ctx); MD5Update(&ctx, data, p - data); - MD5Final((u_char *)hash, &ctx); - bcopy(hash, md->md_hash, sizeof(md->md_hash)); + MD5Final(md->md_hash, &ctx); bcopy(md->md_hash, p, sizeof(md->md_hash)); } static __inline int eli_metadata_decode_v0(const u_char *data, struct g_eli_metadata *md) { MD5_CTX ctx; - uint32_t hash[4]; /* Need proper aligment here. */ const u_char *p; p = data + sizeof(md->md_magic) + sizeof(md->md_version); @@ -199,8 +196,7 @@ eli_metadata_decode_v0(const u_char *data, struct g_eli_metadata *md) bcopy(p, md->md_mkeys, sizeof(md->md_mkeys)); p += sizeof(md->md_mkeys); MD5Init(&ctx); MD5Update(&ctx, data, p - data); - MD5Final((u_char *)hash, &ctx); - bcopy(hash, md->md_hash, sizeof(md->md_hash)); + MD5Final(md->md_hash, &ctx); if (bcmp(md->md_hash, p, 16) != 0) return (EINVAL); return (0); |