diff options
author | Ulf Möller <ulf@openssl.org> | 1999-06-04 23:35:58 +0200 |
---|---|---|
committer | Ulf Möller <ulf@openssl.org> | 1999-06-04 23:35:58 +0200 |
commit | a53955d8abd68c604de02cc1e101c66169207fb7 (patch) | |
tree | e51051484f2b073f7b58a1549442bf0657ca2978 /crypto/md2 | |
parent | Generate no-xxx options for missing ciphers. (diff) | |
download | openssl-a53955d8abd68c604de02cc1e101c66169207fb7.tar.xz openssl-a53955d8abd68c604de02cc1e101c66169207fb7.zip |
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/md2')
-rw-r--r-- | crypto/md2/md2_one.c | 16 | ||||
-rw-r--r-- | crypto/md2/md2test.c | 4 |
2 files changed, 20 insertions, 0 deletions
diff --git a/crypto/md2/md2_one.c b/crypto/md2/md2_one.c index 17b288bad8..7157299d95 100644 --- a/crypto/md2/md2_one.c +++ b/crypto/md2/md2_one.c @@ -70,7 +70,23 @@ unsigned char *MD2(unsigned char *d, unsigned long n, unsigned char *md) if (md == NULL) md=m; MD2_Init(&c); +#ifndef CHARSET_EBCDIC MD2_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); + MD2_Update(&c,temp,chunk); + n -= chunk; + d += chunk; + } + } +#endif MD2_Final(md,&c); memset(&c,0,sizeof(c)); /* Security consideration */ return(md); diff --git a/crypto/md2/md2test.c b/crypto/md2/md2test.c index 63404b1833..461d124957 100644 --- a/crypto/md2/md2test.c +++ b/crypto/md2/md2test.c @@ -69,6 +69,10 @@ int main(int argc, char *argv[]) #else #include <openssl/md2.h> +#ifdef CHARSET_EBCDIC +#include <openssl/ebcdic.h> +#endif + char *test[]={ "", "a", |