Lines Matching defs:state

206 /* Module state */
223 void *state = PyModule_GetState(module);
224 assert(state != NULL);
225 return (_hashlibstate *)state;
324 _hashlibstate *state = get_hashlib_state(module);
326 state->hashtable, (const void*)name
363 _setException(state->unsupported_digestmod_error, "unsupported hash type %s", name);
385 _hashlibstate *state = get_hashlib_state(module);
387 name_obj = PyDict_GetItem(state->constructs, digestmod);
390 _hashlibstate *state = get_hashlib_state(module);
393 state->unsupported_digestmod_error,
574 Update this hash object's state with the provided string.
1846 _InternalNameMapperState *state = (_InternalNameMapperState *)arg;
1849 assert(state != NULL);
1857 state->error = 1;
1859 if (PySet_Add(state->set, py_name) != 0) {
1860 state->error = 1;
1871 _InternalNameMapperState state = {
1875 if (state.set == NULL) {
1881 EVP_MD_do_all_provided(NULL, &_openssl_hash_name_mapper, &state);
1883 EVP_MD_do_all(&_openssl_hash_name_mapper, &state);
1886 if (state.error) {
1887 Py_DECREF(state.set);
1891 if (PyModule_AddObject(module, "openssl_md_meth_names", state.set) < 0) {
1892 Py_DECREF(state.set);
1904 For OpenSSL 3.0.0 and newer it returns the state of the default provider
2083 _hashlibstate *state = get_hashlib_state(m);
2084 Py_VISIT(state->EVPtype);
2085 Py_VISIT(state->HMACtype);
2087 Py_VISIT(state->EVPXOFtype);
2089 Py_VISIT(state->constructs);
2090 Py_VISIT(state->unsupported_digestmod_error);
2097 _hashlibstate *state = get_hashlib_state(m);
2098 Py_CLEAR(state->EVPtype);
2099 Py_CLEAR(state->HMACtype);
2101 Py_CLEAR(state->EVPXOFtype);
2103 Py_CLEAR(state->constructs);
2104 Py_CLEAR(state->unsupported_digestmod_error);
2106 if (state->hashtable != NULL) {
2107 _Py_hashtable_destroy(state->hashtable);
2108 state->hashtable = NULL;
2124 _hashlibstate *state = get_hashlib_state(module);
2126 state->hashtable = py_hashentry_table_new();
2127 if (state->hashtable == NULL) {
2137 _hashlibstate *state = get_hashlib_state(module);
2139 state->EVPtype = (PyTypeObject *)PyType_FromSpec(&EVPtype_spec);
2140 if (state->EVPtype == NULL) {
2143 if (PyModule_AddType(module, state->EVPtype) < 0) {
2153 _hashlibstate *state = get_hashlib_state(module);
2155 if (state->EVPtype == NULL) {
2159 state->EVPXOFtype = (PyTypeObject *)PyType_FromSpecWithBases(
2160 &EVPXOFtype_spec, (PyObject *)state->EVPtype
2162 if (state->EVPXOFtype == NULL) {
2165 if (PyModule_AddType(module, state->EVPXOFtype) < 0) {
2175 _hashlibstate *state = get_hashlib_state(module);
2177 state->HMACtype = (PyTypeObject *)PyType_FromSpec(&HMACtype_spec);
2178 if (state->HMACtype == NULL) {
2181 if (PyModule_AddType(module, state->HMACtype) < 0) {
2197 _hashlibstate *state = get_hashlib_state(module);
2204 state->constructs = PyDict_New();
2205 if (state->constructs == NULL) {
2222 int rc = PyDict_SetItem(state->constructs, func, name_obj);
2230 proxy = PyDictProxy_New(state->constructs);
2246 _hashlibstate *state = get_hashlib_state(module);
2247 state->unsupported_digestmod_error = PyErr_NewException(
2249 if (state->unsupported_digestmod_error == NULL) {
2253 state->unsupported_digestmod_error) < 0) {