瀏覽代碼

Fix integer underflow when writing updated sk

This caused secret key files to become close to MAXINT bytes, as
the unsigned int that is the private key size would be subtracted
from MAXINT when its negative was used as offset.
master
Joost Rijneveld 7 年之前
父節點
當前提交
998137622a
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: A4FE39CF49CBC553
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. +1
    -1
      test/xmss_sign.c

+ 1
- 1
test/xmss_sign.c 查看文件

@@ -43,7 +43,7 @@ int main(int argc, char **argv) {
fread(m, 1, MLEN, stdin);
xmss_core_sign(&params, sk, sm, &smlen, m, MLEN);

fseek(keypair, -params.privatekey_bytes, SEEK_CUR);
fseek(keypair, -((long int)params.privatekey_bytes), SEEK_CUR);
fwrite(sk, 1, params.privatekey_bytes, keypair);
fwrite(sm, 1, params.bytes + MLEN, stdout);



Loading…
取消
儲存