aboutsummaryrefslogtreecommitdiff
path: root/src/ringct/rctSigs.cpp
diff options
context:
space:
mode:
authorstoffu <stoffu@protonmail.ch>2018-08-16 22:08:58 +0900
committerstoffu <stoffu@protonmail.ch>2018-08-16 22:26:30 +0900
commit1f2409e9e2c15e1b96c2bcb3d7bfd77091b2a504 (patch)
treeca3263416292ee39c8e1b236ac554b317c209c94 /src/ringct/rctSigs.cpp
parentMerge pull request #4191 (diff)
downloadmonero-1f2409e9e2c15e1b96c2bcb3d7bfd77091b2a504.tar.xz
Do memwipe for critical secret keys copied to rct::key
Diffstat (limited to '')
-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;
}