Hi, there! :)
Tobias and I fixed the SqueakSSL implementation for Windows. Please find the modified source code attached and add it to the VM code repository.
sqWin32SSL.c http://forum.world.st/file/n4820813/sqWin32SSL.c
The fixes are:
- SNI support - setting an Int property via sqSetIntPropertySSL(...) - Unicode problems when extracting the correct peerName in sqExtractPeerName
Tobias will send around builds for the shared libraries ASAP. :)
Best, Marcel
-- View this message in context: http://forum.world.st/FIXED-SqueakSSL-for-Windows-tp4820813.html Sent from the Squeak VM mailing list archive at Nabble.com.
Great news! I dug up a windows machine this morning to do this myself somewhere in the near future, but you guys were faster. I found that the sqSetStringPropertySSL function in the Windows branch still has the memory leaks I patched a while ago on Unix. The function should be something like this:
sqInt sqSetStringPropertySSL(sqInt handle, int propID, char *propName, sqInt propLen) { sqSSL *ssl = sslFromHandle(handle); char *property = NULL;
if(ssl == NULL) return 0;
if(propLen > 0) { property = malloc(propLen + 1); memcpy(property, propName, propLen); property[propLen] = '\0'; };
if(ssl->loglevel) printf("sqSetStringPropertySSL(%d): %s\n", propID, property ? propery : "(null)");
switch(propID) { case SQSSL_PROP_CERTNAME: if (ssl->certName) free(ssl->certName); ssl->certName = property; break; case SQSSL_PROP_SERVERNAME: if (ssl->serverName) free(ssl->serverName); ssl->serverName = property; break; /* Platform specific: Adds a .PFX file to MY certificate store w/o password. Useful for installing the default test certificate in SqueakSSL. */ case 10001: if(property) free(property); return sqAddPfxCertToStore(propName, propLen, NULL, 0); default: if(property) free(property); if(ssl->loglevel) printf("sqSetStringPropertySSL: Unknown property ID %d\n", propID); return 0; } return 1; }
This version doesn't let null be passed to printf, because that results in undefined behavior. It frees property when it's not used to avoid leaking memory. It frees ssl->certName when it's replaced to avoid leaking memory. It doesn't try to allocate property, if propLen is negative. It uses malloc instead of calloc for better performance :).
Levente
On Tue, 21 Apr 2015, Marcel Taeumel wrote:
Hi, there! :)
Tobias and I fixed the SqueakSSL implementation for Windows. Please find the modified source code attached and add it to the VM code repository.
sqWin32SSL.c http://forum.world.st/file/n4820813/sqWin32SSL.c
The fixes are:
- SNI support
- setting an Int property via sqSetIntPropertySSL(...)
- Unicode problems when extracting the correct peerName in sqExtractPeerName
Tobias will send around builds for the shared libraries ASAP. :)
Best, Marcel
-- View this message in context: http://forum.world.st/FIXED-SqueakSSL-for-Windows-tp4820813.html Sent from the Squeak VM mailing list archive at Nabble.com.
I just took a look at the Mac version of the function, and that's also missing some of these fixes.
Levente
On Tue, 21 Apr 2015, Levente Uzonyi wrote:
Great news! I dug up a windows machine this morning to do this myself somewhere in the near future, but you guys were faster. I found that the sqSetStringPropertySSL function in the Windows branch still has the memory leaks I patched a while ago on Unix. The function should be something like this:
sqInt sqSetStringPropertySSL(sqInt handle, int propID, char *propName, sqInt propLen) { sqSSL *ssl = sslFromHandle(handle); char *property = NULL;
if(ssl == NULL) return 0;
if(propLen > 0) { property = malloc(propLen + 1); memcpy(property, propName, propLen); property[propLen] = '\0'; };
if(ssl->loglevel) printf("sqSetStringPropertySSL(%d): %s\n", propID, property ? propery : "(null)");
switch(propID) { case SQSSL_PROP_CERTNAME: if (ssl->certName) free(ssl->certName); ssl->certName = property; break; case SQSSL_PROP_SERVERNAME: if (ssl->serverName) free(ssl->serverName); ssl->serverName = property; break; /* Platform specific: Adds a .PFX file to MY certificate store w/o password. Useful for installing the default test certificate in SqueakSSL. */ case 10001: if(property) free(property); return sqAddPfxCertToStore(propName, propLen, NULL, 0); default: if(property) free(property); if(ssl->loglevel) printf("sqSetStringPropertySSL: Unknown property ID %d\n", propID); return 0; } return 1; }
This version doesn't let null be passed to printf, because that results in undefined behavior. It frees property when it's not used to avoid leaking memory. It frees ssl->certName when it's replaced to avoid leaking memory. It doesn't try to allocate property, if propLen is negative. It uses malloc instead of calloc for better performance :).
Levente
On Tue, 21 Apr 2015, Marcel Taeumel wrote:
Hi, there! :)
Tobias and I fixed the SqueakSSL implementation for Windows. Please find the modified source code attached and add it to the VM code repository.
sqWin32SSL.c http://forum.world.st/file/n4820813/sqWin32SSL.c
The fixes are:
- SNI support
- setting an Int property via sqSetIntPropertySSL(...)
- Unicode problems when extracting the correct peerName in
sqExtractPeerName
Tobias will send around builds for the shared libraries ASAP. :)
Best, Marcel
-- View this message in context: http://forum.world.st/FIXED-SqueakSSL-for-Windows-tp4820813.html Sent from the Squeak VM mailing list archive at Nabble.com.
Ah, okay. I can integrate that tomorrow and make another build.
Best, Marcel
-- View this message in context: http://forum.world.st/FIXED-SqueakSSL-for-Windows-tp4820813p4820985.html Sent from the Squeak VM mailing list archive at Nabble.com.
thanks both! I've integrated but am not ready to commit yet.
On Tue, Apr 21, 2015 at 5:56 AM, Marcel Taeumel < marcel.taeumel@student.hpi.uni-potsdam.de> wrote:
Hi, there! :)
Tobias and I fixed the SqueakSSL implementation for Windows. Please find the modified source code attached and add it to the VM code repository.
sqWin32SSL.c http://forum.world.st/file/n4820813/sqWin32SSL.c
The fixes are:
- SNI support
- setting an Int property via sqSetIntPropertySSL(...)
- Unicode problems when extracting the correct peerName in
sqExtractPeerName
Tobias will send around builds for the shared libraries ASAP. :)
Best, Marcel
-- View this message in context: http://forum.world.st/FIXED-SqueakSSL-for-Windows-tp4820813.html Sent from the Squeak VM mailing list archive at Nabble.com.
FYI, we have a couple of Mantis issues related to Levente's updates:
http://bugs.squeak.org/view.php?id=7793
http://bugs.squeak.org/view.php?id=7824
Dave
thanks both! I've integrated but am not ready to commit yet.
On Tue, Apr 21, 2015 at 5:56 AM, Marcel Taeumel < marcel.taeumel@student.hpi.uni-potsdam.de> wrote:
Hi, there! :)
Tobias and I fixed the SqueakSSL implementation for Windows. Please find the modified source code attached and add it to the VM code repository.
sqWin32SSL.c http://forum.world.st/file/n4820813/sqWin32SSL.c
The fixes are:
- SNI support
- setting an Int property via sqSetIntPropertySSL(...)
- Unicode problems when extracting the correct peerName in
sqExtractPeerName
Tobias will send around builds for the shared libraries ASAP. :)
Best, Marcel
-- View this message in context: http://forum.world.st/FIXED-SqueakSSL-for-Windows-tp4820813.html Sent from the Squeak VM mailing list archive at Nabble.com.
-- best, Eliot
Hey Eliot
On 21.04.2015, at 19:46, Eliot Miranda eliot.miranda@gmail.com wrote:
thanks both! I've integrated but am not ready to commit yet.
Please hold back a minute, I'll post updated stuff to Ron's github very soon-ish.
Best regards -Tobias
On Tue, Apr 21, 2015 at 5:56 AM, Marcel Taeumel marcel.taeumel@student.hpi.uni-potsdam.de wrote:
Hi, there! :)
Tobias and I fixed the SqueakSSL implementation for Windows. Please find the modified source code attached and add it to the VM code repository.
sqWin32SSL.c http://forum.world.st/file/n4820813/sqWin32SSL.c
The fixes are:
- SNI support
- setting an Int property via sqSetIntPropertySSL(...)
- Unicode problems when extracting the correct peerName in sqExtractPeerName
Tobias will send around builds for the shared libraries ASAP. :)
Best, Marcel
vm-dev@lists.squeakfoundation.org