Staging
v0.8.1
v0.8.1
https://github.com/python/cpython
Revision b03623227ed1264e3cac4e6bb4878d96b91aa484 authored by Miss Islington (bot) on 07 September 2017, 18:35:03 UTC, committed by Benjamin Peterson on 07 September 2017, 18:35:03 UTC
(cherry picked from commit a853a8ba7850381d49b284295dd6f0dc491dbe44)
1 parent b0d0217
Tip revision: b03623227ed1264e3cac4e6bb4878d96b91aa484 authored by Miss Islington (bot) on 07 September 2017, 18:35:03 UTC
[3.6] fixes bpo-31373: fix undefined floating-point demotions (GH-3396) (#3424)
[3.6] fixes bpo-31373: fix undefined floating-point demotions (GH-3396) (#3424)
Tip revision: b036232
_cryptmodule.c
/* cryptmodule.c - by Steve Majewski
*/
#include "Python.h"
#include <sys/types.h>
/* Module crypt */
/*[clinic input]
module crypt
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=c6252cf4f2f2ae81]*/
#include "clinic/_cryptmodule.c.h"
/*[clinic input]
crypt.crypt
word: str
salt: str
/
Hash a *word* with the given *salt* and return the hashed password.
*word* will usually be a user's password. *salt* (either a random 2 or 16
character string, possibly prefixed with $digit$ to indicate the method)
will be used to perturb the encryption algorithm and produce distinct
results for a given *word*.
[clinic start generated code]*/
static PyObject *
crypt_crypt_impl(PyObject *module, const char *word, const char *salt)
/*[clinic end generated code: output=0512284a03d2803c input=0e8edec9c364352b]*/
{
/* On some platforms (AtheOS) crypt returns NULL for an invalid
salt. Return None in that case. XXX Maybe raise an exception? */
return Py_BuildValue("s", crypt(word, salt));
}
static PyMethodDef crypt_methods[] = {
CRYPT_CRYPT_METHODDEF
{NULL, NULL} /* sentinel */
};
static struct PyModuleDef cryptmodule = {
PyModuleDef_HEAD_INIT,
"_crypt",
NULL,
-1,
crypt_methods,
NULL,
NULL,
NULL,
NULL
};
PyMODINIT_FUNC
PyInit__crypt(void)
{
return PyModule_Create(&cryptmodule);
}
Computing file changes ...