Changeset 40257 in project


Ignore:
Timestamp:
07/05/21 22:08:01 (3 weeks ago)
Author:
Vasilij Schneidermann
Message:

openssl: Expose supported min/max protocols and protocol list

Location:
release/5/openssl/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • release/5/openssl/trunk/openssl.egg

    r40227 r40257  
    44 (license "BSD")
    55 (category net)
    6  (dependencies srfi-13 srfi-18 address-info)
     6 (dependencies srfi-1 srfi-13 srfi-18 address-info)
    77 (test-dependencies test)
    88 (foreign-dependencies "openssl-1.1.0")
  • release/5/openssl/trunk/openssl.socket.scm

    r40208 r40257  
    11(module (openssl socket)
    22  (
     3   supported-ssl-protocols ssl-min-protocol ssl-max-protocol
    34   ssl-connect ssl-connect*
    45   ssl-make-client-context ssl-make-client-context*
     
    4142(import (chicken string))
    4243(import (chicken time))
     44(import (srfi 1))
    4345(import (srfi 13))
    4446(import (srfi 18))
     
    169171(define tlsv12-version (foreign-value "TLS1_2_VERSION" int))
    170172(define tlsv13-version (foreign-value "TLS1_3_VERSION" int))
     173
     174(define supported-ssl-protocols
     175  (append (if (negative? tlsv1-version) '() '(tlsv1))
     176          (if (negative? tlsv11-version) '() '(tlsv11))
     177          (if (negative? tlsv12-version) '() '(tlsv12))
     178          (if (negative? tlsv13-version) '() '(tlsv13))))
     179
     180(define ssl-min-protocol (car supported-ssl-protocols))
     181(define ssl-max-protocol (last supported-ssl-protocols))
    171182
    172183(define (ssl-protocol->enum protocol)
  • release/5/openssl/trunk/tests/socket-test.scm

    r40256 r40257  
    9898  (protocol-test test-error client-protocol server-protocol))
    9999
    100 (compatible-protocol-test 'tlsv1 'tlsv1)
    101 (compatible-protocol-test 'tlsv12 'tlsv12)
    102 (compatible-protocol-test 'tlsv1 '(tlsv1 . tlsv12))
    103 (compatible-protocol-test 'tlsv12 '(tlsv1 . tlsv12))
    104 (compatible-protocol-test '(tlsv1 . tlsv12) 'tlsv11)
    105 (compatible-protocol-test '(tlsv11 . tlsv12) 'tlsv12)
    106 (compatible-protocol-test '(tlsv1 . tlsv12) '(tlsv1 . tlsv12))
    107 (compatible-protocol-test '(tlsv1 . tlsv12) '(tlsv11 . tlsv12))
    108 (incompatible-protocol-test 'tlsv1 'tlsv12)
    109 (incompatible-protocol-test 'tlsv12 'tlsv1)
    110 (incompatible-protocol-test 'tlsv1 '(tlsv11 . tlsv12))
    111 (incompatible-protocol-test '(tlsv11 . tlsv12) 'tlsv1)
     100(test-assert "Minimum supported SSL protocol in supported protocol list"
     101             (memv ssl-min-protocol supported-ssl-protocols))
     102(test-assert "Maximum supported SSL protocol in supported protocol list"
     103             (memv ssl-max-protocol supported-ssl-protocols))
     104
     105(compatible-protocol-test ssl-min-protocol ssl-min-protocol)
     106(compatible-protocol-test ssl-max-protocol ssl-max-protocol)
     107(compatible-protocol-test ssl-min-protocol (cons ssl-min-protocol ssl-max-protocol))
     108(compatible-protocol-test ssl-max-protocol (cons ssl-min-protocol ssl-max-protocol))
     109(compatible-protocol-test (cons ssl-min-protocol ssl-max-protocol) 'tlsv11)
     110(compatible-protocol-test (cons 'tlsv11 ssl-max-protocol) ssl-max-protocol)
     111(compatible-protocol-test (cons ssl-min-protocol ssl-max-protocol) (cons ssl-min-protocol ssl-max-protocol))
     112(compatible-protocol-test (cons ssl-min-protocol ssl-max-protocol) (cons 'tlsv11 ssl-max-protocol))
     113(incompatible-protocol-test ssl-min-protocol ssl-max-protocol)
     114(incompatible-protocol-test ssl-max-protocol ssl-min-protocol)
     115(incompatible-protocol-test ssl-min-protocol (cons 'tlsv11 ssl-max-protocol))
     116(incompatible-protocol-test (cons 'tlsv11 ssl-max-protocol) ssl-min-protocol)
Note: See TracChangeset for help on using the changeset viewer.