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

For OTA-2712, remove test repo meta #1239

Merged
merged 1 commit into from
Jul 9, 2019
Merged

Conversation

xcheng-here
Copy link
Contributor

remove test repo meta from test/test_data/repo,
generate data from test code using aktualizr-repo

Signed-off-by: cheng.xiang [email protected]

@xcheng-here xcheng-here requested review from lbonn and pattivacek June 20, 2019 08:01
tests/metafake.h Outdated Show resolved Hide resolved
@xcheng-here xcheng-here force-pushed the OTA-2712_remove_repo_metadata branch from cfcede4 to ef2f7c6 Compare June 24, 2019 07:22
@codecov-io
Copy link

codecov-io commented Jun 24, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@b8c7952). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1239   +/-   ##
=========================================
  Coverage          ?   79.49%           
=========================================
  Files             ?      168           
  Lines             ?    10144           
  Branches          ?        0           
=========================================
  Hits              ?     8064           
  Misses            ?     2080           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8c7952...2289973. Read the comment docs.

@xcheng-here xcheng-here force-pushed the OTA-2712_remove_repo_metadata branch from ef2f7c6 to 0fb4124 Compare June 24, 2019 07:30
tests/httpfake.h Outdated Show resolved Hide resolved
tests/metafake.h Outdated Show resolved Hide resolved
@xcheng-here xcheng-here force-pushed the OTA-2712_remove_repo_metadata branch from 0fb4124 to 70df667 Compare June 27, 2019 07:03
@lbonn
Copy link
Contributor

lbonn commented Jun 27, 2019

For the failure in test_uptane_secondary, it looks like we missed some checks in Crypto::ED25519Verify. I would try something like that:

diff --git a/src/libaktualizr/crypto/crypto.cc b/src/libaktualizr/crypto/crypto.cc
index 8f9f16db..33027b44 100644
--- a/src/libaktualizr/crypto/crypto.cc
+++ b/src/libaktualizr/crypto/crypto.cc
@@ -226,6 +226,9 @@ bool Crypto::RSAPSSVerify(const std::string &public_key, const std::string &sign
   return status == 1;
 }
 bool Crypto::ED25519Verify(const std::string &public_key, const std::string &signature, const std::string &message) {
+  if (public_key.size() != crypto_sign_PUBLICKEYBYTES || signature.size() != crypto_sign_BYTES) {
+    return false;
+  }
   return crypto_sign_verify_detached(reinterpret_cast<const unsigned char *>(signature.c_str()),
                                      reinterpret_cast<const unsigned char *>(message.c_str()), message.size(),
                                      reinterpret_cast<const unsigned char *>(public_key.c_str())) == 0;

Would also be good to unit test this case in libaktualizr/crypto/crypto_test.cc

tests/httpfake.h Outdated Show resolved Hide resolved
src/libaktualizr/primary/aktualizr_test.cc Outdated Show resolved Hide resolved
@xcheng-here xcheng-here force-pushed the OTA-2712_remove_repo_metadata branch from 70df667 to c59c343 Compare June 28, 2019 11:54
@lbonn
Copy link
Contributor

lbonn commented Jul 3, 2019

Great, we can merge it after fixing the formatting error.

@xcheng-here xcheng-here force-pushed the OTA-2712_remove_repo_metadata branch from c59c343 to fdfa1d9 Compare July 3, 2019 10:43
@lbonn
Copy link
Contributor

lbonn commented Jul 5, 2019

There are now some merge conflicts, it would need a last rebase before merging.

remove test repo meta from test/test_data/repo,
generate data from test code using aktualizr-repo

Signed-off-by: cheng.xiang <[email protected]>
@xcheng-here xcheng-here force-pushed the OTA-2712_remove_repo_metadata branch from fdfa1d9 to 2289973 Compare July 9, 2019 06:36
@lbonn lbonn merged commit c697227 into master Jul 9, 2019
@lbonn lbonn deleted the OTA-2712_remove_repo_metadata branch July 9, 2019 10:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants