Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: third_party/tlslite/tlslite/utils/win32prng.c

Issue 210323002: Update tlslite to 0.4.6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Executable bit and --similarity=80 Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/tlslite/tlslite/utils/tripledes.py ('k') | third_party/tlslite/tlslite/utils/xmltools.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/tlslite/utils/win32prng.c
diff --git a/third_party/tlslite/tlslite/utils/win32prng.c b/third_party/tlslite/tlslite/utils/win32prng.c
deleted file mode 100644
index de08b3b3b901562fe392f6dcc76ef6c7a7ae34a1..0000000000000000000000000000000000000000
--- a/third_party/tlslite/tlslite/utils/win32prng.c
+++ /dev/null
@@ -1,63 +0,0 @@
-
-#include "Python.h"
-#define _WIN32_WINNT 0x0400 /* Needed for CryptoAPI on some systems */
-#include <windows.h>
-
-
-static PyObject* getRandomBytes(PyObject *self, PyObject *args)
-{
- int howMany;
- HCRYPTPROV hCryptProv;
- unsigned char* bytes = NULL;
- PyObject* returnVal = NULL;
-
-
- /* Read Arguments */
- if (!PyArg_ParseTuple(args, "i", &howMany))
- return(NULL);
-
- /* Get Context */
- if(CryptAcquireContext(
- &hCryptProv,
- NULL,
- NULL,
- PROV_RSA_FULL,
- CRYPT_VERIFYCONTEXT) == 0)
- return Py_BuildValue("s#", NULL, 0);
-
-
- /* Allocate bytes */
- bytes = malloc(howMany);
-
-
- /* Get random data */
- if(CryptGenRandom(
- hCryptProv,
- howMany,
- bytes) == 0)
- returnVal = Py_BuildValue("s#", NULL, 0);
- else
- returnVal = Py_BuildValue("s#", bytes, howMany);
-
- free(bytes);
- CryptReleaseContext(hCryptProv, 0);
-
- return returnVal;
-}
-
-
-
-/* List of functions exported by this module */
-
-static struct PyMethodDef win32prng_functions[] = {
- {"getRandomBytes", (PyCFunction)getRandomBytes, METH_VARARGS},
- {NULL, NULL} /* Sentinel */
-};
-
-
-/* Initialize this module. */
-
-DL_EXPORT(void) initwin32prng(void)
-{
- Py_InitModule("win32prng", win32prng_functions);
-}
« no previous file with comments | « third_party/tlslite/tlslite/utils/tripledes.py ('k') | third_party/tlslite/tlslite/utils/xmltools.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698