ecdh_gcrypt: Use SSH_STRING_FREE()
Fixes T183 Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Этот коммит содержится в:
родитель
09dfda8489
Коммит
2786a3e96a
@ -115,7 +115,7 @@ int ssh_client_ecdh_init(ssh_session session)
|
|||||||
out:
|
out:
|
||||||
gcry_sexp_release(param);
|
gcry_sexp_release(param);
|
||||||
gcry_sexp_release(key);
|
gcry_sexp_release(key);
|
||||||
ssh_string_free(client_pubkey);
|
SSH_STRING_FREE(client_pubkey);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -215,13 +215,13 @@ int ecdh_build_k(ssh_session session)
|
|||||||
k_len = 133;
|
k_len = 133;
|
||||||
} else {
|
} else {
|
||||||
ssh_string_burn(s);
|
ssh_string_burn(s);
|
||||||
ssh_string_free(s);
|
SSH_STRING_FREE(s);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ssh_string_len(s) != k_len) {
|
if (ssh_string_len(s) != k_len) {
|
||||||
ssh_string_burn(s);
|
ssh_string_burn(s);
|
||||||
ssh_string_free(s);
|
SSH_STRING_FREE(s);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ int ecdh_build_k(ssh_session session)
|
|||||||
k_len / 2,
|
k_len / 2,
|
||||||
NULL);
|
NULL);
|
||||||
ssh_string_burn(s);
|
ssh_string_burn(s);
|
||||||
ssh_string_free(s);
|
SSH_STRING_FREE(s);
|
||||||
if (err) {
|
if (err) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -254,7 +254,7 @@ int ecdh_build_k(ssh_session session)
|
|||||||
gcry_sexp_release(data);
|
gcry_sexp_release(data);
|
||||||
gcry_sexp_release(result);
|
gcry_sexp_release(result);
|
||||||
ssh_string_burn(privkey);
|
ssh_string_burn(privkey);
|
||||||
ssh_string_free(privkey);
|
SSH_STRING_FREE(privkey);
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -347,7 +347,7 @@ SSH_PACKET_CALLBACK(ssh_packet_server_ecdh_init){
|
|||||||
rc = ssh_dh_get_next_server_publickey_blob(session, &pubkey_blob);
|
rc = ssh_dh_get_next_server_publickey_blob(session, &pubkey_blob);
|
||||||
if (rc != SSH_OK) {
|
if (rc != SSH_OK) {
|
||||||
ssh_set_error(session, SSH_FATAL, "Could not export server public key");
|
ssh_set_error(session, SSH_FATAL, "Could not export server public key");
|
||||||
ssh_string_free(sig_blob);
|
SSH_STRING_FREE(sig_blob);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,8 +358,8 @@ SSH_PACKET_CALLBACK(ssh_packet_server_ecdh_init){
|
|||||||
q_s_string, /* ecdh public key */
|
q_s_string, /* ecdh public key */
|
||||||
sig_blob); /* signature blob */
|
sig_blob); /* signature blob */
|
||||||
|
|
||||||
ssh_string_free(sig_blob);
|
SSH_STRING_FREE(sig_blob);
|
||||||
ssh_string_free(pubkey_blob);
|
SSH_STRING_FREE(pubkey_blob);
|
||||||
|
|
||||||
if (rc != SSH_OK) {
|
if (rc != SSH_OK) {
|
||||||
ssh_set_error_oom(session);
|
ssh_set_error_oom(session);
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user