put previously global error handling and key hashes into ptx (pcp context) to make libpcp threadsafe.

This commit is contained in:
TLINDEN
2014-05-04 17:11:03 +02:00
parent d1c87d1001
commit da9891ff81
58 changed files with 1330 additions and 958 deletions

View File

@@ -21,7 +21,7 @@
#include "scrypt.h"
byte* pcp_scrypt(char *passwd, size_t passwdlen, byte *nonce, size_t noncelen) {
byte* pcp_scrypt(PCPCTX *ptx, char *passwd, size_t passwdlen, byte *nonce, size_t noncelen) {
uint8_t *dk = ucmalloc(64); /* resulting hash */
/* constants */
@@ -34,7 +34,7 @@ byte* pcp_scrypt(char *passwd, size_t passwdlen, byte *nonce, size_t noncelen) {
return dk;
}
else {
fatal("crypto_scrypt() failed");
fatal(ptx, "crypto_scrypt() failed");
return NULL;
}