checksums.openssl: use correct API for creating EVP_MD_CTX, fixes crash on NetBSD

db4
Slava Pestov 2009-09-22 23:54:42 -05:00
parent f017f8904b
commit 74a72ce17c
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
! Copyright (C) 2008 Slava Pestov ! copyright (C) 2008 Slava Pestov
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors byte-arrays alien.c-types alien.data kernel USING: accessors byte-arrays alien.c-types alien.data kernel
continuations destructors sequences io openssl openssl.libcrypto continuations destructors sequences io openssl openssl.libcrypto
@ -23,10 +23,10 @@ TUPLE: evp-md-context < disposable handle ;
: <evp-md-context> ( -- ctx ) : <evp-md-context> ( -- ctx )
evp-md-context new-disposable evp-md-context new-disposable
EVP_MD_CTX <struct> dup EVP_MD_CTX_init >>handle ; EVP_MD_CTX_create >>handle ;
M: evp-md-context dispose* M: evp-md-context dispose*
handle>> EVP_MD_CTX_cleanup drop ; handle>> EVP_MD_CTX_destroy ;
: with-evp-md-context ( quot -- ) : with-evp-md-context ( quot -- )
maybe-init-ssl [ <evp-md-context> ] dip with-disposal ; inline maybe-init-ssl [ <evp-md-context> ] dip with-disposal ; inline