Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demos/hashsum.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static void check_file(int argn, int argc, char **argv)
space++;

for (n = 0; n < (buf + sizeof(buf)) - space; ++n) {
if(iscntrl(space[n])) {
if(iscntrl((int)space[n])) {
space[n] = '\0';
break;
}
Expand Down
4 changes: 4 additions & 0 deletions demos/tv_gen.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ void gcm_gen(void)
printf("Error GCM'ing: %s\n", error_to_string(err));
exit(EXIT_FAILURE);
}
if (len == 0) {
printf("Error GCM'ing: zero length\n");
exit(EXIT_FAILURE);
}
fprintf(out, "%3d: ", y1);
for (z = 0; z < y1; z++) {
fprintf(out, "%02X", plaintext[z]);
Expand Down
2 changes: 1 addition & 1 deletion src/ciphers/anubis.c
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@ int anubis_setup(const unsigned char *key, int keylen, int num_rounds, symmetri
{
int N, R, i, pos, r;
ulong32 kappa[MAX_N];
ulong32 inter[MAX_N];
ulong32 inter[MAX_N] = { 0 }; /* initialize as all zeroes */
ulong32 v, K0, K1, K2, K3;

LTC_ARGCHK(key != NULL);
Expand Down
2 changes: 1 addition & 1 deletion src/encauth/ccm/ccm_memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ int ccm_memory(int cipher,
}

/* initialize buffer for pt */
if (direction == CCM_DECRYPT) {
if (direction == CCM_DECRYPT && ptlen > 0) {
pt_work = XMALLOC(ptlen);
if (pt_work == NULL) {
goto error;
Expand Down
2 changes: 1 addition & 1 deletion src/pk/asn1/der/utctime/der_decode_utctime.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static int char_to_int(unsigned char x)
int der_decode_utctime(const unsigned char *in, unsigned long *inlen,
ltc_utctime *out)
{
unsigned char buf[32];
unsigned char buf[32] = { 0 }; /* initialize as all zeroes */
unsigned long x;
int y;

Expand Down
6 changes: 3 additions & 3 deletions testprof/rsa_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,6 @@ for (cnt = 0; cnt < len; ) {
for (i = 0; i < 9; ++i) {
len = sizeof(in);
len2 = sizeof(out);
cnt = rsa_get_size(&key);
/* (1) */
DO(rsa_sign_hash_ex(p, 20, p2, &len2, LTC_PKCS_1_V1_5, &yarrow_prng, prng_idx, hash_idx, 8, &privKey));
/* (2) */
Expand All @@ -540,7 +539,8 @@ for (cnt = 0; cnt < len; ) {
/* (3) */
DO(ltc_mp.rsa_me(p2, len2, p3, &len3, PK_PUBLIC, &key));
/* (4) */
#if 0
#ifdef LTC_TEST_DBG
cnt = rsa_get_size(&key);
printf("\nBefore:");
for (cnt = 0; cnt < len3; ++cnt) {
if (cnt%32 == 0)
Expand All @@ -563,7 +563,7 @@ for (cnt = 0; cnt < len; ) {
for (cnt = cnt + len3-cnt2+i; cnt < len; ++cnt) {
p3[cnt] = 0;
}
#if 0
#ifdef LTC_TEST_DBG
printf("\nAfter:");
for (cnt = 0; cnt < len3; ++cnt) {
if (cnt%32 == 0)
Expand Down
2 changes: 1 addition & 1 deletion testprof/x86_prof.c
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,7 @@ void time_macs_(unsigned long MAC_SIZE)

if (cipher_idx == -1 || hash_idx == -1) {
fprintf(stderr, "Warning the MAC tests requires AES and SHA1 to operate... so sorry\n");
return;
exit(EXIT_FAILURE);
}

yarrow_read(buf, MAC_SIZE*1024, &yarrow_prng);
Expand Down