Просмотр исходного кода

Clarify some confusing casts involving |size_t|.

Change-Id: I7af2c87fe6e7513aa2603d5e845a4db87ab14fcc
Reviewed-on: https://boringssl-review.googlesource.com/7101
Reviewed-by: David Benjamin <davidben@google.com>
kris/onging/CECPQ3_patch15
Brian Smith 8 лет назад
committed by David Benjamin
Родитель
Сommit
894a47df24
3 измененных файлов: 6 добавлений и 6 удалений
  1. +1
    -1
      crypto/cipher/cipher_test.cc
  2. +2
    -2
      crypto/cipher/e_aes.c
  3. +3
    -3
      crypto/rsa/padding.c

+ 1
- 1
crypto/cipher/cipher_test.cc Просмотреть файл

@@ -138,7 +138,7 @@ static bool TestOperation(FileTest *t,
iv.size(), 0)) {
return false;
}
} else if (iv.size() != (size_t)EVP_CIPHER_CTX_iv_length(ctx.get())) {
} else if (iv.size() != EVP_CIPHER_CTX_iv_length(ctx.get())) {
t->PrintLine("Bad IV length.");
return false;
}


+ 2
- 2
crypto/cipher/e_aes.c Просмотреть файл

@@ -384,7 +384,7 @@ static int aes_ecb_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,

static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
size_t len) {
unsigned int num = ctx->num;
unsigned num = (unsigned)ctx->num;
EVP_AES_KEY *dat = (EVP_AES_KEY *)ctx->cipher_data;

if (dat->stream.ctr) {
@@ -394,7 +394,7 @@ static int aes_ctr_cipher(EVP_CIPHER_CTX *ctx, uint8_t *out, const uint8_t *in,
CRYPTO_ctr128_encrypt(in, out, len, &dat->ks, ctx->iv, ctx->buf, &num,
dat->block);
}
ctx->num = (size_t)num;
ctx->num = (int)num;
return 1;
}



+ 3
- 3
crypto/rsa/padding.c Просмотреть файл

@@ -95,7 +95,7 @@ int RSA_padding_add_PKCS1_type_1(uint8_t *to, unsigned to_len,
memset(p, 0xff, j);
p += j;
*(p++) = 0;
memcpy(p, from, (unsigned int)from_len);
memcpy(p, from, from_len);
return 1;
}

@@ -189,7 +189,7 @@ int RSA_padding_add_PKCS1_type_2(uint8_t *to, unsigned to_len,

*(p++) = 0;

memcpy(p, from, (unsigned int)from_len);
memcpy(p, from, from_len);
return 1;
}

@@ -271,7 +271,7 @@ int RSA_padding_add_none(uint8_t *to, unsigned to_len, const uint8_t *from,
return 0;
}

memcpy(to, from, (unsigned int)from_len);
memcpy(to, from, from_len);
return 1;
}



Загрузка…
Отмена
Сохранить