Skip to content
This repository has been archived by the owner on May 21, 2024. It is now read-only.

Commit

Permalink
Merge pull request #1514 from advancedtelematic/fix/cert
Browse files Browse the repository at this point in the history
Don't copy CA certificates to client certificate data
  • Loading branch information
lbonn authored Jan 14, 2020
2 parents 4c41de8 + bacb528 commit 21c8595
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 29 deletions.
3 changes: 0 additions & 3 deletions config/sota-local.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,3 @@ path = "storage"

[pacman]
type = "none"

[uptane]
secondary_config_file = "virtualsec.json"
2 changes: 1 addition & 1 deletion src/libaktualizr/config/config_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ TEST(config, ExtractCredentials) {
"FBA3C8FAD16D8B3EC64F7D47CBDD8456A51A6399734A3F6B7E2D6E562072F264");
std::cout << "Certificate: " << boot.getCert() << std::endl;
EXPECT_EQ(boost::algorithm::hex(Crypto::sha256digest(boot.getCert())),
"02300CC9797556915D88CFA05644BFF22D8C458367A3636F7921585F828ECB81");
"97FEE312F1AC7BEDD9E0979CA8AE57C2824F39928AA9486C56467732B298893E");
std::cout << "Pkey: " << boot.getPkey() << std::endl;
EXPECT_EQ(boost::algorithm::hex(Crypto::sha256digest(boot.getPkey())),
"D27E3E56BEF02AAA6D6FFEFDA5357458C477A8E891C5EADF4F04CE67BB5866A4");
Expand Down
1 change: 0 additions & 1 deletion src/libaktualizr/crypto/crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,6 @@ bool Crypto::parseP12(BIO *p12_bio, const std::string &p12_password, std::string
for (int i = 0; i < sk_X509_num(ca_certs.get()); i++) { // NOLINT
ca_cert = sk_X509_value(ca_certs.get(), i); // NOLINT
PEM_write_bio_X509(ca_sink.get(), ca_cert);
PEM_write_bio_X509(cert_sink.get(), ca_cert);
}
ca_len = static_cast<size_t>(BIO_get_mem_data(ca_sink.get(), &ca_buf)); // NOLINT
*out_ca = std::string(ca_buf, ca_len);
Expand Down
24 changes: 0 additions & 24 deletions src/libaktualizr/crypto/crypto_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,30 +183,6 @@ TEST(crypto, parsep12) {
"JoIkY2MzNGY3ZjMtNDgxZC00NDNiLWJjZWItZTgzOGEzNmEyZDFmMAoGCCqGSM49\n"
"BAMCA0cAMEQCIF7BH/kXuKD5f6f6ZNd2RLc1iwL2/nKq7FpaF6kunPV3AiA4pwZR\n"
"p3GnzAJ1QAqaric/3lvcPSofSr5i0OiGi6wwwg==\n"
"-----END CERTIFICATE-----\n"
"-----BEGIN CERTIFICATE-----\n"
"MIIB0DCCAXagAwIBAgIUY9ZexzxoSQ2s9l7rzrdFtziAf04wCgYIKoZIzj0EAwIw\n"
"LjEsMCoGA1UEAwwjZ29vZ2xlLW9hdXRoMnwxMDMxMDYxMTkyNTE5NjkyODc1NzEw\n"
"HhcNMTcwMzAyMDkzMTI3WhcNMjcwMjI4MDkzMTU3WjAuMSwwKgYDVQQDDCNnb29n\n"
"bGUtb2F1dGgyfDEwMzEwNjExOTI1MTk2OTI4NzU3MTBZMBMGByqGSM49AgEGCCqG\n"
"SM49AwEHA0IABFjHD4kK3YBw7QTA1K659EMAYl5lxG5y5/4kWTr+bDuvYnYvpjFJ\n"
"x2P5CnoGmsffLvzgIjgrFV36cpHmXGalScCjcjBwMA4GA1UdDwEB/wQEAwIBBjAP\n"
"BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTLWJBczmVpkZKtcNg+qusSz+YBSTAu\n"
"BgNVHREEJzAlgiNnb29nbGUtb2F1dGgyfDEwMzEwNjExOTI1MTk2OTI4NzU3MTAK\n"
"BggqhkjOPQQDAgNIADBFAiEAhoM17gakQxgEm/vkgV3RBo3oFgouzxP/qp2M4r4j\n"
"JqcCIBe+3Cgg9KjDGFaexf/T3sz0qjA5aT4/imsTS06NmbhW\n"
"-----END CERTIFICATE-----\n"
"-----BEGIN CERTIFICATE-----\n"
"MIIB0DCCAXagAwIBAgIUY9ZexzxoSQ2s9l7rzrdFtziAf04wCgYIKoZIzj0EAwIw\n"
"LjEsMCoGA1UEAwwjZ29vZ2xlLW9hdXRoMnwxMDMxMDYxMTkyNTE5NjkyODc1NzEw\n"
"HhcNMTcwMzAyMDkzMTI3WhcNMjcwMjI4MDkzMTU3WjAuMSwwKgYDVQQDDCNnb29n\n"
"bGUtb2F1dGgyfDEwMzEwNjExOTI1MTk2OTI4NzU3MTBZMBMGByqGSM49AgEGCCqG\n"
"SM49AwEHA0IABFjHD4kK3YBw7QTA1K659EMAYl5lxG5y5/4kWTr+bDuvYnYvpjFJ\n"
"x2P5CnoGmsffLvzgIjgrFV36cpHmXGalScCjcjBwMA4GA1UdDwEB/wQEAwIBBjAP\n"
"BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTLWJBczmVpkZKtcNg+qusSz+YBSTAu\n"
"BgNVHREEJzAlgiNnb29nbGUtb2F1dGgyfDEwMzEwNjExOTI1MTk2OTI4NzU3MTAK\n"
"BggqhkjOPQQDAgNIADBFAiEAhoM17gakQxgEm/vkgV3RBo3oFgouzxP/qp2M4r4j\n"
"JqcCIBe+3Cgg9KjDGFaexf/T3sz0qjA5aT4/imsTS06NmbhW\n"
"-----END CERTIFICATE-----\n");
EXPECT_EQ(ca,
"-----BEGIN CERTIFICATE-----\n"
Expand Down

0 comments on commit 21c8595

Please sign in to comment.