summaryrefslogtreecommitdiffstats
path: root/crypto/md2/md2_one.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/md2/md2_one.c')
-rw-r--r--crypto/md2/md2_one.c16
1 files changed, 16 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);