From 79bb003e6dce8d346032de749f26c791e5be56a8 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Fri, 6 Feb 2009 10:17:20 -0600 Subject: [PATCH] io.sockets.secure.openssl: Don't allocate empty password string. Fixes test failures introduced by >c-ptr change --- basis/io/sockets/secure/openssl/openssl.factor | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/basis/io/sockets/secure/openssl/openssl.factor b/basis/io/sockets/secure/openssl/openssl.factor index 0326969e4f..f78f61ef3b 100644 --- a/basis/io/sockets/secure/openssl/openssl.factor +++ b/basis/io/sockets/secure/openssl/openssl.factor @@ -46,11 +46,13 @@ TUPLE: openssl-context < secure-context aliens sessions ; [ push ] [ drop ] 2bi ; : set-default-password ( ctx -- ) - [ handle>> password-callback SSL_CTX_set_default_passwd_cb ] - [ - [ handle>> ] [ default-pasword ] bi - SSL_CTX_set_default_passwd_cb_userdata - ] bi ; + dup config>> password>> [ + [ handle>> password-callback SSL_CTX_set_default_passwd_cb ] + [ + [ handle>> ] [ default-pasword ] bi + SSL_CTX_set_default_passwd_cb_userdata + ] bi + ] [ drop ] if ; : use-private-key-file ( ctx -- ) dup config>> key-file>> [