mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
crypto: Use uint8_t instead of non-standard u_char
Signed-off-by: Tilo Eckert <tilo.eckert@flam.de> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
committed by
Andreas Schneider
parent
7caf6d2ab6
commit
17df34da96
@@ -543,7 +543,7 @@ static int evp_cipher_set_encrypt_key(struct ssh_cipher_struct *cipher,
|
|||||||
rc = EVP_CIPHER_CTX_ctrl(cipher->ctx,
|
rc = EVP_CIPHER_CTX_ctrl(cipher->ctx,
|
||||||
EVP_CTRL_GCM_SET_IV_FIXED,
|
EVP_CTRL_GCM_SET_IV_FIXED,
|
||||||
-1,
|
-1,
|
||||||
(u_char *)IV);
|
(uint8_t *)IV);
|
||||||
if (rc != 1) {
|
if (rc != 1) {
|
||||||
SSH_LOG(SSH_LOG_WARNING, "EVP_CTRL_GCM_SET_IV_FIXED failed");
|
SSH_LOG(SSH_LOG_WARNING, "EVP_CTRL_GCM_SET_IV_FIXED failed");
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
@@ -576,7 +576,7 @@ static int evp_cipher_set_decrypt_key(struct ssh_cipher_struct *cipher,
|
|||||||
rc = EVP_CIPHER_CTX_ctrl(cipher->ctx,
|
rc = EVP_CIPHER_CTX_ctrl(cipher->ctx,
|
||||||
EVP_CTRL_GCM_SET_IV_FIXED,
|
EVP_CTRL_GCM_SET_IV_FIXED,
|
||||||
-1,
|
-1,
|
||||||
(u_char *)IV);
|
(uint8_t *)IV);
|
||||||
if (rc != 1) {
|
if (rc != 1) {
|
||||||
SSH_LOG(SSH_LOG_WARNING, "EVP_CTRL_GCM_SET_IV_FIXED failed");
|
SSH_LOG(SSH_LOG_WARNING, "EVP_CTRL_GCM_SET_IV_FIXED failed");
|
||||||
return SSH_ERROR;
|
return SSH_ERROR;
|
||||||
@@ -728,7 +728,7 @@ evp_cipher_aead_encrypt(struct ssh_cipher_struct *cipher,
|
|||||||
uint64_t seq)
|
uint64_t seq)
|
||||||
{
|
{
|
||||||
size_t authlen, aadlen;
|
size_t authlen, aadlen;
|
||||||
u_char lastiv[1];
|
uint8_t lastiv[1];
|
||||||
int tmplen = 0;
|
int tmplen = 0;
|
||||||
size_t outlen;
|
size_t outlen;
|
||||||
int rc;
|
int rc;
|
||||||
@@ -800,7 +800,7 @@ evp_cipher_aead_decrypt(struct ssh_cipher_struct *cipher,
|
|||||||
uint64_t seq)
|
uint64_t seq)
|
||||||
{
|
{
|
||||||
size_t authlen, aadlen;
|
size_t authlen, aadlen;
|
||||||
u_char lastiv[1];
|
uint8_t lastiv[1];
|
||||||
int outlen = 0;
|
int outlen = 0;
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
|
|||||||
@@ -925,9 +925,9 @@ cipher_decrypt_gcm(struct ssh_cipher_struct *cipher,
|
|||||||
AES_GCM_IVLEN,
|
AES_GCM_IVLEN,
|
||||||
complete_packet, /* aad */
|
complete_packet, /* aad */
|
||||||
aadlen,
|
aadlen,
|
||||||
(const u_char *)complete_packet + aadlen + encrypted_size, /* tag */
|
(const uint8_t *)complete_packet + aadlen + encrypted_size, /* tag */
|
||||||
authlen,
|
authlen,
|
||||||
(const u_char *)complete_packet + aadlen, /* input */
|
(const uint8_t *)complete_packet + aadlen, /* input */
|
||||||
(unsigned char *)out); /* output */
|
(unsigned char *)out); /* output */
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
SSH_LOG(SSH_LOG_WARNING, "mbedtls_gcm_auth_decrypt failed");
|
SSH_LOG(SSH_LOG_WARNING, "mbedtls_gcm_auth_decrypt failed");
|
||||||
|
|||||||
Reference in New Issue
Block a user