]> gitweb.factorcode.org Git - factor.git/commitdiff
TLS alpn code clean up.
authorDavid Flores <dflores0818@gmail.com>
Mon, 26 Apr 2021 04:07:15 +0000 (21:07 -0700)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 4 May 2021 17:05:54 +0000 (10:05 -0700)
basis/openssl/libssl/libssl.factor

index 7f7ff60df1465f52ed5f19cc5d91e0e5d49a6814..f9d5001acd3aabb99bdac1c93771702e0d080fdc 100644 (file)
@@ -550,8 +550,8 @@ c-string* data, uint* len )
 
 : alpn_select_cb_func ( -- alien )
     [|  ssl out outlen in inlen arg |
-        B
         ! if alpn-protocols is empty return err noack
+
         ! current-secure-context relies on secure-context
         ! variable being set. if this is not set in a callback,
         ! we need some other way of accessing it (probably
@@ -560,15 +560,12 @@ c-string* data, uint* len )
         ! callback can be called)
         current-secure-context config>> alpn-supported-protocols>>
         [ SSL_TLSEXT_ERR_NOACK ]
-        [ ! set up out parameters
-          ! "" c-string <ref> :> outlocal
-          [ out outlen ] dip
+        [ [ out outlen ] dip
           ! convert alpn-protocols from list of strings to
           ! c-string in wire format and length.
           ! see https://www.openssl.org/docs/manmaster/man3/SSL_set_alpn_protos.html
           [ utf8 encode dup length prefix ] map
           concat dup length
-          ! call SSL_select_next_proto, with out parameters
           in inlen SSL_select_next_proto
           ! the function returns OPENSSL_NPN_NO_OVERLAP when no
           ! match is found, otherwise OPENSSL_NPN_NEGOTIATED
@@ -580,10 +577,8 @@ c-string* data, uint* len )
             ! is identical to. (out needs to point directly into
             ! in, or a buffer that will outlive the tls
             ! handshake.)
-
-            ! return err ok.
             SSL_TLSEXT_ERR_OK ]
-          [ SSL_TLSEXT_ERR_ALERT_FATAL ] if 
+          [ SSL_TLSEXT_ERR_ALERT_FATAL ] if
         ] if-empty
     ] SSL_CTX_alpn_select_cb_func ;