Need help with a rsaenh bug
juan.lang at gmail.com
Fri Jun 28 10:31:27 CDT 2013
On Fri, Jun 28, 2013 at 3:44 AM, Qian Hong <fracting at gmail.com> wrote:
> Hi Daniel, new patches sent with improving from your hints, would you
> mind have a look? Thanks in advance!
nice work! These look fine to me, but a stylistic nit:
It's more in line with most C code to use !memcmp(...) instead of
memcmp(...)==0. I find it easier to scan, anyway, as I've gotten used to !
comparisons to check equality in memcmp, strcmp, and variants.
Another minor point: it's customary to set last error prior to testing it
when you expect it to have a certain value, e.g.:
+ bad_data[cTestData[i].buflen - 1] = ~bad_data[cTestData[i].buflen -
+ result = CryptDecrypt(hKey, 0, TRUE, 0, bad_data, &dwLen);
+ ok(!result, "CryptDecrypt should failed!\n");
+ ok(GetLastError() == NTE_BAD_DATA, "%08x\n", GetLastError());
Prior to the result = CryptDecrypt(hKey, ...) line, please add a
SetLastError(0xdeadbeef); that will ensure that the following comparison of
GetLastError() to NTE_BAD_DATA isn't succeeding due to an earlier failure.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the wine-devel