Commit Graph

42 Commits

Author SHA1 Message Date
Eli Barzilay
af6be85ff5 Fix lots of indentation mistakes.
(Found by my ayatollah script...)
2013-03-14 10:55:47 -04:00
Ryan Culpepper
fd7d8a412c move lazy-require to racket/lazy-require 2012-12-03 19:28:12 -05:00
Ryan Culpepper
10a348815b load certificates from macosx keychains 2012-11-29 17:06:14 -05:00
Ryan Culpepper
7775a30a7f fix contract mistakes 2012-11-29 00:47:54 -05:00
Ryan Culpepper
fc4010d327 added todo list 2012-11-28 15:11:31 -05:00
Ryan Culpepper
dc2a63182d remove error checks obviated by contracts 2012-11-28 15:06:06 -05:00
Ryan Culpepper
994f2998de added contracts 2012-11-28 15:06:06 -05:00
Ryan Culpepper
3d37eb4ae4 untabify, #lang 2012-11-28 15:06:06 -05:00
Ryan Culpepper
7b0a13bf74 load root certificates from windows system certificate store
Also, some recently added functions and parameters are renamed for
greater generality ("root-certificates" -> "verify sources").
2012-11-28 15:06:06 -05:00
Ryan Culpepper
07c6e89899 remove cancel box, no longer needed with ffi/unsafe/alloc
Also, found the source of mem corruption: the finalizer's cancel box
(from create-ssl) was shadowed by a new box put in mzssl struct.
2012-11-21 12:56:31 -05:00
Ryan Culpepper
44177ca406 use ffi/unsafe/alloc
Fixes a memory leak in SSL_get_peer_certificate.

