Kaydet (Commit) cf45dda9 authored tarafından Markus Mohrhard's avatar Markus Mohrhard

add MD5 hashing to generic digest class

Change-Id: If3abc80f8511d9c7bf0d5197ce28ef4cf60a6b45
Reviewed-on: https://gerrit.libreoffice.org/36792Reviewed-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
Tested-by: 's avatarMarkus Mohrhard <markus.mohrhard@googlemail.com>
üst da8aa9ea
...@@ -31,6 +31,8 @@ struct HashImpl ...@@ -31,6 +31,8 @@ struct HashImpl
{ {
switch (meType) switch (meType)
{ {
case HashType::MD5:
return HASH_AlgMD5;
case HashType::SHA1: case HashType::SHA1:
return HASH_AlgSHA1; return HASH_AlgSHA1;
case HashType::SHA256: case HashType::SHA256:
...@@ -48,6 +50,8 @@ struct HashImpl ...@@ -48,6 +50,8 @@ struct HashImpl
{ {
switch (meType) switch (meType)
{ {
case HashType::MD5:
return EVP_md5();
case HashType::SHA1: case HashType::SHA1:
return EVP_sha1(); return EVP_sha1();
case HashType::SHA256: case HashType::SHA256:
...@@ -121,6 +125,8 @@ size_t Hash::getLength() const ...@@ -121,6 +125,8 @@ size_t Hash::getLength() const
{ {
switch (mpImpl->meType) switch (mpImpl->meType)
{ {
case HashType::MD5:
return 16;
case HashType::SHA1: case HashType::SHA1:
return 20; return 20;
case HashType::SHA256: case HashType::SHA256:
......
...@@ -16,6 +16,7 @@ namespace comphelper { ...@@ -16,6 +16,7 @@ namespace comphelper {
enum class HashType enum class HashType
{ {
MD5,
SHA1, SHA1,
SHA256, SHA256,
SHA512 SHA512
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment