Skip to content

Commit

Permalink
fix(Envelope): mac/clang compile
Browse files Browse the repository at this point in the history
  • Loading branch information
aleks-f committed Apr 13, 2022
1 parent e6afb87 commit 4080ee2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@
"memory_resource": "cpp",
"random": "cpp",
"ranges": "cpp",
"cfenv": "cpp"
"cfenv": "cpp",
"__bits": "cpp",
"variant": "cpp"
},
"files.exclude": {
"**/.dep": true,
Expand Down
6 changes: 3 additions & 3 deletions Crypto/src/Envelope.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ void Envelope::addKey(const EVPPKey& key)

const Envelope::ByteVec& Envelope::seal(const ByteVec& plainData)
{
Byte* pEncKeys[_encKeys.size()] = {};
int encKeysSizes[_encKeys.size()] = {};
std::vector<Byte*> pEncKeys(_encKeys.size(), 0);
std::vector<int> encKeysSizes(_encKeys.size(), 0);
int i = 0;
for (const auto& k : _encKeys)
pEncKeys[i++] = new Byte[k.size()];

int noOfKeys = static_cast<int>(_pubKeys.size());
if (_encKeys.size() != EVP_SealInit(_pCtx, _pCipher, pEncKeys, encKeysSizes, &_iv[0], &_pubKeys[0], noOfKeys))
if (_encKeys.size() != EVP_SealInit(_pCtx, _pCipher, &pEncKeys[0], &encKeysSizes[0], &_iv[0], &_pubKeys[0], noOfKeys))
{
i = 0;
for (; i < _encKeys.size(); ++i) delete [] pEncKeys[i];
Expand Down

0 comments on commit 4080ee2

Please sign in to comment.