◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
9 changes: 9 additions & 0 deletions Lib/test/test_hashlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,15 @@ def test_hash_disallow_instanciation(self):
):
HASHXOF()


class KDFTests(unittest.TestCase):

Expand Down
19 changes: 19 additions & 0 deletions Lib/test/test_ssl.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,25 @@ def test_constants(self):
ssl.OP_NO_TLSv1_2
self.assertEqual(ssl.PROTOCOL_TLS, ssl.PROTOCOL_SSLv23)

def test_private_init(self):
with self.assertRaisesRegex(TypeError, "public constructor"):
with socket.socket() as s:
Expand Down
2 changes: 1 addition & 1 deletion Modules/_blake2/blake2b_impl.c
Original file line number Diff line number Diff line change
@@ -409,6 +409,6 @@ static PyType_Slot blake2b_type_slots[] = {
PyType_Spec blake2b_type_spec = {
.name = "_blake2.blake2b",
.basicsize = sizeof(BLAKE2bObject),
.flags = Py_TPFLAGS_DEFAULT,
.slots = blake2b_type_slots
};
2 changes: 1 addition & 1 deletion Modules/_blake2/blake2s_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,6 @@ static PyType_Slot blake2s_type_slots[] = {
PyType_Spec blake2s_type_spec = {
.name = "_blake2.blake2s",
.basicsize = sizeof(BLAKE2sObject),
.flags = Py_TPFLAGS_DEFAULT,
.slots = blake2s_type_slots
};
6 changes: 3 additions & 3 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ static PyType_Spec EVPtype_spec = {
"_hashlib.HASH", /*tp_name*/
sizeof(EVPobject), /*tp_basicsize*/
0, /*tp_itemsize*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION,
EVPtype_slots
};

Expand Down Expand Up @@ -737,7 +737,7 @@ static PyType_Spec EVPXOFtype_spec = {
"_hashlib.HASHXOF", /*tp_name*/
sizeof(EVPobject), /*tp_basicsize*/
0, /*tp_itemsize*/
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION,
EVPXOFtype_slots
};

Expand Down Expand Up @@ -1729,7 +1729,7 @@ static PyType_Slot HMACtype_slots[] = {
PyType_Spec HMACtype_spec = {
"_hashlib.HMAC", /* name */
sizeof(HMACobject), /* basicsize */
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.slots = HMACtype_slots,
};

Expand Down
10 changes: 5 additions & 5 deletions Modules/_ssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static PyType_Spec sslerror_type_spec = {
"ssl.SSLError",
sizeof(PyOSErrorObject),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE,
sslerror_type_slots
};

Expand Down Expand Up @@ -2906,7 +2906,7 @@ static PyType_Spec PySSLSocket_spec = {
"_ssl._SSLSocket",
sizeof(PySSLSocket),
0,
Py_TPFLAGS_DEFAULT,
PySSLSocket_slots,
};

Expand Up @@ -4644,7 +4644,7 @@ static PyType_Spec PySSLContext_spec = {
"_ssl._SSLContext",
sizeof(PySSLContext),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC,
PySSLContext_slots,
};

Expand Down @@ -4850,7 +4850,7 @@ static PyType_Spec PySSLMemoryBIO_spec = {
"_ssl.MemoryBIO",
sizeof(PySSLMemoryBIO),
0,
Py_TPFLAGS_DEFAULT,
PySSLMemoryBIO_slots,
};

Expand Down Expand Up @@ -5025,7 +5025,7 @@ static PyType_Spec PySSLSession_spec = {
"_ssl.SSLSession",
sizeof(PySSLSession),
0,
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
PySSLSession_slots,
};

2 changes: 1 addition & 1 deletion Modules/_ssl/cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,6 @@ static PyType_Spec PySSLCertificate_spec = {
"_ssl.Certificate",
sizeof(PySSLCertificate),
0,
Py_TPFLAGS_DEFAULT,
PySSLCertificate_slots,
};
2 changes: 1 addition & 1 deletion Modules/md5module.c
Original file line number Diff line number Diff line change
@@ -484,7 +484,7 @@ static PyType_Slot md5_type_slots[] = {
static PyType_Spec md5_type_spec = {
.name = "_md5.md5",
.basicsize = sizeof(MD5object),
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.slots = md5_type_slots
};

Expand Down
4 changes: 2 additions & 2 deletions Modules/sha256module.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,14 +544,14 @@ static PyType_Slot sha256_types_slots[] = {
static PyType_Spec sha224_type_spec = {
.name = "_sha256.sha224",
.basicsize = sizeof(SHAobject),
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.slots = sha256_types_slots
};

static PyType_Spec sha256_type_spec = {
.name = "_sha256.sha256",
.basicsize = sizeof(SHAobject),
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.slots = sha256_types_slots
};

4 changes: 2 additions & 2 deletions Modules/sha512module.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ static PyType_Slot sha512_sha384_type_slots[] = {
static PyType_Spec sha512_sha384_type_spec = {
.name = "_sha512.sha384",
.basicsize = sizeof(SHAobject),
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.slots = sha512_sha384_type_slots
};

Expand All @@ -619,7 +619,7 @@ static PyType_Slot sha512_sha512_type_slots[] = {
static PyType_Spec sha512_sha512_type_spec = {
.name = "_sha512.sha512",
.basicsize = sizeof(SHAobject),
.flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DISALLOW_INSTANTIATION,
.slots = sha512_sha512_type_slots
};

Expand Down
Toggle all file notes Toggle all file annotations