diff options
Diffstat (limited to 'src/scepclient/scepclient.c')
-rw-r--r-- | src/scepclient/scepclient.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/scepclient/scepclient.c b/src/scepclient/scepclient.c index 385f6f328..5c32bbdef 100644 --- a/src/scepclient/scepclient.c +++ b/src/scepclient/scepclient.c @@ -398,7 +398,7 @@ int main(int argc, char **argv) transID = chunk_empty; fingerprint = chunk_empty; encoding = chunk_empty; - pkcs10_encoding = chunk_empty; + pkcs10_encoding = chunk_empty; issuerAndSubject = chunk_empty; challengePassword = chunk_empty; getCertInitial = chunk_empty; @@ -866,7 +866,7 @@ int main(int argc, char **argv) { exit_scepclient("generating pkcs10 request failed"); } - pkcs10_encoding = pkcs10_req->get_encoding(pkcs10_req); + pkcs10_req->get_encoding(pkcs10_req, CERT_ASN1_DER, &pkcs10_encoding); fingerprint = scep_generate_pkcs10_fingerprint(pkcs10_encoding); plog(" fingerprint: %s", fingerprint.ptr); } @@ -900,7 +900,7 @@ int main(int argc, char **argv) DBG(DBG_CONTROL, DBG_log("building pkcs1 object:") ) - if (!private_key->get_encoding(private_key, KEY_PRIV_ASN1_DER, &pkcs1) || + if (!private_key->get_encoding(private_key, PRIVKEY_ASN1_DER, &pkcs1) || !chunk_write(pkcs1, path, "pkcs1", 0066, force)) { exit_scepclient("could not write pkcs1 file '%s'", path); @@ -941,8 +941,7 @@ int main(int argc, char **argv) { char *path = concatenate_paths(HOST_CERT_PATH, file_out_cert_self); - encoding = x509_signer->get_encoding(x509_signer); - if (!encoding.ptr) + if (!x509_signer->get_encoding(x509_signer, CERT_ASN1_DER, &encoding)) { exit_scepclient("encoding certificate failed"); } @@ -964,7 +963,7 @@ int main(int argc, char **argv) */ { char *path = concatenate_paths(CA_CERT_PATH, file_in_cacert_enc); - + x509_ca_enc = lib->creds->create(lib->creds, CRED_CERTIFICATE, CERT_X509, BUILD_FROM_FILE, path, BUILD_END); if (!x509_ca_enc) @@ -1138,8 +1137,8 @@ int main(int argc, char **argv) { exit_scepclient("multiple certs received, only first stored"); } - encoding = cert->get_encoding(cert); - if (!chunk_write(encoding, path, "requested cert", 0022, force)) + if (!cert->get_encoding(cert, CERT_ASN1_DER, &encoding) || + !chunk_write(encoding, path, "requested cert", 0022, force)) { exit_scepclient("could not write cert file '%s'", path); } |