vici: Use the more generic BUILD_BLOB to parse certificates/public keys

This commit is contained in:
Tobias Brunner
2021-08-23 17:59:39 +02:00
parent b4a34ff5ea
commit de5609b297
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1469,7 +1469,7 @@ static bool parse_cert(auth_data_t *auth, auth_rule_t rule, chunk_t v)
certificate_t *cert; certificate_t *cert;
cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509, cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509,
BUILD_BLOB_PEM, v, BUILD_END); BUILD_BLOB, v, BUILD_END);
if (cert) if (cert)
{ {
return add_cert(auth, rule, cert); return add_cert(auth, rule, cert);
@@ -1504,7 +1504,7 @@ CALLBACK(parse_pubkeys, bool,
certificate_t *cert; certificate_t *cert;
cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_TRUSTED_PUBKEY, cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_TRUSTED_PUBKEY,
BUILD_BLOB_PEM, v, BUILD_END); BUILD_BLOB, v, BUILD_END);
if (cert) if (cert)
{ {
return add_cert(auth, AUTH_RULE_SUBJECT_CERT, cert); return add_cert(auth, AUTH_RULE_SUBJECT_CERT, cert);
+1 -1
View File
@@ -173,7 +173,7 @@ CALLBACK(load_cert, vici_message_t*,
ext_flag = (flag & X509_CA) ? X509_NONE : flag; ext_flag = (flag & X509_CA) ? X509_NONE : flag;
cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, type, cert = lib->creds->create(lib->creds, CRED_CERTIFICATE, type,
BUILD_BLOB_PEM, data, BUILD_BLOB, data,
BUILD_X509_FLAG, ext_flag, BUILD_X509_FLAG, ext_flag,
BUILD_END); BUILD_END);
if (!cert) if (!cert)