summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/md5/md5.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/md5/md5.c (renamed from src/lib/libcrypto/md5/md5_dgst.c)19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/lib/libcrypto/md5/md5_dgst.c b/src/lib/libcrypto/md5/md5.c
index 3cd4b1ba78..06516781a1 100644
--- a/src/lib/libcrypto/md5/md5_dgst.c
+++ b/src/lib/libcrypto/md5/md5.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: md5_dgst.c,v 1.19 2023/07/15 15:37:05 jsing Exp $ */ 1/* $OpenBSD: md5.c,v 1.6 2023/07/28 11:06:28 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -284,3 +284,20 @@ md5_block_data_order(MD5_CTX *c, const void *data_, size_t num)
284 } 284 }
285} 285}
286#endif 286#endif
287
288unsigned char *
289MD5(const unsigned char *d, size_t n, unsigned char *md)
290{
291 MD5_CTX c;
292 static unsigned char m[MD5_DIGEST_LENGTH];
293
294 if (md == NULL)
295 md = m;
296 if (!MD5_Init(&c))
297 return NULL;
298 MD5_Update(&c, d, n);
299 MD5_Final(md, &c);
300 explicit_bzero(&c, sizeof(c));
301 return (md);
302}
303LCRYPTO_ALIAS(MD5);