Jan 28
Brad Lindsay Foreign Function Interface and OpenSSL Issue
Jan 28, 2015; 15:50
Brad Lindsay
Foreign Function Interface and OpenSSL Issue
Since Lasso uses the openSSL library, I’ve been trying to access that library via Lasso 9’s foreign function interface to get access to things like SHA256 and SHA512. Here’s the code I have so far:
define encrypt_sha256(value::string) => encrypt_sha256(bytes(#value))
define encrypt_sha256(value::bytes) =>
_ffi('SHA256', 'C', 'C', #value, 'i32', #value->size)->encodeHex
define encrypt_sha512(value::string) => encrypt_sha512(bytes(#value))
define encrypt_sha512(value::bytes) =>
_ffi('SHA512', 'C', 'C', #value, 'i32', #value->size)->encodeHex
The problem comes when using [encrypt_sha512]: Sometimes I get the right answer, but other times (after loading it in a new process) I get extra stuff tacked on the end. For example, [encryt_sha512('foo')] should sometimes has added "38" on to the end and at other times added "10AEA10301" to the end.
Also, I can never get this example to work:
encrypt_sha512('dddf')
// => 0A464FF05980AA76B01BBFD93D280E
That’s it, it stops there and is missing the last 100 characters or so. And this is consistently doing this for that value. I have no clue what’s going on.
While I have yet to get encrypt_sha256 to fail, the fact that encrypt_sha512 is failing makes me worried that I may have something wrong with it too.
If anyone knows what the issue is, please let me know.
Thanks,
Brad
#############################################################
This message is sent to you because you are subscribed to
the mailing list Lasso Lasso@lists.lassosoft.com
Official list archives available at http://www.lassotalk.com
To unsubscribe, E-mail to: <Lasso-unsubscribe@lists.lassosoft.com>
Send administrative queries to <Lasso-request@lists.lassosoft.com>
Jan 29
Alex Betz Re: Foreign Function Interface and OpenSSL Issue
Jan 29, 2015; 13:00
Alex Betz
Re: Foreign Function Interface and OpenSSL Issue
Jan 29
Brad Lindsay Re: Foreign Function Interface and OpenSSL Issue
Jan 29, 2015; 09:03
Brad Lindsay
Re: Foreign Function Interface and OpenSSL Issue
Jan 29
Jussi Hirvi Re: Foreign Function Interface and OpenSSL Issue
Jan 29, 2015; 17:43
Jussi Hirvi
Re: Foreign Function Interface and OpenSSL Issue
Jan 29
Brad Lindsay Re: Foreign Function Interface and OpenSSL Issue
Jan 29, 2015; 11:11
Brad Lindsay
Re: Foreign Function Interface and OpenSSL Issue
Jan 29
Jussi Hirvi Re: Foreign Function Interface and OpenSSL Issue
Jan 29, 2015; 20:54
Jussi Hirvi
Re: Foreign Function Interface and OpenSSL Issue