1
0
mirror of https://codeberg.org/cage/tinmop/ synced 2024-12-30 00:39:54 +01:00

- [gemini] fixed test for checking valid cached value for

certificate/key pair.

  The function  to find a  cached certificate/key  or create a  new pair
  retuns a multiple value.

  I was using multiple-value-list  for getting the pairs certificate/key
  from   said  functions.    Then  i   was  checking   the  results   of
  'multiple-value-list' for null values to get the non correct pair, but
  that expression never return nil (was returning '(nil) instead).

  This was breaking the client autentication.
This commit is contained in:
cage 2021-01-17 19:13:33 +01:00
parent 8e58698bfa
commit 848ed6a043

View File

@ -474,16 +474,21 @@
:streaming
:running)))
(fetch-cached-certificate (actual-iri)
(let* ((certificate-and-key
(or (multiple-value-list
(db:ssl-cert-find actual-iri))
(multiple-value-list
(gemini-client:make-client-certificate actual-iri))))
(certificate (first certificate-and-key))
(key (second certificate-and-key)))
(assert certificate)
(assert key)
(values certificate key)))
(let ((certificate nil)
(key nil))
(multiple-value-bind (certificate-cache key-cache)
(db:ssl-cert-find actual-iri)
(if (and certificate-cache
key-cache)
(setf certificate certificate-cache
key key-cache)
(multiple-value-bind (certificate-new key-new)
(gemini-client:make-client-certificate actual-iri)
(setf certificate certificate-new
key key-new)))
(assert certificate)
(assert key)
(values certificate key))))
(get-user-input (hide-input host prompt)
(flet ((on-input-complete (input)
(when (string-not-empty-p input)