1.1--- a/lisp/ffi/rustls/constants.lisp Thu May 23 00:21:57 2024 -0400
1.2+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3@@ -1,112 +0,0 @@
1.4-("rustls.h")
1.5-
1.6-((:enum "rustls_result"
1.7- ((rustls-result-ok "RUSTLS_RESULT_OK")
1.8- (rustls-result-io "RUSTLS_RESULT_IO")
1.9- (rustls-result-null-parameter "RUSTLS_RESULT_NULL_PARAMETER")
1.10- (rustls-result-invalid-dns-name-error "RUSTLS_RESULT_INVALID_DNS_NAME_ERROR")
1.11- (rustls-result-panic "RUSTLS_RESULT_PANIC")
1.12- (rustls-result-certificate-parse-error "RUSTLS_RESULT_CERTIFICATE_PARSE_ERROR")
1.13- (rustls-result-private-key-parse-error "RUSTLS_RESULT_PRIVATE_KEY_PARSE_ERROR")
1.14- (rustls-result-insufficient-size "RUSTLS_RESULT_INSUFFICIENT_SIZE")
1.15- (rustls-result-not-found "RUSTLS_RESULT_NOT_FOUND")
1.16- (rustls-result-invalid-parameter "RUSTLS_RESULT_INVALID_PARAMETER")
1.17- (rustls-result-unexpected-eof "RUSTLS_RESULT_UNEXPECTED_EOF")
1.18- (rustls-result-plaintext-empty "RUSTLS_RESULT_PLAINTEXT_EMPTY")
1.19- (rustls-result-acceptor-not-ready "RUSTLS_RESULT_ACCEPTOR_NOT_READY")
1.20- (rustls-result-already-used "RUSTLS_RESULT_ALREADY_USED")
1.21- (rustls-result-certificate-revocation-list-parse-error "RUSTLS_RESULT_CERTIFICATE_REVOCATION_LIST_PARSE_ERROR")
1.22- (rustls-result-no-certificates-presented "RUSTLS_RESULT_NO_CERTIFICATES_PRESENTED")
1.23- (rustls-result-decrypt-error "RUSTLS_RESULT_DECRYPT_ERROR")
1.24- (rustls-result-failed-to-get-current-time "RUSTLS_RESULT_FAILED_TO_GET_CURRENT_TIME")
1.25- (rustls-result-failed-to-get-random-bytes "RUSTLS_RESULT_FAILED_TO_GET_RANDOM_BYTES")
1.26- (rustls-result-handshake-not-complete "RUSTLS_RESULT_HANDSHAKE_NOT_COMPLETE")
1.27- (rustls-result-peer-sent-oversized-record "RUSTLS_RESULT_PEER_SENT_OVERSIZED_RECORD")
1.28- (rustls-result-no-application-protocol "RUSTLS_RESULT_NO_APPLICATION_PROTOCOL")
1.29- (rustls-result-bad-max-fragment-size "RUSTLS_RESULT_BAD_MAX_FRAGMENT_SIZE")
1.30- (rustls-result-unsupported-name-type "RUSTLS_RESULT_UNSUPPORTED_NAME_TYPE")
1.31- (rustls-result-encrypt-error "RUSTLS_RESULT_ENCRYPT_ERROR")
1.32- (rustls-result-cert-encoding-bad "RUSTLS_RESULT_CERT_ENCODING_BAD")
1.33- (rustls-result-cert-expired "RUSTLS_RESULT_CERT_EXPIRED")
1.34- (rustls-result-cert-not-yet-valid "RUSTLS_RESULT_CERT_NOT_YET_VALID")
1.35- (rustls-result-cert-revoked "RUSTLS_RESULT_CERT_REVOKED")
1.36- (rustls-result-cert-unhandled-critical-extension "RUSTLS_RESULT_CERT_UNHANDLED_CRITICAL_EXTENSION")
1.37- (rustls-result-cert-unknown-issuer "RUSTLS_RESULT_CERT_UNKNOWN_ISSUER")
1.38- (rustls-result-cert-bad-signature "RUSTLS_RESULT_CERT_BAD_SIGNATURE")
1.39- (rustls-result-cert-not-valid-for-name "RUSTLS_RESULT_CERT_NOT_VALID_FOR_NAME")
1.40- (rustls-result-cert-invalid-purpose "RUSTLS_RESULT_CERT_INVALID_PURPOSE")
1.41- (rustls-result-cert-application-verification-failure "RUSTLS_RESULT_CERT_APPLICATION_VERIFICATION_FAILURE")
1.42- (rustls-result-cert-other-error "RUSTLS_RESULT_CERT_OTHER_ERROR")
1.43- (rustls-result-message-handshake-payload-too-large "RUSTLS_RESULT_MESSAGE_HANDSHAKE_PAYLOAD_TOO_LARGE")
1.44- (rustls-result-message-invalid-ccs "RUSTLS_RESULT_MESSAGE_INVALID_CCS")
1.45- (rustls-result-message-invalid-content-type "RUSTLS_RESULT_MESSAGE_INVALID_CONTENT_TYPE")
1.46- (rustls-result-message-invalid-cert-status-type "RUSTLS_RESULT_MESSAGE_INVALID_CERT_STATUS_TYPE")
1.47- (rustls-result-message-invalid-cert-request "RUSTLS_RESULT_MESSAGE_INVALID_CERT_REQUEST")
1.48- (rustls-result-message-invalid-dh-params "RUSTLS_RESULT_MESSAGE_INVALID_DH_PARAMS")
1.49- (rustls-result-message-invalid-empty-payload "RUSTLS_RESULT_MESSAGE_INVALID_EMPTY_PAYLOAD")
1.50- (rustls-result-message-invalid-key-update "RUSTLS_RESULT_MESSAGE_INVALID_KEY_UPDATE")
1.51- (rustls-result-message-invalid-server-name "RUSTLS_RESULT_MESSAGE_INVALID_SERVER_NAME")
1.52- (rustls-result-message-too-large "RUSTLS_RESULT_MESSAGE_TOO_LARGE")
1.53- (rustls-result-message-too-short "RUSTLS_RESULT_MESSAGE_TOO_SHORT")
1.54- (rustls-result-message-missing-data "RUSTLS_RESULT_MESSAGE_MISSING_DATA")
1.55- (rustls-result-message-missing-key-exchange "RUSTLS_RESULT_MESSAGE_MISSING_KEY_EXCHANGE")
1.56- (rustls-result-message-no-signature-schemes "RUSTLS_RESULT_MESSAGE_NO_SIGNATURE_SCHEMES")
1.57- (rustls-result-message-trailing-data "RUSTLS_RESULT_MESSAGE_TRAILING_DATA")
1.58- (rustls-result-message-unexpected-message "RUSTLS_RESULT_MESSAGE_UNEXPECTED_MESSAGE")
1.59- (rustls-result-message-unknown-protocol-version "RUSTLS_RESULT_MESSAGE_UNKNOWN_PROTOCOL_VERSION")
1.60- (rustls-result-message-unsupported-compression "RUSTLS_RESULT_MESSAGE_UNSUPPORTED_COMPRESSION")
1.61- (rustls-result-message-unsupported-curve-type "RUSTLS_RESULT_MESSAGE_UNSUPPORTED_CURVE_TYPE")
1.62- (rustls-result-message-unsupported-key-exchange-algorithm "RUSTLS_RESULT_MESSAGE_UNSUPPORTED_KEY_EXCHANGE_ALGORITHM")
1.63- (rustls-result-message-invalid-other "RUSTLS_RESULT_MESSAGE_INVALID_OTHER")
1.64- (rustls-result-peer-incompatible-error "RUSTLS_RESULT_PEER_INCOMPATIBLE_ERROR")
1.65- (rustls-result-peer-misbehaved-error "RUSTLS_RESULT_PEER_MISBEHAVED_ERROR")
1.66- (rustls-result-inappropriate-message "RUSTLS_RESULT_INAPPROPRIATE_MESSAGE")
1.67- (rustls-result-inappropriate-handshake-message "RUSTLS_RESULT_INAPPROPRIATE_HANDSHAKE_MESSAGE")
1.68- (rustls-result-general "RUSTLS_RESULT_GENERAL")
1.69- (rustls-result-alert-close-notify "RUSTLS_RESULT_ALERT_CLOSE_NOTIFY")
1.70- (rustls-result-alert-unexpected-message "RUSTLS_RESULT_ALERT_UNEXPECTED_MESSAGE")
1.71- (rustls-result-alert-bad-record-mac "RUSTLS_RESULT_ALERT_BAD_RECORD_MAC")
1.72- (rustls-result-alert-decryption-failed "RUSTLS_RESULT_ALERT_DECRYPTION_FAILED")
1.73- (rustls-result-alert-record-overflow "RUSTLS_RESULT_ALERT_RECORD_OVERFLOW")
1.74- (rustls-result-alert-decompression-failure "RUSTLS_RESULT_ALERT_DECOMPRESSION_FAILURE")
1.75- (rustls-result-alert-handshake-failure "RUSTLS_RESULT_ALERT_HANDSHAKE_FAILURE")
1.76- (rustls-result-alert-no-certificate "RUSTLS_RESULT_ALERT_NO_CERTIFICATE")
1.77- (rustls-result-alert-bad-certificate "RUSTLS_RESULT_ALERT_BAD_CERTIFICATE")
1.78- (rustls-result-alert-unsupported-certificate "RUSTLS_RESULT_ALERT_UNSUPPORTED_CERTIFICATE")
1.79- (rustls-result-alert-certificate-revoked "RUSTLS_RESULT_ALERT_CERTIFICATE_REVOKED")
1.80- (rustls-result-alert-certificate-expired "RUSTLS_RESULT_ALERT_CERTIFICATE_EXPIRED")
1.81- (rustls-result-alert-certificate-unknown "RUSTLS_RESULT_ALERT_CERTIFICATE_UNKNOWN")
1.82- (rustls-result-alert-illegal-parameter "RUSTLS_RESULT_ALERT_ILLEGAL_PARAMETER")
1.83- (rustls-result-alert-unknown-ca "RUSTLS_RESULT_ALERT_UNKNOWN_CA")
1.84- (rustls-result-alert-access-denied "RUSTLS_RESULT_ALERT_ACCESS_DENIED")
1.85- (rustls-result-alert-decode-error "RUSTLS_RESULT_ALERT_DECODE_ERROR")
1.86- (rustls-result-alert-decrypt-error "RUSTLS_RESULT_ALERT_DECRYPT_ERROR")
1.87- (rustls-result-alert-export-restriction "RUSTLS_RESULT_ALERT_EXPORT_RESTRICTION")
1.88- (rustls-result-alert-protocol-version "RUSTLS_RESULT_ALERT_PROTOCOL_VERSION")
1.89- (rustls-result-alert-insufficient-security "RUSTLS_RESULT_ALERT_INSUFFICIENT_SECURITY")
1.90- (rustls-result-alert-internal-error "RUSTLS_RESULT_ALERT_INTERNAL_ERROR")
1.91- (rustls-result-alert-inappropriate-fallback "RUSTLS_RESULT_ALERT_INAPPROPRIATE_FALLBACK")
1.92- (rustls-result-alert-user-canceled "RUSTLS_RESULT_ALERT_USER_CANCELED")
1.93- (rustls-result-alert-no-renegotiation "RUSTLS_RESULT_ALERT_NO_RENEGOTIATION")
1.94- (rustls-result-alert-missing-extension "RUSTLS_RESULT_ALERT_MISSING_EXTENSION")
1.95- (rustls-result-alert-unsupported-extension "RUSTLS_RESULT_ALERT_UNSUPPORTED_EXTENSION")
1.96- (rustls-result-alert-certificate-unobtainable "RUSTLS_RESULT_ALERT_CERTIFICATE_UNOBTAINABLE")
1.97- (rustls-result-alert-unrecognised-name "RUSTLS_RESULT_ALERT_UNRECOGNISED_NAME")
1.98- (rustls-result-alert-bad-certificate-status-response "RUSTLS_RESULT_ALERT_BAD_CERTIFICATE_STATUS_RESPONSE")
1.99- (rustls-result-alert-bad-certificate-hash-value "RUSTLS_RESULT_ALERT_BAD_CERTIFICATE_HASH_VALUE")
1.100- (rustls-result-alert-unknown-psk-identity "RUSTLS_RESULT_ALERT_UNKNOWN_PSK_IDENTITY")
1.101- (rustls-result-alert-certificate-required "RUSTLS_RESULT_ALERT_CERTIFICATE_REQUIRED")
1.102- (rustls-result-alert-no-application-protocol "RUSTLS_RESULT_ALERT_NO_APPLICATION_PROTOCOL")
1.103- (rustls-result-alert-unknown "RUSTLS_RESULT_ALERT_UNKNOWN")
1.104- (rustls-result-cert-revocation-list-bad-signature "RUSTLS_RESULT_CERT_REVOCATION_LIST_BAD_SIGNATURE")
1.105- (rustls-result-cert-revocation-list-invalid-crl-number "RUSTLS_RESULT_CERT_REVOCATION_LIST_INVALID_CRL_NUMBER")
1.106- (rustls-result-cert-revocation-list-invalid-revoked-cert-serial-number "RUSTLS_RESULT_CERT_REVOCATION_LIST_INVALID_REVOKED_CERT_SERIAL_NUMBER")
1.107- (rustls-result-cert-revocation-list-issuer-invalid-for-crl "RUSTLS_RESULT_CERT_REVOCATION_LIST_ISSUER_INVALID_FOR_CRL")
1.108- (rustls-result-cert-revocation-list-other-error "RUSTLS_RESULT_CERT_REVOCATION_LIST_OTHER_ERROR")
1.109- (rustls-result-cert-revocation-list-parse-error "RUSTLS_RESULT_CERT_REVOCATION_LIST_PARSE_ERROR")
1.110- (rustls-result-cert-revocation-list-unsupported-crl-version "RUSTLS_RESULT_CERT_REVOCATION_LIST_UNSUPPORTED_CRL_VERSION")
1.111- (rustls-result-cert-revocation-list-unsupported-critical-extension "RUSTLS_RESULT_CERT_REVOCATION_LIST_UNSUPPORTED_CRITICAL_EXTENSION")
1.112- (rustls-result-cert-revocation-list-unsupported-delta-crl "RUSTLS_RESULT_CERT_REVOCATION_LIST_UNSUPPORTED_DELTA_CRL")
1.113- (rustls-result-cert-revocation-list-unsupported-indirect-crl "RUSTLS_RESULT_CERT_REVOCATION_LIST_UNSUPPORTED_INDIRECT_CRL")
1.114- (rustls-result-cert-revocation-list-unsupported-revocation-reason "RUSTLS_RESULT_CERT_REVOCATION_LIST_UNSUPPORTED_REVOCATION_REASON")
1.115- (rustls-result-client-cert-verifier-builder-no-root-anchors "RUSTLS_RESULT_CLIENT_CERT_VERIFIER_BUILDER_NO_ROOT_ANCHORS"))))
2.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2+++ b/lisp/ffi/rustls/macs.lisp Thu May 23 18:23:38 2024 -0400
2.3@@ -0,0 +1,6 @@
2.4+;;; rustls/macs.lisp --- Rustls FFI Macros
2.5+
2.6+;;
2.7+
2.8+;;; Code:
2.9+(in-package :rustls)
3.1--- a/lisp/ffi/rustls/pkg.lisp Thu May 23 00:21:57 2024 -0400
3.2+++ b/lisp/ffi/rustls/pkg.lisp Thu May 23 18:23:38 2024 -0400
3.3@@ -10,11 +10,3 @@
3.4 (in-package :rustls)
3.5
3.6 (define-alien-loader "rustls" t "/usr/lib/")
3.7-
3.8-(define-alien-type rustls-result unsigned-int)
3.9-
3.10-(define-alien-type rustls-tls-version (enum nil (rustls-tls-version-sslv2 512)))
3.11-
3.12-(define-alien-type rustls-accepted (struct rustls-accepted))
3.13-
3.14-(define-alien-type rustls-accepted-alert (struct rustls-accepted-alert))
4.1--- a/lisp/ffi/rustls/rustls.asd Thu May 23 00:21:57 2024 -0400
4.2+++ b/lisp/ffi/rustls/rustls.asd Thu May 23 18:23:38 2024 -0400
4.3@@ -7,19 +7,11 @@
4.4 ;;
4.5
4.6 ;;; Code:
4.7-(eval-when (:compile-toplevel :load-toplevel :execute)
4.8- (require :sb-grovel))
4.9-
4.10-(defpackage :rustls.sys
4.11- (:use :cl :asdf :sb-grovel :sb-alien))
4.12-
4.13-(in-package :rustls.sys)
4.14-
4.15 (defsystem :rustls
4.16- :depends-on (:sb-grovel :std)
4.17+ :depends-on (:std)
4.18 :components ((:file "pkg")
4.19- (grovel-constants-file "constants"
4.20- :package :rustls))
4.21+ (:file "macs")
4.22+ (:file "types"))
4.23 :in-order-to ((test-op (test-op "rustls/tests"))))
4.24
4.25 (defsystem :rustls/tests
5.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2+++ b/lisp/ffi/rustls/rustls.lisp Thu May 23 18:23:38 2024 -0400
5.3@@ -0,0 +1,268 @@
5.4+;;; rustls/rustls.lisp --- Rustls Alien Routines
5.5+
5.6+;;
5.7+
5.8+;;; Code:
5.9+(in-package :rustls)
5.10+
5.11+(define-alien-routine rustls-version c-string)
5.12+
5.13+(define-alien-routine rustls-acceptor-new (* rustls-acceptor))
5.14+
5.15+(define-alien-routine rustls-acceptor-free void (acceptor (* rustls-acceptor)))
5.16+
5.17+(define-alien-routine rustls-acceptor-read-tls rustls-io-result
5.18+ (acceptor (* rustls-acceptor))
5.19+ (callback #+nil rustls-read-callback (* t))
5.20+ (userdata (* t))
5.21+ (out-n (* size-t)))
5.22+
5.23+(define-alien-routine rustls-acceptor-accept rustls-result
5.24+ (acceptor (* rustls-acceptor))
5.25+ (out-accepted (* (* rustls-accepted)))
5.26+ (out-alert (* (* rustls-accepted-alert))))
5.27+
5.28+(define-alien-routine rustls-accepted-server-name c-string
5.29+ (accepted (* rustls-accepted)))
5.30+
5.31+(define-alien-routine rustls-accepted-signature-scheme (unsigned 16)
5.32+ (accepted (* rustls-accepted))
5.33+ (i size-t))
5.34+
5.35+(define-alien-routine rustls-accepted-cipher-scheme (unsigned 16)
5.36+ (accepted (* rustls-accepted))
5.37+ (i size-t))
5.38+
5.39+(define-alien-routine rustls-accepted-alpn rustls-slice-bytes
5.40+ (accepted (* rustls-accepted))
5.41+ (i size-t))
5.42+
5.43+(define-alien-routine rustls-accepted-into-connection rustls-result
5.44+ (accepted (* rustls-accepted))
5.45+ (config (* rustls-server-config))
5.46+ (out-conn (* (* rustls-connection)))
5.47+ (out-alert (* (* rustls-accepted-alert))))
5.48+
5.49+(define-alien-routine rustls-accepted-free void (accepted (* rustls-accepted)))
5.50+
5.51+(define-alien-routine rustls-accepted-alert-write-tls rustls-io-result
5.52+ (accepted-alert (* rustls-accepted-alert))
5.53+ (callback rustls-write-callback)
5.54+ (userdata (* t))
5.55+ (out-n (* size-t)))
5.56+
5.57+(define-alien-routine rustls-accepted-alert-free void
5.58+ (accepted-alert (* rustls-accepted-alert)))
5.59+
5.60+(define-alien-routine rustls-certificate-get-der rustls-result
5.61+ (cert (* rustls-certificate))
5.62+ (out-der-data (* (* (unsigned 8))))
5.63+ (out-der-len (* size-t)))
5.64+
5.65+(define-alien-routine rustls-supported-ciphersuite-get-suite (unsigned 16)
5.66+ (supported-ciphersuite (* rustls-supported-ciphersuite)))
5.67+
5.68+(define-alien-routine rustls-supported-ciphersuite-get-name c-string
5.69+ (supported-ciphersuite (* rustls-supported-ciphersuite)))
5.70+
5.71+(define-alien-routine rustls-all-ciphersuites-len size-t)
5.72+
5.73+(define-alien-routine rustls-all-ciphersuites-get-entry (* rustls-supported-ciphersuite)
5.74+ (i size-t))
5.75+
5.76+(define-alien-routine rustls-default-ciphersuites-len size-t)
5.77+
5.78+(define-alien-routine rustls-default-ciphersuites-get-entry (* rustls-supported-ciphersuite)
5.79+ (i size-t))
5.80+
5.81+(define-alien-routine rustls-certified-key-build rustls-result
5.82+ (cert-chain (array (unsigned 8)))
5.83+ (cert-chain-len size-t)
5.84+ (private-key (array (unsigned 8)))
5.85+ (private-key-len size-t)
5.86+ (certified-key-out (* (* rustls-certified-key))))
5.87+
5.88+(define-alien-routine rustls-certified-key-get-certificate (* rustls-certificate)
5.89+ (certified-key (* rustls-certified-key))
5.90+ (i size-t))
5.91+
5.92+(define-alien-routine rustls-certified-key-clone-with-ocsp rustls-result
5.93+ (certified-key (* rustls-certified-key))
5.94+ (ocsp-response (* rustls-slice-bytes))
5.95+ (clone-key-out (* (* rustls-certified-key))))
5.96+
5.97+(define-alien-routine rustls-certified-key-free void (key (* rustls-certified-key)))
5.98+
5.99+;; (define-alien-routine rustls-root-cert-store-builder-new (* rustls-root-cert-store-builder))
5.100+
5.101+(define-alien-routine rustls-root-cert-store-builder-add-pem rustls-result
5.102+ (builder (* rustls-root-cert-store-builder))
5.103+ (pem (array (unsigned 8)))
5.104+ (pem-len size-t)
5.105+ (strict boolean))
5.106+
5.107+(define-alien-routine rustls-root-cert-store-builder-load-roots-from-file rustls-result
5.108+ (builder (* rustls-root-cert-store-builder))
5.109+ (filename c-string)
5.110+ (strict boolean))
5.111+
5.112+(define-alien-routine rustls-root-cert-store-builder-build rustls-result
5.113+ (builder (* rustls-root-cert-store-builder))
5.114+ (root-cert-store-out (* (* rustls-root-cert-store))))
5.115+
5.116+(define-alien-routine rustls-root-cert-store-builder-free void
5.117+ (builder (* rustls-root-cert-store-builder)))
5.118+
5.119+(define-alien-routine rustls-root-cert-store-free void
5.120+ (storer (* rustls-root-cert-store)))
5.121+
5.122+(define-alien-routine rustls-client-cert-verifier-free void
5.123+ (verifier (* rustls-client-cert-verifier)))
5.124+
5.125+(define-alien-routine rustls-web-pki-client-cert-verifier-builder-new (* rustls-web-pki-client-cert-verifier-builder)
5.126+ (store (* rustls-root-cert-store)))
5.127+
5.128+(define-alien-routine rustls-web-pki-client-cert-verifier-builder-add-crl rustls-result
5.129+ (builder (* rustls-web-pki-client-cert-verifier-builder))
5.130+ (crl-pem (array (unsigned 8)))
5.131+ (crl-pem-len size-t))
5.132+
5.133+(define-alien-routine rustls-web-pki-client-cert-verifier-only-check-end-entity-revocation rustls-result
5.134+ (builder (* rustls-web-pki-client-cert-verifier-builder)))
5.135+
5.136+(define-alien-routine rustls-web-pki-client-cert-verifier-allow-unknown-revocation-status rustls-result
5.137+ (builder (* rustls-web-pki-client-cert-verifier-builder)))
5.138+
5.139+(define-alien-routine rustls-web-pki-client-cert-verifier-allow-unauthenticated rustls-result
5.140+ (builder (* rustls-web-pki-client-cert-verifier-builder)))
5.141+
5.142+(define-alien-routine rustls-web-pki-client-cert-verifier-clear-root-hint-subjects rustls-result
5.143+ (builder (* rustls-web-pki-client-cert-verifier-builder)))
5.144+
5.145+(define-alien-routine rustls-web-pki-client-cert-verifier-add-root-hint-subjects rustls-result
5.146+ (builder (* rustls-web-pki-client-cert-verifier-builder))
5.147+ (store (* rustls-root-cert-store)))
5.148+
5.149+(define-alien-routine rustls-web-pki-client-cert-verifier-builder-build rustls-result
5.150+ (builder (* rustls-web-pki-client-cert-verifier-builder))
5.151+ (verifier-out (* (* rustls-client-cert-verifier))))
5.152+
5.153+(define-alien-routine rustls-web-pki-client-cert-verifier-builder-free void
5.154+ (builder (* rustls-web-pki-client-cert-verifier-builder)))
5.155+
5.156+;;; rustls_web_pki_server_cert_verifier
5.157+
5.158+;;; rustls_client_config
5.159+
5.160+;;; rustls_client_connection
5.161+(define-alien-routine rustls-client-connection-new rustls-result
5.162+ (config (* rustls-client-config))
5.163+ (server-name c-string)
5.164+ (conn-out (* (* rustls-connection))))
5.165+
5.166+(define-alien-routine rustls-connection-set-userdata void
5.167+ (conn (* rustls-connection))
5.168+ (userdata (* t)))
5.169+
5.170+(define-alien-routine rustls-connection-set-log-callback void
5.171+ (conn (* rustls-connection))
5.172+ (cb rustls-log-callback))
5.173+
5.174+(define-alien-routine rustls-connection-read-tls rustls-io-result
5.175+ (conn (* rustls-connection))
5.176+ (callback rustls-read-callback)
5.177+ (userdata (* t))
5.178+ (out-n (* size-t)))
5.179+
5.180+(define-alien-routine rustls-connection-write-tls rustls-io-result
5.181+ (conn (* rustls-connection))
5.182+ (callback rustls-write-callback)
5.183+ (userdata (* t))
5.184+ (out-n (* size-t)))
5.185+
5.186+(define-alien-routine rustls-connection-write-tls-vectored rustls-io-result
5.187+ (conn (* rustls-connection))
5.188+ (callback rustls-write-vectored-callback)
5.189+ (userdata (* t))
5.190+ (out-n (* size-t)))
5.191+
5.192+(define-alien-routine rustls-connection-process-new-packets rustls-result
5.193+ (conn (* rustls-connection)))
5.194+
5.195+(define-alien-routine rustls-connection-wants-read boolean
5.196+ (conn (* rustls-connection)))
5.197+
5.198+(define-alien-routine rustls-connection-wants-write boolean
5.199+ (conn (* rustls-connection)))
5.200+
5.201+(define-alien-routine rustls-connection-is-handshaking boolean
5.202+ (conn (* rustls-connection)))
5.203+
5.204+(define-alien-routine rustls-connection-set-buffer-limit void
5.205+ (conn (* rustls-connection))
5.206+ (n size-t))
5.207+
5.208+(define-alien-routine rustls-connection-send-close-notify void
5.209+ (conn (* rustls-connection)))
5.210+
5.211+(define-alien-routine rustls-connection-get-peer-certificate (* rustls-certificate)
5.212+ (conn (* rustls-connection))
5.213+ (i size-t))
5.214+
5.215+(define-alien-routine rustls-connection-get-alpn-protocol void
5.216+ (conn (* rustls-connection))
5.217+ (protocol-out (* (array (unsigned 8))))
5.218+ (protocol-out-len (* size-t)))
5.219+
5.220+(define-alien-routine rustls-connection-get-protocol-version (unsigned 16)
5.221+ (conn (* rustls-connection)))
5.222+
5.223+(define-alien-routine rustls-connection-get-negotiated-ciphersuite (* rustls-supported-ciphersuite)
5.224+ (conn (* rustls-connection)))
5.225+
5.226+(define-alien-routine rustls-connection-write rustls-result
5.227+ (conn (* rustls-connection))
5.228+ (buf (array (unsigned 8)))
5.229+ (count size-t)
5.230+ (out-n (* size-t)))
5.231+
5.232+(define-alien-routine rustls-connection-read rustls-result
5.233+ (conn (* rustls-connection))
5.234+ (buf (array (unsigned 8)))
5.235+ (count size-t)
5.236+ (out-n (* size-t)))
5.237+
5.238+(define-alien-routine rustl-connection-free void (* rustls-connection))
5.239+
5.240+(define-alien-routine rustls-error void (result rustls-result) (len size-t) (out-n (* size-t)))
5.241+
5.242+(define-alien-routine rustls-result-is-cert-errorerror boolean (result rustls-result))
5.243+
5.244+(define-alien-routine rustls-log-level-str c-string (level rustls-log-level))
5.245+
5.246+(define-alien-routine rustls-slice-slice-bytes-len size-t
5.247+ (input (* rustls-slice-slice-bytes)))
5.248+
5.249+(define-alien-routine rustls-slice-slice-bytes-get rustls-slice-bytes
5.250+ (input (* rustls-slice-slice-bytes))
5.251+ (n size-t))
5.252+
5.253+(define-alien-routine rustls-slice-str-len size-t
5.254+ (input (* rustls-slice-str)))
5.255+
5.256+(define-alien-routine rustls-slice-str-get c-string
5.257+ (input (* rustls-slice-str))
5.258+ (n size-t))
5.259+
5.260+;;; rustls_server_config
5.261+(define-alien-routine rustls-server-config-builder-new (* rustls-server-config-builder))
5.262+
5.263+(define-alien-routine rustls-server-config-builder-free void (config (* rustls-server-config-builder)))
5.264+
5.265+(define-alien-routine rustls-server-config-builder-build (* rustls-server-config) (* rustls-server-config-builder))
5.266+
5.267+(define-alien-routine rustls-server-config-free void (config (* rustls-server-config)))
5.268+
5.269+(define-alien-routine rustls-server-connection-new rustls-result
5.270+ (config (* rustls-server-config))
5.271+ (conn-out (* (* rustls-connection))))
6.1--- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2+++ b/lisp/ffi/rustls/types.lisp Thu May 23 18:23:38 2024 -0400
6.3@@ -0,0 +1,193 @@
6.4+;;; rustls/types.lisp --- Rustls FFI Types
6.5+
6.6+;;
6.7+
6.8+;;; Code:
6.9+(in-package :rustls)
6.10+
6.11+(define-alien-type rustls-result unsigned-int)
6.12+
6.13+(defconstant +rustls-result-ok+ 7000)
6.14+(defconstant +rustls-result-io+ 7001)
6.15+(defconstant +rustls-result-null-parameter+ 7002)
6.16+(defconstant +rustls-result-invalid-dns-name-error+ 7003)
6.17+(defconstant +rustls-result-panic+ 7004)
6.18+(defconstant +rustls-result-certificate-parse-error+ 7005)
6.19+(defconstant +rustls-result-private-key-parse-error+ 7006)
6.20+(defconstant +rustls-result-insufficient-size+ 7007)
6.21+(defconstant +rustls-result-not-found+ 7008)
6.22+(defconstant +rustls-result-invalid-parameter+ 7009)
6.23+(defconstant +rustls-result-unexpected-eof+ 7010)
6.24+(defconstant +rustls-result-plaintext-empty+ 7011)
6.25+(defconstant +rustls-result-acceptor-not-ready+ 7012)
6.26+(defconstant +rustls-result-already-used+ 7013)
6.27+(defconstant +rustls-result-certificate-revocation-list-parse-error+ 7014)
6.28+(defconstant +rustls-result-no-certificates-presented+ 7101)
6.29+(defconstant +rustls-result-decrypt-error+ 7102)
6.30+(defconstant +rustls-result-failed-to-get-current-time+ 7103)
6.31+(defconstant +rustls-result-failed-to-get-random-bytes+ 7113)
6.32+(defconstant +rustls-result-handshake-not-complete+ 7104)
6.33+(defconstant +rustls-result-peer-sent-oversized-record+ 7105)
6.34+(defconstant +rustls-result-no-application-protocol+ 7106)
6.35+(defconstant +rustls-result-bad-max-fragment-size+ 7114)
6.36+(defconstant +rustls-result-unsupported-name-type+ 7115)
6.37+(defconstant +rustls-result-encrypt-error+ 7116)
6.38+(defconstant +rustls-result-cert-encoding-bad+ 7121)
6.39+(defconstant +rustls-result-cert-expired+ 7122)
6.40+(defconstant +rustls-result-cert-not-yet-valid+ 7123)
6.41+(defconstant +rustls-result-cert-revoked+ 7124)
6.42+(defconstant +rustls-result-cert-unhandled-critical-extension+ 7125)
6.43+(defconstant +rustls-result-cert-unknown-issuer+ 7126)
6.44+(defconstant +rustls-result-cert-bad-signature+ 7127)
6.45+(defconstant +rustls-result-cert-not-valid-for-name+ 7128)
6.46+(defconstant +rustls-result-cert-invalid-purpose+ 7129)
6.47+(defconstant +rustls-result-cert-application-verification-failure+ 7130)
6.48+(defconstant +rustls-result-cert-other-error+ 7131)
6.49+(defconstant +rustls-result-message-handshake-payload-too-large+ 7133)
6.50+(defconstant +rustls-result-message-invalid-ccs+ 7134)
6.51+(defconstant +rustls-result-message-invalid-content-type+ 7135)
6.52+(defconstant +rustls-result-message-invalid-cert-status-type+ 7136)
6.53+(defconstant +rustls-result-message-invalid-cert-request+ 7137)
6.54+(defconstant +rustls-result-message-invalid-dh-params+ 7138)
6.55+(defconstant +rustls-result-message-invalid-empty-payload+ 7139)
6.56+(defconstant +rustls-result-message-invalid-key-update+ 7140)
6.57+(defconstant +rustls-result-message-invalid-server-name+ 7141)
6.58+(defconstant +rustls-result-message-too-large+ 7142)
6.59+(defconstant +rustls-result-message-too-short+ 7143)
6.60+(defconstant +rustls-result-message-missing-data+ 7144)
6.61+(defconstant +rustls-result-message-missing-key-exchange+ 7145)
6.62+(defconstant +rustls-result-message-no-signature-schemes+ 7146)
6.63+(defconstant +rustls-result-message-trailing-data+ 7147)
6.64+(defconstant +rustls-result-message-unexpected-message+ 7148)
6.65+(defconstant +rustls-result-message-unknown-protocol-version+ 7149)
6.66+(defconstant +rustls-result-message-unsupported-compression+ 7150)
6.67+(defconstant +rustls-result-message-unsupported-curve-type+ 7151)
6.68+(defconstant +rustls-result-message-unsupported-key-exchange-algorithm+ 7152)
6.69+(defconstant +rustls-result-message-invalid-other+ 7153)
6.70+(defconstant +rustls-result-peer-incompatible-error+ 7107)
6.71+(defconstant +rustls-result-peer-misbehaved-error+ 7108)
6.72+(defconstant +rustls-result-inappropriate-message+ 7109)
6.73+(defconstant +rustls-result-inappropriate-handshake-message+ 7110)
6.74+(defconstant +rustls-result-general+ 7112)
6.75+(defconstant +rustls-result-alert-close-notify+ 7200)
6.76+(defconstant +rustls-result-alert-unexpected-message+ 7201)
6.77+(defconstant +rustls-result-alert-bad-record-mac+ 7202)
6.78+(defconstant +rustls-result-alert-decryption-failed+ 7203)
6.79+(defconstant +rustls-result-alert-record-overflow+ 7204)
6.80+(defconstant +rustls-result-alert-decompression-failure+ 7205)
6.81+(defconstant +rustls-result-alert-handshake-failure+ 7206)
6.82+(defconstant +rustls-result-alert-no-certificate+ 7207)
6.83+(defconstant +rustls-result-alert-bad-certificate+ 7208)
6.84+(defconstant +rustls-result-alert-unsupported-certificate+ 7209)
6.85+(defconstant +rustls-result-alert-certificate-revoked+ 7210)
6.86+(defconstant +rustls-result-alert-certificate-expired+ 7211)
6.87+(defconstant +rustls-result-alert-certificate-unknown+ 7212)
6.88+(defconstant +rustls-result-alert-illegal-parameter+ 7213)
6.89+(defconstant +rustls-result-alert-unknown-ca+ 7214)
6.90+(defconstant +rustls-result-alert-access-denied+ 7215)
6.91+(defconstant +rustls-result-alert-decode-error+ 7216)
6.92+(defconstant +rustls-result-alert-decrypt-error+ 7217)
6.93+(defconstant +rustls-result-alert-export-restriction+ 7218)
6.94+(defconstant +rustls-result-alert-protocol-version+ 7219)
6.95+(defconstant +rustls-result-alert-insufficient-security+ 7220)
6.96+(defconstant +rustls-result-alert-internal-error+ 7221)
6.97+(defconstant +rustls-result-alert-inappropriate-fallback+ 7222)
6.98+(defconstant +rustls-result-alert-user-canceled+ 7223)
6.99+(defconstant +rustls-result-alert-no-renegotiation+ 7224)
6.100+(defconstant +rustls-result-alert-missing-extension+ 7225)
6.101+(defconstant +rustls-result-alert-unsupported-extension+ 7226)
6.102+(defconstant +rustls-result-alert-certificate-unobtainable+ 7227)
6.103+(defconstant +rustls-result-alert-unrecognised-name+ 7228)
6.104+(defconstant +rustls-result-alert-bad-certificate-status-response+ 7229)
6.105+(defconstant +rustls-result-alert-bad-certificate-hash-value+ 7230)
6.106+(defconstant +rustls-result-alert-unknown-psk-identity+ 7231)
6.107+(defconstant +rustls-result-alert-certificate-required+ 7232)
6.108+(defconstant +rustls-result-alert-no-application-protocol+ 7233)
6.109+(defconstant +rustls-result-alert-unknown+ 7234)
6.110+(defconstant +rustls-result-cert-revocation-list-bad-signature+ 7400)
6.111+(defconstant +rustls-result-cert-revocation-list-invalid-crl-number+ 7401)
6.112+(defconstant +rustls-result-cert-revocation-list-invalid-revoked-cert-serial-number+ 7402)
6.113+(defconstant +rustls-result-cert-revocation-list-issuer-invalid-for-crl+ 7403)
6.114+(defconstant +rustls-result-cert-revocation-list-other-error+ 7404)
6.115+(defconstant +rustls-result-cert-revocation-list-parse-error+ 7405)
6.116+(defconstant +rustls-result-cert-revocation-list-unsupported-crl-version+ 7406)
6.117+(defconstant +rustls-result-cert-revocation-list-unsupported-critical-extension+ 7407)
6.118+(defconstant +rustls-result-cert-revocation-list-unsupported-delta-crl+ 7408)
6.119+(defconstant +rustls-result-cert-revocation-list-unsupported-indirect-crl+ 7409)
6.120+(defconstant +rustls-result-cert-revocation-list-unsupported-revocation-reason+ 7410)
6.121+(defconstant +rustls-result-client-cert-verifier-builder-no-root-anchors+ 7500)
6.122+
6.123+(define-alien-type rustls-tls-version int)
6.124+
6.125+(defconstant +rustls-tls-version-sslv2+ 512)
6.126+(defconstant +rustls-tls-version-sslv3+ 768)
6.127+(defconstant +rustls-tls-version-tlsv1-0+ 769)
6.128+(defconstant +rustls-tls-version-tlsv1-1+ 770)
6.129+(defconstant +rustls-tls-version-tlsv1-2+ 771)
6.130+(defconstant +rustls-tls-version-tlsv1-3+ 772)
6.131+
6.132+(define-alien-type rustls-accepted (struct rustls-accepted))
6.133+
6.134+(define-alien-type rustls-accepted-alert (struct rustls-accepted-alert))
6.135+
6.136+(define-alien-type rustls-acceptor (struct rustls-acceptor))
6.137+
6.138+(define-alien-type rustls-certificate (struct rustls-certificate))
6.139+
6.140+(define-alien-type rustls-certified-key (struct rustls-certified-key))
6.141+
6.142+(define-alien-type rustls-client-cert-verifier (struct rustls-client-cert-verifier))
6.143+
6.144+(define-alien-type rustls-client-config (struct rustls-client-config))
6.145+
6.146+(define-alien-type rustls-client-config-builder (struct rustls-client-config-builder))
6.147+
6.148+(define-alien-type rustls-connection (struct rustls-connection))
6.149+
6.150+(define-alien-type rustls-iovec (struct rustls-iovec))
6.151+
6.152+(define-alien-type rustls-root-cert-store (struct rustls-root-cert-store))
6.153+
6.154+(define-alien-type rustls-root-cert-store-builder (struct rustls-root-cert-store-builder))
6.155+
6.156+(define-alien-type rustls-server-cert-verifier (struct rustls-server-cert-verifier))
6.157+
6.158+(define-alien-type rustls-server-config (struct rustls-server-config))
6.159+
6.160+(define-alien-type rustls-server-config-builder (struct rustls-server-config-builder))
6.161+
6.162+(define-alien-type rustls-slice-slice-bytes (struct rustls-slice-slice-bytes))
6.163+
6.164+(define-alien-type rustls-slice-str (struct rustls-slice-str))
6.165+
6.166+(define-alien-type rustls-supported-ciphersuite (struct rustls-supported-ciphersuite))
6.167+
6.168+(define-alien-type rustls-web-pki-client-cert-verifier-builder (struct rustls-web-pki-client-cert-verifier-builder))
6.169+
6.170+(define-alien-type rustls-web-pki-server-cert-verifier-builder (struct rustls-web-pki-server-cert-verifier-builder))
6.171+
6.172+(define-alien-type rustls-str (struct rustls-str))
6.173+
6.174+(define-alien-type rustls-io-result int)
6.175+
6.176+(define-alien-type rustls-slice-bytes (struct rustls-slice-bytes))
6.177+
6.178+(define-alien-type rustls-verify-server-cert-user-data (* t))
6.179+
6.180+(define-alien-type rustls-verify-server-cert-params (struct rustls-verify-server-cert-params))
6.181+
6.182+(define-alien-type rustls-log-level size-t)
6.183+
6.184+(define-alien-type rustls-log-params (struct rustls-log-params))
6.185+
6.186+(define-alien-type rustls-client-hello-userdata (* t))
6.187+
6.188+(define-alien-type rustls-slice-u16 (struct rustls-slice-u16))
6.189+
6.190+(define-alien-type rustls-client-hello (struct rustls-client-hello))
6.191+
6.192+(define-alien-type rustls-certified-key (struct rustls-certified-key))
6.193+
6.194+(define-alien-type rustls-session-store-userdata (* t))
6.195+
6.196+(define-alien-type rustls-supported-ciphersuite (struct rustls-supported-ciphersuite))
7.1--- a/lisp/lib/cry/pkg.lisp Thu May 23 00:21:57 2024 -0400
7.2+++ b/lisp/lib/cry/pkg.lisp Thu May 23 18:23:38 2024 -0400
7.3@@ -1,8 +1,6 @@
7.4 (defpackage :cry
7.5- ;; very unfortunate that ironclad takes the nickname 'crypto'
7.6- ;; (:nicknames :crypto)
7.7 (:nicknames :cryptography)
7.8- (:shadowing-import-from :ironclad :integer-to-octets :octets-to-integer)
7.9+ (:shadowing-import-from :ironclad :integer-to-octets :octets-to-integer :xor)
7.10 (:use :cl :std :sb-thread :sb-concurrency :ironclad :obj/db :obj/id)
7.11 (:export :crypto-error :crypto-token-expired :crypto-token-invalid
7.12 :crypto-key :token :crypto-token :password
8.1--- a/lisp/lib/net/net.asd Thu May 23 00:21:57 2024 -0400
8.2+++ b/lisp/lib/net/net.asd Thu May 23 18:23:38 2024 -0400
8.3@@ -8,6 +8,7 @@
8.4 :dat :obj :io :parse
8.5 ;; :swank ;; HACK 2024-05-12: temporarily disable, incompatible with current upstream
8.6 ;; :swank-client
8.7+ :cl+ssl
8.8 :dexador ;; fetch
8.9 :chipz :babel :chunga
8.10 :hunchentoot :std :log)
9.1--- a/lisp/lib/net/pkg.lisp Thu May 23 00:21:57 2024 -0400
9.2+++ b/lisp/lib/net/pkg.lisp Thu May 23 18:23:38 2024 -0400
9.3@@ -159,7 +159,7 @@
9.4 (:nicknames :http)
9.5 (:use :cl :std :net/core :sb-bsd-sockets :parse/bytes :io/xsubseq :io/smart-buffer)
9.6 (:export
9.7- :make-parser
9.8+ :make-http-parser
9.9 :http-request
9.10 :http-response
9.11 :make-http-request
9.12@@ -292,7 +292,7 @@
9.13 :*default-read-timeout*
9.14 :*default-proxy*
9.15 :*verbose*
9.16- :*not-verify-ssl*
9.17+ :*no-ssl*
9.18 :*connection-pool*
9.19 :*use-connection-pool*
9.20 :make-connection-pool
10.1--- a/lisp/lib/net/proto/http.lisp Thu May 23 00:21:57 2024 -0400
10.2+++ b/lisp/lib/net/proto/http.lisp Thu May 23 18:23:38 2024 -0400
10.3@@ -138,7 +138,7 @@
10.4
10.5 (declaim (inline position-not-whitespace))
10.6 (defun position-not-whitespace (string &key from-end)
10.7- (declare (type #+ecl string #-ecl simple-string string)
10.8+ (declare (type simple-string string)
10.9 (optimize (speed 3) (safety 0)))
10.10 (let* ((len (length string))
10.11 (start (if from-end (1- len) 0))
10.12@@ -161,8 +161,8 @@
10.13 (let ((end (position-not-whitespace string :from-end t))
10.14 (dot-read-p nil))
10.15 ;; spaces string
10.16- (when (null end)
10.17- (return-from number-string-p nil))
10.18+ ;; (when (null end)
10.19+ ;; (return-from number-string-p))
10.20 (locally (declare (type integer end)
10.21 (optimize (safety 0)))
10.22 (incf end)
10.23@@ -182,7 +182,7 @@
10.24 (T (return-from number-string-p nil))))))))
10.25
10.26 ;;; http
10.27-(defun make-parser (http &key first-line-callback header-callback body-callback finish-callback (head-request nil))
10.28+(defun make-http-parser (http &key first-line-callback header-callback body-callback finish-callback (head-request nil))
10.29 (declare (type http http))
10.30 (let (callbacks
10.31
10.32@@ -1403,7 +1403,7 @@
10.33 (return-from http-message-needs-eof-p nil))
10.34 T))
10.35
10.36-(defun parse-body (http callbacks data start end requestp)
10.37+(defun parse-http-body (http callbacks data start end requestp)
10.38 (declare (type http http)
10.39 (type octet-vector data)
10.40 (type pointer start end))
10.41@@ -1634,7 +1634,7 @@
10.42 (if (http-chunked-p http)
10.43 (advance-to* (parse-chunked-body http callbacks data (pos) end))
10.44 (progn
10.45- (and (advance-to* (parse-body http callbacks data (pos) end t))
10.46+ (and (advance-to* (parse-http-body http callbacks data (pos) end t))
10.47 (go first-line))))
10.48 (return-from parse-request (pos)))))
10.49 (error 'eof)))
10.50@@ -1706,7 +1706,7 @@
10.51 (if (http-chunked-p http)
10.52 (advance-to* (parse-chunked-body http callbacks data (pos) end))
10.53 (progn
10.54- (advance-to* (parse-body http callbacks data (pos) end nil))
10.55+ (advance-to* (parse-http-body http callbacks data (pos) end nil))
10.56 (unless (eofp)
10.57 (go first-line))))
10.58 (return-from parse-response (pos)))))
11.1--- a/lisp/lib/net/req.lisp Thu May 23 00:21:57 2024 -0400
11.2+++ b/lisp/lib/net/req.lisp Thu May 23 18:23:38 2024 -0400
11.3@@ -214,7 +214,7 @@
11.4 (aref types 2)))))
11.5
11.6 (defun charset-to-encoding (charset &optional
11.7- (default *default-external-format*))
11.8+ (default sb-ext:*default-external-format*))
11.9 (cond
11.10 ((null charset)
11.11 default)
11.12@@ -347,17 +347,22 @@
11.13 byte))
11.14 (or (maybe-close stream t) :eof))))
11.15
11.16-(defmethod stream-read-sequence ((stream keep-alive-stream) sequence &optional start end)
11.17- (declare (optimize speed))
11.18- (if (null (keep-alive-stream-stream stream)) ;; we already closed it
11.19- start
11.20- (let* ((to-read (min (- end start) (keep-alive-stream-end stream)))
11.21- (n (read-sequence sequence (keep-alive-stream-stream stream)
11.22- :start start
11.23- :end (+ start to-read))))
11.24- (decf (keep-alive-stream-end stream) (- n start))
11.25- (maybe-close stream (<= (keep-alive-stream-end stream) 0))
11.26- n)))
11.27+(defmethod stream-read-sequence ((stream keep-alive-stream) sequence &optional (start 0) (end 0))
11.28+ (declare (optimize speed)
11.29+ (fixnum start end))
11.30+ (let ((%stream (keep-alive-stream-stream stream)))
11.31+ (if (null %stream) ;; we already closed it
11.32+ start
11.33+ (let* ((%end (keep-alive-stream-end stream))
11.34+ (to-read (if %end
11.35+ (min (- end start) (the fixnum %end))
11.36+ (- end start)))
11.37+ (n (read-sequence sequence %stream
11.38+ :start start
11.39+ :end (the fixnum (+ start to-read)))))
11.40+ (when %end (decf (the fixnum (keep-alive-stream-end stream)) (- n start)))
11.41+ (maybe-close stream (keep-alive-stream-end stream))
11.42+ n))))
11.43
11.44 (defmethod stream-read-sequence ((stream keep-alive-chunked-stream) sequence &optional start end)
11.45 (declare (optimize speed))
11.46@@ -843,7 +848,7 @@
11.47 ;;; backend
11.48 (with-compilation-unit ()
11.49 (defparameter *ca-bundle*
11.50- (uiop:native-namestring #P"/etc/ssl/cacert.pem")
11.51+ (uiop:native-namestring #P"/etc/ca-certificates/extracted/ca-bundle.trust.crt")
11.52 "The default public root certificates used in requests.")
11.53
11.54
11.55@@ -1124,9 +1129,8 @@
11.56 (fail 'socks5-proxy-request-failed :reason "Unknown address")))))))
11.57
11.58 (defun make-ssl-stream (stream ca-path ssl-key-file ssl-cert-file ssl-key-password hostname insecure)
11.59- #+(not ssl) (declare (ignore stream ca-path ssl-key-file ssl-cert-file ssl-key-password hostname insecure))
11.60- #+(not ssl) (error "SSL not supported. Remove :dexador-no-ssl from *features* to enable SSL.")
11.61- #+ssl
11.62+ #+nil (declare (ignore stream ca-path ssl-key-file ssl-cert-file ssl-key-password hostname insecure))
11.63+ #+nil (error "SSL not supported. Remove :dexador-no-ssl from *features* to enable SSL.")
11.64 (progn
11.65 (cl+ssl:ensure-initialized)
11.66 (let ((ctx (cl+ssl:make-context :verify-mode
11.67@@ -1141,7 +1145,7 @@
11.68 ;; In executable environment, perhaps *ca-bundle* doesn't exist.
11.69 (t :default))))
11.70 (ssl-cert-pem-p (and ssl-cert-file
11.71- (std/seq:ends-with-subseq ".pem" ssl-cert-file))))
11.72+ (std/seq:ends-with-subseq ".crt" ssl-cert-file))))
11.73 (cl+ssl:with-global-context (ctx :auto-free-p t)
11.74 (when ssl-cert-pem-p
11.75 (cl+ssl:use-certificate-chain-file ssl-cert-file))
11.76@@ -1195,8 +1199,8 @@
11.77 (restart-case
11.78 (let* ((con-uri (uri (or proxy uri)))
11.79 (connection (usocket:socket-connect (uri-host con-uri)
11.80- (or (uri-port con-uri) 80)
11.81- #-(or ecl clasp clisp allegro) :timeout #-(or ecl clasp clisp allegro) connect-timeout
11.82+ (or (uri-port con-uri) (when insecure 80) 443)
11.83+ :timeout connect-timeout
11.84 :element-type '(unsigned-byte 8)))
11.85 (stream
11.86 (usocket:socket-stream connection))
11.87@@ -1207,7 +1211,7 @@
11.88 #-lispworks(setf (usocket:socket-option connection :receive-timeout) read-timeout))
11.89 (when (socks5-proxy-p proxy-uri)
11.90 (ensure-socks5-connected stream stream uri method))
11.91- (if (string= (symbol-name scheme) "https")
11.92+ (if (string= (symbol-name scheme) "HTTPS")
11.93 (make-ssl-stream (if (http-proxy-p proxy-uri)
11.94 (make-connect-stream uri version stream (make-proxy-authorization con-uri))
11.95 stream) ca-path ssl-key-file ssl-cert-file ssl-key-password (uri-host uri) insecure)
12.1--- a/lisp/lib/skel/core/obj.lisp Thu May 23 00:21:57 2024 -0400
12.2+++ b/lisp/lib/skel/core/obj.lisp Thu May 23 18:23:38 2024 -0400
12.3@@ -162,7 +162,7 @@
12.4 (when-let ((sources (sk-rule-source rule)))
12.5 (mapcar
12.6 (lambda (src)
12.7- (if-let ((sr (sk-find-rule src obj)))
12.8+ (if-let* ((sr (sk-find-rule src obj)))
12.9 (sk-make obj sr)
12.10 (warn! "unhandled source:" src "for rule:" rule)))
12.11 sources))
12.12@@ -429,7 +429,7 @@
12.13 (when (bound-string-p self 'stash) (setf (sk-stash self) (pathname (the simple-string (sk-stash self)))))
12.14 (when (bound-string-p self 'store) (setf (sk-store self) (pathname (the simple-string (sk-store self)))))
12.15 (if (bound-string-p self 'scripts)
12.16- (if-let ((path (probe-file (pathname (the simple-string (sk-scripts self))))))
12.17+ (if-let* ((path (probe-file (pathname (the simple-string (sk-scripts self))))))
12.18 (setf (sk-scripts self)
12.19 (if (directory-path-p path)
12.20 (find-files path)
13.1--- a/lisp/lib/skel/pkg.lisp Thu May 23 00:21:57 2024 -0400
13.2+++ b/lisp/lib/skel/pkg.lisp Thu May 23 18:23:38 2024 -0400
13.3@@ -37,7 +37,7 @@
13.4 (:import-from :uiop/pathname :pathname-parent-directory-pathname)
13.5 (:import-from :uiop :with-current-directory)
13.6 (:import-from :sb-ext :run-program :cas)
13.7- (:import-from :std :when-let)
13.8+ (:import-from :std :when-let :if-let :if-let*)
13.9 (:import-from :sxp :form)
13.10 (:export
13.11 ;; err
14.1--- a/lisp/prelude.asd Thu May 23 00:21:57 2024 -0400
14.2+++ b/lisp/prelude.asd Thu May 23 18:23:38 2024 -0400
14.3@@ -1,15 +1,16 @@
14.4 (pushnew :prelude *features*)
14.5 (pushnew "PRELUDE" *modules* :test 'equal)
14.6+
14.7 (defsystem :prelude
14.8- :depends-on (:std :dat :cli :doc
14.9- :io :gui :log :net
14.10+ :depends-on (:std :cli :doc
14.11 :nlp :obj :organ :packy
14.12 :parse :pod :rdb :rt
14.13 :skel :syn :xdb :alsa
14.14 :rocksdb :btrfs :uring
14.15 :tree-sitter :xkb :ssh2 :sndfile ;; magick
14.16 :zstd :uring :blake3 :ublk
14.17- :nuklear :aud :cry :krypt)
14.18+ :nuklear :aud :cry :krypt
14.19+ :io :gui :log :dat :net)
14.20 :build-operation monolithic-compile-bundle-op
14.21 :build-pathname "prelude")
14.22
15.1--- a/lisp/std/alien.lisp Thu May 23 00:21:57 2024 -0400
15.2+++ b/lisp/std/alien.lisp Thu May 23 18:23:38 2024 -0400
15.3@@ -50,9 +50,9 @@
15.4 (pushnew ,(sb-int:keywordicate (string-upcase name)) *features*)))
15.5 ,@(when export (list `(export '(,fname)))))))
15.6
15.7-(defmacro define-opaque (ty &optional no-export)
15.8+(defmacro define-opaque (ty &optional no-export foreign-type)
15.9 `(prog1
15.10- (define-alien-type ,ty (struct ,(symbolicate ty '-t)))
15.11+ (define-alien-type ,ty (struct ,(or foreign-type (symbolicate ty '-t))))
15.12 ,(unless no-export `(export '(,ty)))))
15.13
15.14 (defun setfa (place from)