Skip to content
Snippets Groups Projects
Commit 3cb11ef1 authored by Adrien Béraud's avatar Adrien Béraud
Browse files

crypto: avoid reading key id twice

parent ff520d61
Branches
Tags
No related merge requests found
......@@ -724,11 +724,10 @@ generateIdentity(const std::string& name, crypto::Identity ca, unsigned key_leng
// TODO: compute the subject key using the recommended RFC method
auto pk_id = shared_key->getPublicKey().getId();
gnutls_x509_crt_set_subject_key_id(cert, &pk_id, sizeof(pk_id));
const std::string& uid_str = pk_id.toString();
gnutls_x509_crt_set_subject_key_id(cert, &pk_id, sizeof(pk_id));
gnutls_x509_crt_set_dn_by_oid(cert, GNUTLS_OID_X520_COMMON_NAME, 0, name.data(), name.length());
const std::string& uid_str = shared_key->getPublicKey().getId().toString();
gnutls_x509_crt_set_dn_by_oid(cert, GNUTLS_OID_LDAP_UID, 0, uid_str.data(), uid_str.length());
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment