aboutsummaryrefslogtreecommitdiff
path: root/src/ringct
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2018-09-04 13:16:04 -0500
committerluigi1111 <luigi1111w@gmail.com>2018-09-04 13:16:04 -0500
commit5f1bbe3bced3d73bf2996e39b86dc4e871422813 (patch)
tree903a2c9e481445d98b8381b731a030d4dcdc462f /src/ringct
parentMerge pull request #4264 (diff)
parentDo memwipe for critical secret keys copied to rct::key (diff)
downloadmonero-5f1bbe3bced3d73bf2996e39b86dc4e871422813.tar.xz
Merge pull request #4268
1f2409e Do memwipe for critical secret keys copied to rct::key (stoffu)
Diffstat (limited to 'src/ringct')
-rw-r--r--src/ringct/rctSigs.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ringct/rctSigs.cpp b/src/ringct/rctSigs.cpp
index f74216ed4..cc966c44b 100644
--- a/src/ringct/rctSigs.cpp
+++ b/src/ringct/rctSigs.cpp
@@ -492,7 +492,9 @@ namespace rct {
for (size_t j = 0; j < outPk.size(); j++) {
sc_sub(sk[rows].bytes, sk[rows].bytes, outSk[j].mask.bytes); //subtract output masks in last row..
}
- return MLSAG_Gen(message, M, sk, kLRki, mscout, index, rows, hwdev);
+ mgSig result = MLSAG_Gen(message, M, sk, kLRki, mscout, index, rows, hwdev);
+ memwipe(sk.data(), sk.size() * sizeof(key));
+ return result;
}
@@ -521,7 +523,9 @@ namespace rct {
M[i][0] = pubs[i].dest;
subKeys(M[i][1], pubs[i].mask, Cout);
}
- return MLSAG_Gen(message, M, sk, kLRki, mscout, index, rows, hwdev);
+ mgSig result = MLSAG_Gen(message, M, sk, kLRki, mscout, index, rows, hwdev);
+ memwipe(&sk[0], sizeof(key));
+ return result;
}