Skip to content

Commit 0c54e7d

Browse files
committed
FIX: resolving some compiler's warnings
1 parent b5378c5 commit 0c54e7d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/core/n-crypt.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ const REBYTE dh_name[] = "DH-Key";
165165
if(ctx == NULL) Trap0(RE_INVALID_HANDLE);
166166

167167
if(IS_NONE(val_data)) {
168-
puts("releasing AES ctx");
168+
//puts("releasing AES ctx");
169169
Free_Series(ctx);
170170
SET_HANDLE(val_ctx, NULL);
171171
return R_TRUE;
@@ -390,7 +390,6 @@ const REBYTE dh_name[] = "DH-Key";
390390

391391
DH_CTX *dh;
392392
REBYTE *bin;
393-
REBCNT len;
394393
REBVAL *ret;
395394

396395
REBCNT len_g = BIN_LEN(g);
@@ -409,7 +408,7 @@ const REBYTE dh_name[] = "DH-Key";
409408
*D_RET = *D_ARG(4);
410409
dh = (DH_CTX*)VAL_HANDLE(val_dh);
411410
if(dh == NULL) goto new_dh_handle;
412-
if(dh->len_data < buffer_len) {
411+
if((REBCNT)dh->len_data < buffer_len) {
413412
//needs new allocation for keys
414413
if(dh->data != NULL) FREE_MEM(dh->data);
415414
} else {
@@ -503,12 +502,12 @@ const REBYTE dh_name[] = "DH-Key";
503502
}
504503

505504
if(ref_secret) {
506-
bin = BIN_DATA(VAL_SERIES(pub_key)); //@@ use VAL_BIN_AT instead?
507-
len = BIN_LEN(VAL_SERIES(pub_key));
505+
bin = VAL_SERIES(pub_key); //@@ use VAL_BIN_AT instead?
506+
len = BIN_LEN(bin);
508507
if(len != dh->len) {
509508
return R_NONE; // throw an error?
510509
}
511-
COPY_MEM(dh->gy, bin, len);
510+
COPY_MEM(dh->gy, BIN_DATA(bin), len);
512511

513512
DH_compute_key(dh);
514513

0 commit comments

Comments
 (0)