Fixes a memory leak (finalizer closure refers to obj) in create-ssl
for _SSL* obj. Correcting the finalizer to run caused mem corruption
(possibly due to double-freeing in mzssl-release, despite cancel box)
but changing to allocator/deallocator seems to avoid the problem.
2012-11-21 12:56:31 -05:00
Ryan Culpepper
25847a9342 lift error checking out of atomic 2012-11-21 12:56:31 -05:00
Ryan Culpepper
df10bf3421 simpler version of make-immobile-bytes 2012-11-21 12:56:31 -05:00
Ryan Culpepper
b377976ba5 use ffi/unsafe/atomic 2012-11-21 12:56:31 -05:00
Ryan Culpepper
85fba029a5 use define-cpointer-type 2012-11-21 12:56:31 -05:00
Ryan Culpepper
ba62b1dd57 added ssl-secure-client-connection 2012-11-21 12:39:18 -05:00
Ryan Culpepper
f446adad3f added ssl-set-ciphers! 2012-11-21 12:39:17 -05:00
Ryan Culpepper
4b4113d528 get default CA cert locations (when available)
This probably doesn't work on Windows or Mac OS X.
2012-11-21 12:39:17 -05:00
Ryan Culpepper
c632a84a95 add ssl-seal-context!
Unsealed contexts are not safe to share, because one user may
change it in a way that ruins the security of another.
2012-11-21 12:39:17 -05:00
Ryan Culpepper
ba1f4a6b22 fix for ssl-set-verify-hostname! 2012-11-17 16:46:10 -05:00
Ryan Culpepper
5cdb967251 added ssl-set-verify-hostname! 2012-11-17 15:36:18 -05:00
Ryan Culpepper
1c0e08f0a6 do security-guard check in ssl-load... 2012-11-17 14:47:13 -05:00
Ryan Culpepper
d6cb2ecee6 add ssl hostname verification support 2012-11-17 14:47:13 -05:00
Marc Burns
fa0336bfad Call close-output-port' on abandoned port in ssl-abandon-port'.
This change causes the abandoned output port to be properly shutdown,
when the `shutdown-on-close' option is set, and decrements the mzssl
struct reference count when a port is abandoned.

Previously, the `*-[im]pure-port' methods from `net/url' would fail to
close the SSL socket associated with the connection when
`close-input-port' was called on the port object returned.  This patch
causes the underlying socket to be closed when `close-input-port' is
called on SSL-based ports returned by functions in `net/url'.
2012-10-05 11:13:20 -04:00
Matthew Flatt
a137459b65 more error-message conversions and repairs 2012-05-27 11:29:21 -06:00
Matthew Flatt
06e94d510a openssl: another attempt to get SSL_shutdown right 2012-03-02 10:33:36 -07:00
Matthew Flatt
a976c56cb9 openssl: more little fixes
Fix an error message broken by earlier debugging, and also
fix long-standing shutdown problems. Move basic tests to more
standard location.
2012-03-01 20:34:53 -07:00
Matthew Flatt
fc2eb1c11c openssl: fix error handling
The recent thread-safety change wasn't right.
2012-03-01 15:43:04 -07:00
Matthew Flatt
14f03bcf5b openssl: thread safety
There are many SSL_() functions that produce return codes with more
information from SLL_get_error() and/or ERR_get_error(). Those need
to be grouped in an atomic section to ensure thread safety at the
level of Racket threads.
2012-03-01 11:02:48 -07:00
Matthew Flatt
1032ce8afe openssl: make ssl-set-verify!' and ssl-try-verify!' work on ports
Using the functions on a port triggers renegotiation of the
connection, which s useful for cases such as a web server that
requires a certificate only for certain paths. This functionality
also allows better testing of the SSL library.
2012-03-01 11:02:48 -07:00
Matthew Flatt
efcb607865 fix openssl problem
Read and write actions on an SSL port can trigger internal write
and read actions (i.e., the opposite direction). On the read side,
write pumping was performed too early before returning a "wait
for new input" event; SSL operations between the pumping and
return could trigger the need for pumping, but it never happened
because the socket was waiting for new input before taking any
new actions.

The problem would shows up specifically when Apache renegotiates
a connection to demand certificates from a client after first
determining the target of the request (i.e., when a certificate
is required ony for specific locations on the server).

Thenks to Sergey Pinaev, Timur Sufiev, and Neil Van Dyke.
2012-03-01 11:02:47 -07:00
Matthew Flatt
9bceb885c7 make sure only one place initializes SSL 2011-06-30 10:53:19 -06:00
Asumu Takikawa
4cc0af90aa Handle SSLv2 absence gracefully and update docs. 2011-04-25 17:56:45 -04:00
Matthew Flatt
ff6da2e43e add docs for openssl additions 2011-03-03 07:18:51 -07:00
Curtis Dutton
7a33c9cebb Adds ssl-try-verify! to the openssl package along with supporting procedures.
This enables an ssl server the option to communicate with both verified and unverified peers with the same listener.

Supporting API calls...

ssl-peer-verified? -> returns #t if an ssl-port's peer has presented a valid and verified certificate
ssl-peer-subject-name -> returns the subject field of the certificate presented by an ssl-port's peer
ssl-peer-issuer-name -> returns the issuer field of the certificate presented by an ssl-port's peer
2011-03-03 07:07:53 -07:00
Matthew Flatt
4afd36c9fd openssl: use libcrypto and libssl version 1.0 if available
and single point of control for all uses
2011-03-02 12:07:45 -07:00
David Van Horn
c9519fd113 Fixed various spelling errors. 2011-02-03 17:42:33 -05:00
Matthew Flatt
421519994d make SSL listeners events 2010-11-17 13:16:53 -07:00
Jay McCarthy
e847632456 OpenSSL more compatible with tcp unit 2010-10-06 10:41:09 -06:00
Matthew Flatt
16f1dffe4c add `ssl-port?' and add missing docs for two other procs 2010-08-19 16:14:11 -06:00
Eli Barzilay
2d9601089d A lot of "MzScheme" -> "Racket"s. 2010-05-16 18:26:26 -04:00
Matthew Flatt
28b4043077 rename all files .ss -> .rkt 2010-04-27 16:50:15 -06:00