Skip to content

Commit

Permalink
JNI: fix use sig array
Browse files Browse the repository at this point in the history
  • Loading branch information
fingera committed Jan 3, 2019
1 parent e34ceb3 commit 74e2dbd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/java/org_bitcoin_NativeSecp256k1.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ SECP256K1_API jobjectArray JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1e
jbyteArray sigArray, intsByteArray;
unsigned char intsarray[2];

secp256k1_ecdsa_signature sig[72];
secp256k1_ecdsa_signature sig;

int ret = secp256k1_ecdsa_sign(ctx, sig, data, secKey, NULL, NULL);
int ret = secp256k1_ecdsa_sign(ctx, &sig, data, secKey, NULL, NULL);

unsigned char outputSer[72];
size_t outputLen = 72;

if( ret ) {
int ret2 = secp256k1_ecdsa_signature_serialize_der(ctx,outputSer, &outputLen, sig ); (void)ret2;
int ret2 = secp256k1_ecdsa_signature_serialize_der(ctx,outputSer, &outputLen, &sig ); (void)ret2;
}

intsarray[0] = outputLen;
Expand Down

0 comments on commit 74e2dbd

Please sign in to comment.