More enum documentation.
[gnutls.git] / tests / openssl.c
blob8d1d8d42282bd413a7474363b25175511b343aa8
1 /*
2 * Copyright (C) 2004, 2005, 2008, 2009, 2010 Free Software Foundation,
3 * Inc.
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
24 #ifdef HAVE_CONFIG_H
25 # include <config.h>
26 #endif
28 #include <stdio.h>
30 #include "utils.h"
32 #include <gnutls/openssl.h>
34 void
35 doit (void)
37 MD5_CTX c;
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");
46 MD5_Init (&c);
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");
56 else
57 success ("MD5 OK\n");