We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 750da2e commit 74da978Copy full SHA for 74da978
src/main/java/org/keepassxc/Connection.java
@@ -683,8 +683,13 @@ private byte[] ramdomGenerateNonce() {
683
private byte[] incrementNonce(byte[] nonce) {
684
var c = 1;
685
byte[] incrementedNonce = nonce.clone();
686
- c += incrementedNonce[0];
687
- incrementedNonce[0] = (byte) c;
+
+ for (int i = 0; i < nonce.length; i++) {
688
+ c += (incrementedNonce[i] & 0xFF /*treat as unsigned*/);
689
+ incrementedNonce[i] = (byte) c;
690
+ c >>= 8;
691
+ }
692
693
return incrementedNonce;
694
}
695
0 commit comments