using secure memory where applicable using sodium_malloc or sodium_mlock, where not

This commit is contained in:
TLINDEN
2015-01-13 13:07:32 +01:00
parent ecf243b7ae
commit 3c30d8871b
14 changed files with 92 additions and 50 deletions

View File

@@ -4,7 +4,7 @@
int main() {
sodium_init();
unsigned char *t = ucmalloc(12);
if(pcp_sodium_verify_box(&t, cipher, cipher_len, nonce, secret_b, public_a) == 0) {
if(crypto_box_open_easy(t, cipher, cipher_len, nonce, public_a, secret_b) == 0) {
if(memcmp(t, message, message_len) == 0) {
printf("ok\n");
}