[arch-commits] Commit in yubico-c-client/trunk (2 files)

Christian Hesse eworm at archlinux.org
Wed Apr 15 21:24:11 UTC 2020


    Date: Wednesday, April 15, 2020 @ 21:24:10
  Author: eworm
Revision: 615061

upgpkg: yubico-c-client 2.15-5

fix `make check`

Added:
  yubico-c-client/trunk/0001-https-ify-urls-and-drop-v1-selftest.patch
Modified:
  yubico-c-client/trunk/PKGBUILD

------------------------------------------------+
 0001-https-ify-urls-and-drop-v1-selftest.patch |  145 +++++++++++++++++++++++
 PKGBUILD                                       |   14 +-
 2 files changed, 156 insertions(+), 3 deletions(-)

Added: 0001-https-ify-urls-and-drop-v1-selftest.patch
===================================================================
--- 0001-https-ify-urls-and-drop-v1-selftest.patch	                        (rev 0)
+++ 0001-https-ify-urls-and-drop-v1-selftest.patch	2020-04-15 21:24:10 UTC (rev 615061)
@@ -0,0 +1,145 @@
+commit 0d45452e7fbe47e77e78ff23b480c77fd9c06f2b
+Author: Klas Lindfors <klas at yubico.com>
+Date:   Thu Nov 22 13:48:19 2018 +0100
+
+    https-ify urls and drop v1 selftest
+
+diff --git a/tests/selftest.c b/tests/selftest.c
+index 78ae43e..1f3747e 100644
+--- a/tests/selftest.c
++++ b/tests/selftest.c
+@@ -39,52 +39,6 @@
+   printf xX; \
+   printf ("\n")
+ 
+-void
+-test_v1_validation(int client_id, char *client_b64key)
+-{
+-  ykclient_t *ykc;
+-  int ret;
+-
+-  TEST(("init self"));
+-  ret = ykclient_init (&ykc);
+-  printf ("ykclient_init (%d): %s\n", ret, ykclient_strerror (ret));
+-  assert(ret == YKCLIENT_OK);
+-
+-  ykclient_set_url_template
+-    (ykc, "http://api.yubico.com/wsapi/verify?id=%d&otp=%s");
+-
+-  TEST(("null client_id, expect REPLAYED_OTP"));
+-  ykclient_set_verify_signature(ykc, 0);
+-  ykclient_set_client (ykc, client_id, 0, NULL);
+-
+-#ifndef TEST_WITHOUT_INTERNET
+-  ret = ykclient_request (ykc, "ccccccbchvthlivuitriujjifivbvtrjkjfirllluurj");
+-  printf ("ykclient_request (%d): %s\n", ret, ykclient_strerror (ret));
+-  printf ("used url: %s\n", ykclient_get_last_url (ykc));
+-  assert(ret == YKCLIENT_REPLAYED_OTP);
+-#else
+-  printf ("Test SKIPPED\n");
+-#endif
+-
+-  /* Test signed request. When signing requests to a v1 service, we must clear the nonce first. */
+-
+-  TEST(("signed request, expect REPLAYED_OTP"));
+-  ykclient_set_verify_signature(ykc, 1);
+-  ykclient_set_client_b64 (ykc, client_id, client_b64key);
+-  ykclient_set_nonce(ykc, NULL);
+-
+-#ifndef TEST_WITHOUT_INTERNET
+-  ret = ykclient_request (ykc, "ccccccbchvthlivuitriujjifivbvtrjkjfirllluurj");
+-  printf ("ykclient_request (%d): %s\n", ret, ykclient_strerror (ret));
+-  printf ("used url: %s\n", ykclient_get_last_url (ykc));
+-  assert(ret == YKCLIENT_REPLAYED_OTP);
+-#else
+-  printf ("Test SKIPPED\n");
+-#endif
+-
+-  ykclient_done (&ykc);
+-}
+-
+ #if 0
+ void
+ test_base64 (void)
+@@ -366,7 +320,7 @@ main (void)
+   TEST(("set WS 2.0 URL template"));
+   /* Set one URL and run tests with that. */
+   ykclient_set_url_template
+-    (ykc, "http://api.yubico.com/wsapi/2.0/verify?id=%d&otp=%s");
++    (ykc, "https://api.yubico.com/wsapi/2.0/verify?id=%d&otp=%s");
+ 
+ #ifndef TEST_WITHOUT_INTERNET
+   TEST(("validation request, expect REPLAYED_OTP"));
+@@ -406,11 +360,11 @@ main (void)
+ 
+   TEST(("Set and use several OLD V2.0 URLs"));
+   const char *templates[] = {
+-    "http://api.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
+-    "http://api2.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
+-    "http://api3.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
+-    "http://api4.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
+-    "http://api5.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
++    "https://api.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
++    "https://api2.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
++    "https://api3.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
++    "https://api4.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
++    "https://api5.yubico.com/wsapi/2.0/verify?id=%d&otp=%s",
+   };
+   ykclient_set_url_templates(ykc, 5, templates);
+   ykclient_set_client (ykc, client_id, 20, client_key);
+@@ -425,11 +379,11 @@ main (void)
+ 
+   TEST(("Set and use several NEW V2.0 URLs"));
+   const char *bases[] = {
+-    "http://api.yubico.com/wsapi/2.0/verify",
+-    "http://api2.yubico.com/wsapi/2.0/verify",
+-    "http://api3.yubico.com/wsapi/2.0/verify",
+-    "http://api4.yubico.com/wsapi/2.0/verify",
+-    "http://api5.yubico.com/wsapi/2.0/verify",
++    "https://api.yubico.com/wsapi/2.0/verify",
++    "https://api2.yubico.com/wsapi/2.0/verify",
++    "https://api3.yubico.com/wsapi/2.0/verify",
++    "https://api4.yubico.com/wsapi/2.0/verify",
++    "https://api5.yubico.com/wsapi/2.0/verify",
+   };
+   ykclient_set_url_bases(ykc, 5, bases);
+   ykclient_set_client (ykc, client_id, 20, client_key);
+@@ -444,11 +398,11 @@ main (void)
+ 
+   TEST(("Set a mix of bad and good URLs"));
+   const char *bad_bases[] = {
+-    "http://api.example.com/wsapi/2.0/verify",
+-    "http://api2.example.com/wsapi/2.0/verify",
+-    "http://api3.example.com/wsapi/2.0/verify",
+-    "http://api4.example.com/wsapi/2.0/verify",
+-    "http://api5.yubico.com/wsapi/2.0/verify",
++    "https://api.example.com/wsapi/2.0/verify",
++    "https://api2.example.com/wsapi/2.0/verify",
++    "https://api3.example.com/wsapi/2.0/verify",
++    "https://api4.example.com/wsapi/2.0/verify",
++    "https://api5.yubico.com/wsapi/2.0/verify",
+   };
+   ykclient_set_url_bases(ykc, 5, bad_bases);
+   ykclient_set_client (ykc, client_id, 20, client_key);
+@@ -471,8 +425,6 @@ main (void)
+   printf ("strerror(BAD_OTP): %s\n", ykclient_strerror (YKCLIENT_BAD_OTP));
+   ret = strcmp(ykclient_strerror (YKCLIENT_BAD_OTP), "Yubikey OTP was bad (BAD_OTP)"); assert (ret == 0);
+ 
+-  test_v1_validation(client_id, client_b64key);
+-
+ #if 0
+   test_base64();
+ 
+diff --git a/tool.c b/tool.c
+index 159ef64..498a303 100644
+--- a/tool.c
++++ b/tool.c
+@@ -50,7 +50,7 @@ const char *usage =
+   "\n"
+   "    --debug        Print debugging information\n"
+   "    --url URL      Validation service URL, for example,\n"
+-  "                   \"http://api.yubico.com/wsapi/verify\"\n"
++  "                   \"https://api.yubico.com/wsapi/2.0/verify\"\n"
+   "    --ca CADIR     Path to directory containing Certificate Authoritity,\n"
+   "                   e.g., \"/usr/local/etc/CERTS\"\n"
+   "    --cai CAFILE   Path to a file holding one or more certificated to\n"

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-04-15 21:24:06 UTC (rev 615060)
+++ PKGBUILD	2020-04-15 21:24:10 UTC (rev 615061)
@@ -3,7 +3,7 @@
 pkgname=yubico-c-client
 _shortname=ykclient
 pkgver=2.15
