@@ -165,7 +165,7 @@ const REBYTE dh_name[] = "DH-Key";
165
165
if (ctx == NULL ) Trap0 (RE_INVALID_HANDLE );
166
166
167
167
if (IS_NONE (val_data )) {
168
- puts ("releasing AES ctx" );
168
+ // puts("releasing AES ctx");
169
169
Free_Series (ctx );
170
170
SET_HANDLE (val_ctx , NULL );
171
171
return R_TRUE ;
@@ -390,7 +390,6 @@ const REBYTE dh_name[] = "DH-Key";
390
390
391
391
DH_CTX * dh ;
392
392
REBYTE * bin ;
393
- REBCNT len ;
394
393
REBVAL * ret ;
395
394
396
395
REBCNT len_g = BIN_LEN (g );
@@ -409,7 +408,7 @@ const REBYTE dh_name[] = "DH-Key";
409
408
* D_RET = * D_ARG (4 );
410
409
dh = (DH_CTX * )VAL_HANDLE (val_dh );
411
410
if (dh == NULL ) goto new_dh_handle ;
412
- if (dh -> len_data < buffer_len ) {
411
+ if (( REBCNT ) dh -> len_data < buffer_len ) {
413
412
//needs new allocation for keys
414
413
if (dh -> data != NULL ) FREE_MEM (dh -> data );
415
414
} else {
@@ -503,12 +502,12 @@ const REBYTE dh_name[] = "DH-Key";
503
502
}
504
503
505
504
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 );
508
507
if (len != dh -> len ) {
509
508
return R_NONE ; // throw an error?
510
509
}
511
- COPY_MEM (dh -> gy , bin , len );
510
+ COPY_MEM (dh -> gy , BIN_DATA ( bin ) , len );
512
511
513
512
DH_compute_key (dh );
514
513
0 commit comments