openssl: use OPENSSL_sk_num when no sk_num, etc.

OpenSSL 1.1 adds `OPENSSL_` to the front of some names.
This commit is contained in:
Matthew Flatt 2019-10-22 16:58:19 -06:00 committed by Sam Tobin-Hochstadt
parent 2f8207e7c9
commit b1cae06897
2 changed files with 24 additions and 3 deletions

View File

@ -0,0 +1,12 @@
#lang racket
(require openssl/mzssl)
(define-values (r w) (ssl-connect "www.racket-lang.org" 443))
(define hostnames (ssl-peer-certificate-hostnames r))
(unless (and (list? hostnames)
(andmap string? hostnames))
(error "not a good hostnames result"))
(when (null? hostnames)
(error "expected some hostnames"))

View File

@ -349,10 +349,19 @@ TO DO:
(define-crypto X509_NAME_get_entry (_fun _X509_NAME* _int -> _X509_NAME_ENTRY*/null))
(define-crypto X509_NAME_ENTRY_get_data (_fun _X509_NAME_ENTRY* -> _ASN1_STRING*))
(define-crypto X509_get_ext_d2i (_fun _X509* _int _pointer _pointer -> _STACK*/null))
(define-crypto sk_num (_fun _STACK* -> _int))
(define-crypto sk_num (_fun _STACK* -> _int)
#:fail (lambda ()
(define-crypto OPENSSL_sk_num (_fun _STACK* -> _int))
OPENSSL_sk_num))
(define-crypto sk_GENERAL_NAME_value (_fun _STACK* _int -> _GENERAL_NAME-pointer)
#:c-id sk_value)
(define-crypto sk_pop_free (_fun _STACK* _fpointer -> _void))
#:c-id sk_value
#:fail (lambda ()
(define-crypto OPENSSL_sk_value (_fun _STACK* _int -> _GENERAL_NAME-pointer))
OPENSSL_sk_value))
(define-crypto sk_pop_free (_fun _STACK* _fpointer -> _void)
#:fail (lambda ()
(define-crypto OPENSSL_sk_pop_free (_fun _STACK* _fpointer -> _void))
OPENSSL_sk_pop_free))
;; (define-crypto X509_get_default_cert_area (_fun -> _string))
(define-crypto X509_get_default_cert_dir (_fun -> _string))