diff options
author | Ulf Möller <ulf@openssl.org> | 1999-06-04 21:35:58 +0000 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-06-04 21:35:58 +0000 |
commit | a53955d8abd68c604de02cc1e101c66169207fb7 (patch) | |
tree | e51051484f2b073f7b58a1549442bf0657ca2978 /crypto/md5/md5_one.c | |
parent | 9231f4779677a3cb95a4f8ccebd56432cb914498 (diff) |
Support the EBCDIC character set and BS2000/OSD-POSIX (work in progress).
Submitted by: Martin Kraemer <Martin.Kraemer@MchP.Siemens.De>
Diffstat (limited to 'crypto/md5/md5_one.c')
-rw-r--r-- | crypto/md5/md5_one.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/crypto/md5/md5_one.c b/crypto/md5/md5_one.c index c98721f4d8..4b10e7f940 100644 --- a/crypto/md5/md5_one.c +++ b/crypto/md5/md5_one.c @@ -60,6 +60,10 @@ #include <string.h> #include <openssl/md5.h> +#ifdef CHARSET_EBCDIC +#include <openssl/ebcdic.h> +#endif + unsigned char *MD5(unsigned char *d, unsigned long n, unsigned char *md) { MD5_CTX c; @@ -67,7 +71,23 @@ unsigned char *MD5(unsigned char *d, unsigned long n, unsigned char *md) if (md == NULL) md=m; MD5_Init(&c); +#ifndef CHARSET_EBCDIC MD5_Update(&c,d,n); +#else + { + char temp[1024]; + unsigned long chunk; + + while (n > 0) + { + chunk = (n > sizeof(temp)) ? sizeof(temp) : n; + ebcdic2ascii(temp, d, chunk); + MD5_Update(&c,temp,chunk); + n -= chunk; + d += chunk; + } + } +#endif MD5_Final(md,&c); memset(&c,0,sizeof(c)); /* security consideration */ return(md); |