diff options
author | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-05-21 08:22:08 +0200 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@redhat.com> | 2019-05-21 08:22:08 +0200 |
commit | 1d3452d69670e28edfcaa232847036f600bbe1e8 (patch) | |
tree | c52d1a8fb30559e53b2117e8df68cdcbf91982e5 | |
parent | b1476abeb6f8b5046e6cd62724cdac241f71aa7b (diff) | |
download | gnutls-1d3452d69670e28edfcaa232847036f600bbe1e8.tar.gz |
tests: verify functionality of GNUTLS_VERIFY_DISABLE_CA_SIGN flagtmp-remove-unused-flag
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
-rw-r--r-- | tests/sign-verify-data-newapi.c | 13 | ||||
-rw-r--r-- | tests/sign-verify-newapi.c | 17 |
2 files changed, 21 insertions, 9 deletions
diff --git a/tests/sign-verify-data-newapi.c b/tests/sign-verify-data-newapi.c index 5bc3f3088b..eca18974ee 100644 --- a/tests/sign-verify-data-newapi.c +++ b/tests/sign-verify-data-newapi.c @@ -15,9 +15,9 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with GnuTLS; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/> + * */ #ifdef HAVE_CONFIG_H @@ -126,6 +126,13 @@ void doit(void) if (ret < 0) testfail("gnutls_x509_pubkey_verify_data2\n"); + /* Test functionality of GNUTLS_VERIFY_DISABLE_CA_SIGN flag (see issue #754) */ + ret = + gnutls_pubkey_verify_data2(pubkey, tests[i].sigalgo, GNUTLS_VERIFY_DISABLE_CA_SIGN, &raw_data, + &signature); + if (ret < 0) + testfail("gnutls_x509_pubkey_verify_data2\n"); + /* should fail */ ret = gnutls_pubkey_verify_data2(pubkey, tests[i].sigalgo, 0, diff --git a/tests/sign-verify-newapi.c b/tests/sign-verify-newapi.c index 47ac3d983d..aa284006aa 100644 --- a/tests/sign-verify-newapi.c +++ b/tests/sign-verify-newapi.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2004-2012 Free Software Foundation, Inc. - * Copyright (C) 2017 Red Hat, Inc. + * Copyright (C) 2017-2019 Red Hat, Inc. * * Author: Nikos Mavrogiannopoulos, Simon Josefsson * @@ -16,13 +16,11 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with GnuTLS; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see <https://www.gnu.org/licenses/> + * */ -/* Parts copied from GnuTLS example programs. */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif @@ -172,6 +170,13 @@ void doit(void) if (ret < 0) testfail("gnutls_x509_pubkey_verify_hash2\n"); + /* Test functionality of GNUTLS_VERIFY_DISABLE_CA_SIGN (see issue #754) */ + ret = + gnutls_pubkey_verify_hash2(pubkey, tests[i].sigalgo, GNUTLS_VERIFY_DISABLE_CA_SIGN, hash_data, + &signature); + if (ret < 0) + testfail("gnutls_x509_pubkey_verify_hash2 with GNUTLS_VERIFY_DISABLE_CA_SIGN\n"); + ret = gnutls_pubkey_verify_hash2(pubkey, tests[i].sigalgo, GNUTLS_VERIFY_ALLOW_SIGN_WITH_SHA1, hash_data, &signature2); |