2 * Copyright (C) 2004, 2005, 2008, 2009, 2010 Free Software Foundation,
5 * Author: Simon Josefsson
7 * This file is part of GnuTLS.
9 * GnuTLS is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
14 * GnuTLS is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with GnuTLS; if not, write to the Free Software Foundation,
21 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
32 #include <gnutls/openssl.h>
38 unsigned char md
[MD5_DIGEST_LENGTH
];
40 if (gnutls_global_init () != 0)
41 fail ("gnutls_global_init\n");
43 if (!gnutls_check_version (GNUTLS_VERSION
))
44 success ("gnutls_check_version ERROR\n");
47 MD5_Update (&c
, "abc", 3);
48 MD5_Final (&(md
[0]), &c
);
50 if (memcmp (md
, "\x90\x01\x50\x98\x3c\xd2\x4f\xb0"
51 "\xd6\x96\x3f\x7d\x28\xe1\x7f\x72", sizeof (md
)) != 0)
53 hexprint (md
, sizeof (md
));
54 fail ("MD5 failure\n");