diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-12-06 11:35:57 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2015-12-06 11:36:38 +0100 |
commit | 5a4e692511dc3a829eda0d7c5a87e56cbc2055f0 (patch) | |
tree | 429d341d0d44e4d0eee6706bc8bfab38ac26feeb /lib/pkcs11_int.h | |
parent | fa0fa4cb96593f2c291c23f84ccc03d0e50d08de (diff) | |
download | gnutls-5a4e692511dc3a829eda0d7c5a87e56cbc2055f0.tar.gz |
Do not allow importing public keys from PKCS #11 private keys for DSA and ECDSA
That is, because they do not contain all the required parameters for a direct
import. Reported by Jan Vcelak.
Diffstat (limited to 'lib/pkcs11_int.h')
-rw-r--r-- | lib/pkcs11_int.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/pkcs11_int.h b/lib/pkcs11_int.h index 6c5f266840..38cdd6b68b 100644 --- a/lib/pkcs11_int.h +++ b/lib/pkcs11_int.h @@ -54,6 +54,10 @@ struct gnutls_pkcs11_obj_st { /* only when pubkey */ gnutls_datum_t pubkey[MAX_PUBLIC_PARAMS_SIZE]; unsigned pubkey_size; + /* when converting from private key -> pubkey */ + gnutls_datum_t privkey[1]; + unsigned privkey_size; + gnutls_pk_algorithm_t pk_algorithm; unsigned int key_usage; @@ -99,7 +103,7 @@ pkcs11_find_slot(struct ck_function_list **module, ck_slot_id_t * slot, int pkcs11_read_pubkey(struct ck_function_list *module, ck_session_handle_t pks, ck_object_handle_t obj, - ck_key_type_t key_type, gnutls_pkcs11_obj_t pobj); + ck_key_type_t key_type, gnutls_pkcs11_obj_t pobj, unsigned priv); int pkcs11_override_cert_exts(struct pkcs11_session_info *sinfo, gnutls_datum_t *spki, gnutls_datum_t *der); |