diff options
author | Richard Levitte <levitte@openssl.org> | 2015-11-27 14:02:12 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2015-12-07 17:39:23 +0100 |
commit | 6e59a892db781658c050e5217127c4147c116ac9 (patch) | |
tree | eec9e79e1c71f9c2897f49b29084bf42a66e96db /test/mdc2test.c | |
parent | Document the changed HMAC API. (diff) | |
download | openssl-6e59a892db781658c050e5217127c4147c116ac9.tar.xz openssl-6e59a892db781658c050e5217127c4147c116ac9.zip |
Adjust all accesses to EVP_MD_CTX to use accessor functions.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'test/mdc2test.c')
-rw-r--r-- | test/mdc2test.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/test/mdc2test.c b/test/mdc2test.c index a0d77a30ec..4cf952c3f5 100644 --- a/test/mdc2test.c +++ b/test/mdc2test.c @@ -95,17 +95,17 @@ int main(int argc, char *argv[]) int ret = 0; unsigned char md[MDC2_DIGEST_LENGTH]; int i; - EVP_MD_CTX c; + EVP_MD_CTX *c; static char *text = "Now is the time for all "; # ifdef CHARSET_EBCDIC ebcdic2ascii(text, text, strlen(text)); # endif - EVP_MD_CTX_init(&c); - EVP_DigestInit_ex(&c, EVP_mdc2(), NULL); - EVP_DigestUpdate(&c, (unsigned char *)text, strlen(text)); - EVP_DigestFinal_ex(&c, &(md[0]), NULL); + c = EVP_MD_CTX_create(); + EVP_DigestInit_ex(c, EVP_mdc2(), NULL); + EVP_DigestUpdate(c, (unsigned char *)text, strlen(text)); + EVP_DigestFinal_ex(c, &(md[0]), NULL); if (memcmp(md, pad1, MDC2_DIGEST_LENGTH) != 0) { for (i = 0; i < MDC2_DIGEST_LENGTH; i++) @@ -118,11 +118,11 @@ int main(int argc, char *argv[]) } else printf("pad1 - ok\n"); - EVP_DigestInit_ex(&c, EVP_mdc2(), NULL); + EVP_DigestInit_ex(c, EVP_mdc2(), NULL); /* FIXME: use a ctl function? */ - ((MDC2_CTX *)c.md_data)->pad_type = 2; - EVP_DigestUpdate(&c, (unsigned char *)text, strlen(text)); - EVP_DigestFinal_ex(&c, &(md[0]), NULL); + ((MDC2_CTX *)EVP_MD_CTX_md_data(c))->pad_type = 2; + EVP_DigestUpdate(c, (unsigned char *)text, strlen(text)); + EVP_DigestFinal_ex(c, &(md[0]), NULL); if (memcmp(md, pad2, MDC2_DIGEST_LENGTH) != 0) { for (i = 0; i < MDC2_DIGEST_LENGTH; i++) @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) } else printf("pad2 - ok\n"); - EVP_MD_CTX_cleanup(&c); + EVP_MD_CTX_destroy(c); # ifdef OPENSSL_SYS_NETWARE if (ret) printf("ERROR: %d\n", ret); |