Skip to content
Snippets Groups Projects
Commit 81f1aa7a authored by deuce's avatar deuce
Browse files

Use get_crypt_error() in get_error_string() as well.

parent 64fd1810
No related branches found
No related tags found
No related merge requests found
...@@ -40,10 +40,11 @@ static bool get_error_string(int status, CRYPT_SESSION sess, char *estr, char *f ...@@ -40,10 +40,11 @@ static bool get_error_string(int status, CRYPT_SESSION sess, char *estr, char *f
if (cryptStatusOK(status)) if (cryptStatusOK(status))
return true; return true;
ret = cryptGetAttributeString(sess, CRYPT_ATTRIBUTE_ERRORMESSAGE, tmpstr, &len); estr = get_crypt_error(sess);
tmpstr[len]=0; if (estr) {
if (cryptStatusOK(ret) && len)
sprintf(estr, "cryptlib error %d at %s:%d (%s)", status, file, line, tmpstr); sprintf(estr, "cryptlib error %d at %s:%d (%s)", status, file, line, tmpstr);
free_crypt_attrstr(estr);
}
else else
sprintf(estr, "cryptlib error %d at %s:%d", status, file, line); sprintf(estr, "cryptlib error %d at %s:%d", status, file, line);
return false; return false;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment