|
Packit |
549fdc |
/*
|
|
Packit |
549fdc |
* Copyright (C) 2004-2012 Free Software Foundation, Inc.
|
|
Packit |
549fdc |
*
|
|
Packit |
549fdc |
* Author: Simon Josefsson
|
|
Packit |
549fdc |
*
|
|
Packit |
549fdc |
* This file is part of GnuTLS.
|
|
Packit |
549fdc |
*
|
|
Packit |
549fdc |
* GnuTLS is free software; you can redistribute it and/or modify it
|
|
Packit |
549fdc |
* under the terms of the GNU General Public License as published by
|
|
Packit |
549fdc |
* the Free Software Foundation; either version 3 of the License, or
|
|
Packit |
549fdc |
* (at your option) any later version.
|
|
Packit |
549fdc |
*
|
|
Packit |
549fdc |
* GnuTLS is distributed in the hope that it will be useful, but
|
|
Packit |
549fdc |
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
549fdc |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
549fdc |
* General Public License for more details.
|
|
Packit |
549fdc |
*
|
|
Packit |
549fdc |
* You should have received a copy of the GNU General Public License
|
|
Packit |
549fdc |
* along with GnuTLS; if not, write to the Free Software Foundation,
|
|
Packit |
549fdc |
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
Packit |
549fdc |
*/
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
#ifdef HAVE_CONFIG_H
|
|
Packit |
549fdc |
#include <config.h>
|
|
Packit |
549fdc |
#endif
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
#include <stdio.h>
|
|
Packit |
549fdc |
#include <stdlib.h>
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
#include "utils.h"
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
#include <gnutls/openssl.h>
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
void doit(void)
|
|
Packit |
549fdc |
{
|
|
Packit |
549fdc |
MD5_CTX c;
|
|
Packit |
549fdc |
unsigned char md[MD5_DIGEST_LENGTH];
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
if (gnutls_fips140_mode_enabled()) {
|
|
Packit |
549fdc |
exit(77);
|
|
Packit |
549fdc |
}
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
if (global_init() != 0)
|
|
Packit |
549fdc |
fail("global_init\n");
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
if (!gnutls_check_version(GNUTLS_VERSION))
|
|
Packit |
549fdc |
success("gnutls_check_version ERROR\n");
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
MD5_Init(&c);
|
|
Packit |
549fdc |
MD5_Update(&c, "abc", 3);
|
|
Packit |
549fdc |
MD5_Final(&(md[0]), &c);
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
if (memcmp(md, "\x90\x01\x50\x98\x3c\xd2\x4f\xb0"
|
|
Packit |
549fdc |
"\xd6\x96\x3f\x7d\x28\xe1\x7f\x72", sizeof(md)) != 0) {
|
|
Packit |
549fdc |
hexprint(md, sizeof(md));
|
|
Packit |
549fdc |
fail("MD5 failure\n");
|
|
Packit |
549fdc |
} else if (debug)
|
|
Packit |
549fdc |
success("MD5 OK\n");
|
|
Packit |
549fdc |
|
|
Packit |
549fdc |
gnutls_global_deinit();
|
|
Packit |
549fdc |
}
|