Skip to content

Commit

Permalink
revise Win Crypt deallocation, update ReadMe
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinram committed Mar 11, 2017
1 parent ac264d4 commit 420b5c9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### 64-bit multi-threading random data generator


##### RND64 v.0.33
##### RND64 v.0.34

##### Linux and Windows

Expand Down
9 changes: 7 additions & 2 deletions rnd64.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Martin Latter <copysense.co.uk>
* @copyright Martin Latter, April 2014
* @version 0.33 mt
* @version 0.34 mt
* @license GNU GPL version 3.0 (GPL v3); https://www.gnu.org/licenses/gpl-3.0.html
* @link https://github.com/Tinram/RND64.git
*
Expand Down Expand Up @@ -441,7 +441,7 @@ int main(int iArgCount, char* aArgV[]) {
unsigned int iErrFlag = 0;
char cS;
char* pBuffer = (char*) buff;
HCRYPTPROV rCryptHandle;
HCRYPTPROV rCryptHandle = 0;

if (CryptAcquireContext(&rCryptHandle, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT) == FALSE) {

Expand All @@ -457,7 +457,12 @@ int main(int iArgCount, char* aArgV[]) {
}

if ( ! iErrFlag) {

pBuffer[iBytesLocal] = '\0';

if (CryptReleaseContext(rCryptHandle, 0)) {
rCryptHandle = 0;
}
}

return NULL;
Expand Down
4 changes: 2 additions & 2 deletions rnd64.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* @author Martin Latter <copysense.co.uk>
* @copyright Martin Latter, April 2014
* @version 0.33 mt
* @version 0.34 mt
* @license GNU GPL version 3.0 (GPL v3); http://www.gnu.org/licenses/gpl.html
* @link https://github.com/Tinram/RND64.git
*
Expand All @@ -33,7 +33,7 @@
#endif


#define RND64_VERSION "0.33 mt"
#define RND64_VERSION "0.34 mt"


#ifdef __linux
Expand Down

0 comments on commit 420b5c9

Please sign in to comment.