mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-11 19:17:22 +00:00
fix compiler warnings related to types, use inet_aton instead of inet_pton for compatibility
This commit is contained in:
parent
ada87b8255
commit
072986b669
@ -2727,7 +2727,7 @@ ipmi_lanplus_rakp3(struct ipmi_intf * intf)
|
|||||||
*/
|
*/
|
||||||
if (session->v2_data.rakp2_return_code == IPMI_RAKP_STATUS_NO_ERRORS)
|
if (session->v2_data.rakp2_return_code == IPMI_RAKP_STATUS_NO_ERRORS)
|
||||||
{
|
{
|
||||||
int auth_length;
|
uint32_t auth_length;
|
||||||
|
|
||||||
if (lanplus_generate_rakp3_authcode(msg + 8, session, &auth_length))
|
if (lanplus_generate_rakp3_authcode(msg + 8, session, &auth_length))
|
||||||
{
|
{
|
||||||
@ -2892,7 +2892,7 @@ ipmi_lanplus_open(struct ipmi_intf * intf)
|
|||||||
addr.sin_family = AF_INET;
|
addr.sin_family = AF_INET;
|
||||||
addr.sin_port = htons(session->port);
|
addr.sin_port = htons(session->port);
|
||||||
|
|
||||||
rc = inet_pton(AF_INET, session->hostname, &addr.sin_addr);
|
rc = inet_aton(session->hostname, &addr.sin_addr);
|
||||||
if (rc <= 0) {
|
if (rc <= 0) {
|
||||||
struct hostent *host = gethostbyname(session->hostname);
|
struct hostent *host = gethostbyname(session->hostname);
|
||||||
if (host == NULL) {
|
if (host == NULL) {
|
||||||
@ -3056,8 +3056,8 @@ void test_crypt2()
|
|||||||
|
|
||||||
char encrypt_buffer[1000];
|
char encrypt_buffer[1000];
|
||||||
char decrypt_buffer[1000];
|
char decrypt_buffer[1000];
|
||||||
int bytes_encrypted;
|
uint32_t bytes_encrypted;
|
||||||
int bytes_decrypted;
|
uint32_t bytes_decrypted;
|
||||||
|
|
||||||
printbuf(data, strlen(data), "input data");
|
printbuf(data, strlen(data), "input data");
|
||||||
|
|
||||||
|
@ -75,8 +75,8 @@ int lanplus_rakp2_hmac_matches(const struct ipmi_session * session,
|
|||||||
{
|
{
|
||||||
char * buffer;
|
char * buffer;
|
||||||
int bufferLength, i;
|
int bufferLength, i;
|
||||||
uint8_t mac[20];
|
uint8_t mac[20];
|
||||||
int macLength;
|
uint32_t macLength;
|
||||||
|
|
||||||
uint32_t SIDm_lsbf, SIDc_lsbf;
|
uint32_t SIDm_lsbf, SIDc_lsbf;
|
||||||
|
|
||||||
@ -219,8 +219,8 @@ int lanplus_rakp4_hmac_matches(const struct ipmi_session * session,
|
|||||||
{
|
{
|
||||||
char * buffer;
|
char * buffer;
|
||||||
int bufferLength, i;
|
int bufferLength, i;
|
||||||
uint8_t mac[20];
|
uint8_t mac[20];
|
||||||
int macLength;
|
uint32_t macLength;
|
||||||
|
|
||||||
uint32_t SIDc_lsbf;
|
uint32_t SIDc_lsbf;
|
||||||
|
|
||||||
@ -452,7 +452,7 @@ int lanplus_generate_sik(struct ipmi_session * session)
|
|||||||
int input_buffer_length, i;
|
int input_buffer_length, i;
|
||||||
char * input_key;
|
char * input_key;
|
||||||
int input_key_length;
|
int input_key_length;
|
||||||
int mac_length;
|
uint32_t mac_length;
|
||||||
|
|
||||||
|
|
||||||
memset(session->v2_data.sik, 0, IPMI_SIK_BUFFER_SIZE);
|
memset(session->v2_data.sik, 0, IPMI_SIK_BUFFER_SIZE);
|
||||||
|
@ -133,7 +133,7 @@ lanplus_HMAC(uint8_t mac,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return HMAC(evp_md, key, key_len, d, n, md, md_len);
|
return HMAC(evp_md, key, key_len, d, n, md, (unsigned int *)md_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
|
|||||||
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
|
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
|
||||||
|
|
||||||
|
|
||||||
if(!EVP_EncryptUpdate(&ctx, output, bytes_written, input, input_length))
|
if(!EVP_EncryptUpdate(&ctx, output, (unsigned int *)bytes_written, input, input_length))
|
||||||
{
|
{
|
||||||
/* Error */
|
/* Error */
|
||||||
*bytes_written = 0;
|
*bytes_written = 0;
|
||||||
@ -195,7 +195,7 @@ lanplus_encrypt_aes_cbc_128(const uint8_t * iv,
|
|||||||
{
|
{
|
||||||
uint32_t tmplen;
|
uint32_t tmplen;
|
||||||
|
|
||||||
if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, &tmplen))
|
if(!EVP_EncryptFinal_ex(&ctx, output + *bytes_written, (unsigned int *)&tmplen))
|
||||||
{
|
{
|
||||||
*bytes_written = 0;
|
*bytes_written = 0;
|
||||||
return; /* Error */
|
return; /* Error */
|
||||||
@ -259,7 +259,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
|
|||||||
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
|
assert((input_length % IPMI_CRYPT_AES_CBC_128_BLOCK_SIZE) == 0);
|
||||||
|
|
||||||
|
|
||||||
if (!EVP_DecryptUpdate(&ctx, output, bytes_written, input, input_length))
|
if (!EVP_DecryptUpdate(&ctx, output, (unsigned int *)bytes_written, input, input_length))
|
||||||
{
|
{
|
||||||
/* Error */
|
/* Error */
|
||||||
fprintf(stderr, "ERROR: decrypt update failed");
|
fprintf(stderr, "ERROR: decrypt update failed");
|
||||||
@ -270,7 +270,7 @@ lanplus_decrypt_aes_cbc_128(const uint8_t * iv,
|
|||||||
{
|
{
|
||||||
uint32_t tmplen;
|
uint32_t tmplen;
|
||||||
|
|
||||||
if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, &tmplen))
|
if (!EVP_DecryptFinal_ex(&ctx, output + *bytes_written, (unsigned int *)&tmplen))
|
||||||
{
|
{
|
||||||
char buffer[1000];
|
char buffer[1000];
|
||||||
ERR_error_string(ERR_get_error(), buffer);
|
ERR_error_string(ERR_get_error(), buffer);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user