-pkgrel=4
+pkgrel=5
 pkgdesc='Yubico YubiKey client C library'
 arch=('x86_64')
 url='https://github.com/Yubico/yubico-c-client'
@@ -13,10 +13,18 @@
 provides=("${_shortname}")
 conflicts=("${_shortname}")
 validpgpkeys=('0A3B0262BCA1705307D5FF06BCA00FD4B2168C0A') # Klas Lindfors <klas at yubico.com>
-source=("https://developers.yubico.com/${pkgname}/Releases/${_shortname}-${pkgver}.tar.gz"{,.sig})
+source=("https://developers.yubico.com/${pkgname}/Releases/${_shortname}-${pkgver}.tar.gz"{,.sig}
+        '0001-https-ify-urls-and-drop-v1-selftest.patch')
 sha256sums=('f461cdefe7955d58bbd09d0eb7a15b36cb3576b88adbd68008f40ea978ea5016'
-            'SKIP')
+            'SKIP'
+            'a1df5f6134b03bd2cd62c68815b424797980c1a7cefdf1a72f87b9b41d6dc525')
 
+prepare() {
+	cd "${_shortname}-${pkgver}"
+
+	patch -Np1 < ../0001-https-ify-urls-and-drop-v1-selftest.patch
+}
+
 build() {
 	cd "${_shortname}-${pkgver}"
 



More information about the arch-commits mailing list