version 1.3, 2020/10/18 11:32:02 |
version 1.4, 2020/10/19 22:49:23 |
|
|
smlen = slen = datalen + required_siglen; |
smlen = slen = datalen + required_siglen; |
if ((sig = malloc(slen)) == NULL) |
if ((sig = malloc(slen)) == NULL) |
return SSH_ERR_ALLOC_FAIL; |
return SSH_ERR_ALLOC_FAIL; |
if ((r = sshkey_xmss_get_state(key, error)) != 0) |
if ((r = sshkey_xmss_get_state(key, 1)) != 0) |
goto out; |
goto out; |
if ((ret = xmss_sign(key->xmss_sk, sshkey_xmss_bds_state(key), sig, &smlen, |
if ((ret = xmss_sign(key->xmss_sk, sshkey_xmss_bds_state(key), sig, &smlen, |
data, datalen, sshkey_xmss_params(key))) != 0 || smlen <= datalen) { |
data, datalen, sshkey_xmss_params(key))) != 0 || smlen <= datalen) { |
|
|
/* success */ |
/* success */ |
r = 0; |
r = 0; |
out: |
out: |
if ((ret = sshkey_xmss_update_state(key, error)) != 0) { |
if ((ret = sshkey_xmss_update_state(key, 1)) != 0) { |
/* discard signature since we cannot update the state */ |
/* discard signature since we cannot update the state */ |
if (r == 0 && sigp != NULL && *sigp != NULL) { |
if (r == 0 && sigp != NULL && *sigp != NULL) { |
explicit_bzero(*sigp, len); |
explicit_bzero(*sigp, len); |