From: Nikos Mavrogiannopoulos Date: Fri, 10 Feb 2012 09:44:21 +0000 (+0100) Subject: use updated api X-Git-Tag: gnutls_3_0_13~95 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cfab8fce9c36a4e350b3dfc31b450e9b44039eae;p=thirdparty%2Fgnutls.git use updated api --- diff --git a/doc/examples/ex-verify-ssh.c b/doc/examples/ex-verify-ssh.c index fb211c5746..4816a21c91 100644 --- a/doc/examples/ex-verify-ssh.c +++ b/doc/examples/ex-verify-ssh.c @@ -94,8 +94,7 @@ _ssh_verify_certificate_callback (gnutls_session_t session) /* service may be obtained alternatively using getservbyport() */ ret = gnutls_verify_stored_pubkey(NULL, hostname, "https", - GNUTLS_CRT_X509, &cert_list[0], - 0, 0); + GNUTLS_CRT_X509, &cert_list[0], 0); if (ret == GNUTLS_E_NO_CERTIFICATE_FOUND) { fprintf(stderr, "Host %s is not known.", hostname); @@ -130,7 +129,8 @@ _ssh_verify_certificate_callback (gnutls_session_t session) /* user trusts the key -> store it */ if (ret != 0) { - ret = gnutls_store_pubkey(NULL, hostname, "https", GNUTLS_CRT_X509, &cert_list[0], 0); + ret = gnutls_store_pubkey(NULL, hostname, "https", GNUTLS_CRT_X509, &cert_list[0], + 0, 0); if (ret < 0) fprintf(stderr, "gnutls_store_pubkey: %s\n", gnutls_strerror(ret)); } diff --git a/src/cli.c b/src/cli.c index a2d653b9b9..c9c70309d9 100644 --- a/src/cli.c +++ b/src/cli.c @@ -488,12 +488,12 @@ cert_verify_callback (gnutls_session_t session) return -1; } - rc = gnutls_verify_stored_pubkey(NULL, NULL, hostname, service, GNUTLS_CRT_X509, + rc = gnutls_verify_stored_pubkey(NULL, hostname, service, GNUTLS_CRT_X509, cert, 0); if (rc == GNUTLS_E_NO_CERTIFICATE_FOUND) { print_cert_info_compact(session); - fprintf(stderr, "Host %s has never been contacted before and is not in the trusted list.\n", hostname); + fprintf(stderr, "Host %s has never been contacted before.\n", hostname); if (status == 0) fprintf(stderr, "Its certificate is valid for %s.\n", hostname); @@ -521,7 +521,7 @@ cert_verify_callback (gnutls_session_t session) if (rc != 0) { - rc = gnutls_store_pubkey(NULL, NULL, hostname, service, GNUTLS_CRT_X509, cert, 0); + rc = gnutls_store_pubkey(NULL, hostname, service, GNUTLS_CRT_X509, cert, 0, 0); if (rc < 0) fprintf(stderr, "Could not store key: %s\n", gnutls_strerror(rc)); }