Skip to content

Commit

Permalink
FIX: resolving some compiler's warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Oldes committed Sep 20, 2018
1 parent b5378c5 commit 0c54e7d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/core/n-crypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ const REBYTE dh_name[] = "DH-Key";
if(ctx == NULL) Trap0(RE_INVALID_HANDLE);

if(IS_NONE(val_data)) {
puts("releasing AES ctx");
//puts("releasing AES ctx");
Free_Series(ctx);
SET_HANDLE(val_ctx, NULL);
return R_TRUE;
Expand Down Expand Up @@ -390,7 +390,6 @@ const REBYTE dh_name[] = "DH-Key";

DH_CTX *dh;
REBYTE *bin;
REBCNT len;
REBVAL *ret;

REBCNT len_g = BIN_LEN(g);
Expand All @@ -409,7 +408,7 @@ const REBYTE dh_name[] = "DH-Key";
*D_RET = *D_ARG(4);
dh = (DH_CTX*)VAL_HANDLE(val_dh);
if(dh == NULL) goto new_dh_handle;
if(dh->len_data < buffer_len) {
if((REBCNT)dh->len_data < buffer_len) {
//needs new allocation for keys
if(dh->data != NULL) FREE_MEM(dh->data);
} else {
Expand Down Expand Up @@ -503,12 +502,12 @@ const REBYTE dh_name[] = "DH-Key";
}

if(ref_secret) {
bin = BIN_DATA(VAL_SERIES(pub_key)); //@@ use VAL_BIN_AT instead?
len = BIN_LEN(VAL_SERIES(pub_key));
bin = VAL_SERIES(pub_key); //@@ use VAL_BIN_AT instead?
len = BIN_LEN(bin);
if(len != dh->len) {
return R_NONE; // throw an error?
}
COPY_MEM(dh->gy, bin, len);
COPY_MEM(dh->gy, BIN_DATA(bin), len);

DH_compute_key(dh);

Expand Down

0 comments on commit 0c54e7d

Please sign in to comment.