Skip to content

Commit b225797

Browse files
authored
Merge pull request #26 from vkresch/master
Update installation and fixing minor bugs
2 parents 1b33f89 + bdca3fe commit b225797

6 files changed

Lines changed: 39 additions & 24 deletions

File tree

.travis.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,10 @@ install:
9595
- cd ..
9696

9797
## Crypto++ (We dont need this for residue, we need it for ripe and mine)
98-
- wget https://amrayn.github.io/downloads/cryptocpp.tar.gz
99-
- tar xf cryptocpp.tar.gz
100-
- cd cryptopp-CRYPTOPP_5_6_5
101-
- wget https://amrayn.github.io/downloads/pem_pack.zip
102-
- unzip pem_pack.zip
103-
- cmake .
98+
- git clone https://github.com/weidai11/cryptopp.git
99+
- git clone https://github.com/amraynweb/cryptopp-pem.git
100+
- cp cryptopp-pem/* cryptopp/
101+
- cd cryptopp
104102
- make
105103
- sudo make install
106104

README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,26 +32,27 @@ License++ is software licensing library that provides an abstract way to secure
3232
* [Download](https://github.com/amrayn/licensepp/archive/master.zip) or [clone](git@github.com:amrayn/licensepp.git) the repository
3333
* Install Crypto++
3434
```
35-
wget https://amrayn.github.io/downloads/cryptocpp.tar.gz
36-
tar xf cryptocpp.tar.gz
37-
cd cryptopp-CRYPTOPP_5_6_5
38-
wget https://amrayn.github.io/downloads/pem_pack.zip
39-
unzip pem_pack.zip
40-
cmake .
35+
git clone https://github.com/amrayn/licensepp
36+
git clone https://github.com/weidai11/cryptopp.git
37+
git clone https://github.com/amraynweb/cryptopp-pem.git
38+
cp cryptopp-pem/* cryptopp/
39+
cd cryptopp
4140
make
42-
make install
41+
sudo make install
4342
```
4443
* Use CMake to build the project
4544
```
46-
cd <project_root>
45+
cd licensepp
4746
mkdir build
4847
cd build
4948
cmake ..
50-
make install
49+
make
50+
sudo make install
5151
5252
## build with test
5353
cmake -Dtest=ON ..
54-
make install
54+
make
55+
sudo make install
5556
./licensepp-unit-tests
5657
```
5758
* You can build [cli](/cli) tool to ensure license++ is installed properly

cmake/FindCryptoPP.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,14 @@ IF (CRYPTOPP_INCLUDE_DIR)
9393

9494
STRING (REGEX REPLACE
9595
"^#define CRYPTOPP_VERSION[ \t]+([0-9]+)" "\\1" _CRYPTOPP_VERSION_TMP
96-
${_CRYPTOPP_VERSION_TMP})
96+
"${_CRYPTOPP_VERSION_TMP}")
9797

9898
STRING (REGEX REPLACE "([0-9]+)[0-9][0-9]" "\\1" CRYPTOPP_VERSION_MAJOR
99-
${_CRYPTOPP_VERSION_TMP})
99+
"${_CRYPTOPP_VERSION_TMP}")
100100
STRING (REGEX REPLACE "[0-9]([0-9])[0-9]" "\\1" CRYPTOPP_VERSION_MINOR
101-
${_CRYPTOPP_VERSION_TMP})
101+
"${_CRYPTOPP_VERSION_TMP}")
102102
STRING (REGEX REPLACE "[0-9][0-9]([0-9])" "\\1" CRYPTOPP_VERSION_PATCH
103-
${_CRYPTOPP_VERSION_TMP})
103+
"${_CRYPTOPP_VERSION_TMP}")
104104

105105
SET (CRYPTOPP_VERSION_COUNT 3)
106106
SET (CRYPTOPP_VERSION

cmake/Findgtest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ function(GTEST_ADD_TESTS executable extra_args)
7979
file(READ "${source}" contents)
8080
string(REGEX MATCHALL "TEST_?F?\\(([A-Za-z_0-9 ,]+)\\)" found_tests ${contents})
8181
foreach(hit ${found_tests})
82-
string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name ${hit})
82+
string(REGEX REPLACE ".*\\( *([A-Za-z_0-9]+), *([A-Za-z_0-9]+) *\\).*" "\\1.\\2" test_name "${hit}")
8383
add_test(${test_name} ${executable} --gtest_filter=${test_name} ${extra_args})
8484
list(APPEND _test_names ${test_name})
8585
endforeach()

sample/README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,23 @@ After you build using `make` run:
55
```
66
./license-manager-sample --license sample.licensepp
77
```
8+
or
9+
```
10+
LD_LIBRARY_PATH=/usr/local/lib/ ./license-manager-sample --license sample.licensepp
11+
```
12+
or
13+
```
14+
LD_LIBRARY_PATH=../build ./license-manager-sample --license sample.licensepp
15+
```
816

917
```
1018
./license-manager-sample --license sample-with-signature.licensepp --signature sample-signature
1119
```
20+
or
21+
```
22+
LD_LIBRARY_PATH=/usr/local/lib/ ./license-manager-sample --license sample-with-signature.licensepp --signature sample-signature
23+
```
24+
or
25+
```
26+
LD_LIBRARY_PATH=../build ./license-manager-sample --license sample-with-signature.licensepp --signature sample-signature
27+
```

src/external/Ripe.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ bool Ripe::verifyRSA(const std::string& data, const std::string& signatureHex, c
144144
}
145145
std::string decodedSignature = Ripe::hexToString(signatureHex);
146146
bool result = false;
147-
RSASS<PKCS1v15,SHA>::Verifier verifier(publicKey);
147+
RSASS<PKCS1v15,SHA1>::Verifier verifier(publicKey);
148148
StringSource ss2(decodedSignature + data, true,
149149
new SignatureVerificationFilter(verifier,
150150
new ArraySink((RipeByte*)&result, sizeof(result))));
@@ -161,7 +161,7 @@ std::string Ripe::signRSA(const std::string& data, const std::string& privateKey
161161

162162
// sign message
163163
std::string signature;
164-
RSASS<PKCS1v15,SHA>::Signer signer(privateKey);
164+
RSASS<PKCS1v15,SHA1>::Signer signer(privateKey);
165165
AutoSeededRandomPool rng;
166166

167167
StringSource ss(data, true,
@@ -227,7 +227,7 @@ Ripe::KeyPair Ripe::generateRSAKeyPair(unsigned int length, const std::string& s
227227
if (secret.empty()) {
228228
PEM_Save(snk, privateKey);
229229
} else {
230-
PEM_Save(snk, rng, privateKey, PRIVATE_RSA_ALGORITHM, secret.data(), secret.size());
230+
PEM_Save(snk, privateKey, rng, PRIVATE_RSA_ALGORITHM, secret.data(), secret.size());
231231
}
232232
snk.MessageEnd();
233233
}

0 commit comments

Comments
 (0)