fix: remove crypto lib

do not need deal with sign now, and use QCryptographicHash if need.

Log:
Change-Id: I8383f842d20f48b0eeda2e61dc85a71698fc7aa4
This commit is contained in:
lihe 2021-11-08 11:35:45 +08:00
parent 06a803095f
commit 921afacb5f
6 changed files with 3 additions and 29 deletions

View File

@ -25,7 +25,7 @@
deb [trusted=yes] http://aptly.uniontech.com/pkg/eagle-1040/release-candidate/546y54-R5LiA5pyf6aG555uu5Li76aKYMjAyMS0wOS0xNyAyMDoxODowNg unstable main
#For release based on debian
sudo apt update
sudo apt-get install cmake build-essential libyaml-cpp-dev nlohmann-json3-dev libgtest-dev qt5-qmake qtbase5-dev libdtkcore-dev libcrypto++-dev libarchive-dev libcurl4-gnutls-dev libglib2.0-dev libostree-dev json-struct libgdk-pixbuf2.0-dev libappstream-glib-dev
sudo apt-get install cmake build-essential libyaml-cpp-dev nlohmann-json3-dev libgtest-dev qt5-qmake qtbase5-dev libdtkcore-dev libarchive-dev libcurl4-gnutls-dev libglib2.0-dev libostree-dev json-struct libgdk-pixbuf2.0-dev libappstream-glib-dev
```
## Installation

1
debian/control vendored
View File

@ -12,7 +12,6 @@ Build-Depends:
qt5-qmake,
qtbase5-dev,
libdtkcore-dev,
libcrypto++-dev,
libarchive-dev,
pkg-config,
json-struct,

View File

@ -14,6 +14,6 @@ set(LL_BUILDER_SOURCES
add_executable(ll-builder
${LL_BUILDER_SOURCES})
target_link_libraries(ll-builder PRIVATE ${LINK_LIBS} -larchive -lcrypto++)
target_link_libraries(ll-builder PRIVATE ${LINK_LIBS} -larchive)
install(TARGETS ll-builder RUNTIME DESTINATION bin)

View File

@ -15,18 +15,9 @@
#include <QString>
#include <json-struct/json_struct.h>
#define CRYPTOPP_ENABLE_NAMESPACE_WEAK 1
#include <crypto++/sha.h>
#include <crypto++/filters.h>
#include <crypto++/hex.h>
using std::string;
using std::vector;
using namespace CryptoPP;
namespace format {
namespace uap {
@ -108,20 +99,6 @@ public:
~DataSign() {}
};
/*!
* String to Hash256
*/
inline const string StringToHash256(const string &str)
{
SHA256 hash;
std::string digest;
if (str != "")
StringSource s(str, true, new HashFilter(hash, new HexEncoder(new StringSink(digest))));
if (digest != "") {
return digest;
}
return nullptr;
}
/*!
* UAP Permission
@ -192,7 +169,6 @@ public:
// JS::serializeStruct(this->pkginfo) + JS::serializeStruct(this->pkgext) +
// JS::serializeStruct(this->owner);
// if (meta_json != "")
this->metasign.sign = StringToHash256(meta_json);
}
};

View File

@ -67,7 +67,6 @@ set(LINK_LIBS
${OSTREE1_LDFLAGS}
${APPSTREMGLIB_LDFLAGS}
-larchive
-lcrypto++
)
add_executable(ll-service

View File

@ -20,7 +20,7 @@ set(LINK_LIBS
yaml-cpp
GTest::GTest gtest_main
stdc++
-larchive -lcrypto++
-larchive
CURL::libcurl
${OSTREE1_LDFLAGS}
${APPSTREMGLIB_LDFLAGS}