Blame tests/system-override-hash.c

Packit Service 991b93
/*
Packit Service 991b93
 * Copyright (C) 2019 Red Hat, Inc.
Packit Service 991b93
 *
Packit Service 991b93
 * Author: Nikos Mavrogiannopoulos
Packit Service 991b93
 *
Packit Service 991b93
 * This file is part of GnuTLS.
Packit Service 991b93
 *
Packit Service 991b93
 * GnuTLS is free software; you can redistribute it and/or modify it
Packit Service 991b93
 * under the terms of the GNU General Public License as published by
Packit Service 991b93
 * the Free Software Foundation; either version 3 of the License, or
Packit Service 991b93
 * (at your option) any later version.
Packit Service 991b93
 *
Packit Service 991b93
 * GnuTLS is distributed in the hope that it will be useful, but
Packit Service 991b93
 * WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service 991b93
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit Service 991b93
 * General Public License for more details.
Packit Service 991b93
 *
Packit Service 991b93
 * You should have received a copy of the GNU General Public License
Packit Service 991b93
 * along with GnuTLS; if not, write to the Free Software Foundation,
Packit Service 991b93
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
Packit Service 991b93
 */
Packit Service 991b93
Packit Service 991b93
#ifdef HAVE_CONFIG_H
Packit Service 991b93
#include <config.h>
Packit Service 991b93
#endif
Packit Service 991b93
Packit Service 991b93
#include <stdio.h>
Packit Service 991b93
#include <stdlib.h>
Packit Service 991b93
#include <string.h>
Packit Service 991b93
#include <gnutls/gnutls.h>
Packit Service 991b93
Packit Service 991b93
#include "utils.h"
Packit Service 991b93
#include <assert.h>
Packit Service 991b93
Packit Service 991b93
/* This test verifies whether a system-wide configuration which disables SHA256
Packit Service 991b93
 * and SHA512 is seen from the library side.
Packit Service 991b93
 */
Packit Service 991b93
Packit Service 991b93
void doit(void)
Packit Service 991b93
{
Packit Service 991b93
	/* sanity */
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_RSA_PSS_SHA384) != 0);
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_RSA_MD5) == 0);
Packit Service 991b93
Packit Service 991b93
	/* check whether the values set by the calling script are the expected */
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_DSA_SHA256) == 0);
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_RSA_SHA256) == 0);
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_RSA_SHA512) == 0);
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_ECDSA_SHA256) == 0);
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_ECDSA_SHA512) == 0);
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_RSA_PSS_SHA256) == 0);
Packit Service 991b93
	assert(gnutls_sign_is_secure(GNUTLS_SIGN_RSA_PSS_SHA512) == 0);
Packit Service 991b93
}