summaryrefslogtreecommitdiff
path: root/OpenSSL/crypto/pkey.c
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSSL/crypto/pkey.c')
-rw-r--r--OpenSSL/crypto/pkey.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/OpenSSL/crypto/pkey.c b/OpenSSL/crypto/pkey.c
index 27ea4d4..711306d 100644
--- a/OpenSSL/crypto/pkey.c
+++ b/OpenSSL/crypto/pkey.c
@@ -124,6 +124,11 @@ crypto_PKey_check(crypto_PKeyObj *self, PyObject *args) {
return NULL;
}
+ if (self->only_public) {
+ PyErr_SetString(PyExc_TypeError, "public key only");
+ return NULL;
+ }
+
if (self->pkey->type == EVP_PKEY_RSA) {
RSA *rsa;
rsa = EVP_PKEY_get1_RSA(self->pkey);