Skip to content

Commit

Permalink
Merge dashpay#583: JNI: fix use sig array
Browse files Browse the repository at this point in the history
74e2dbd JNI: fix use sig array (liuyujun)

Pull request description:

ACKs for commit 74e2db:
  sipa:
    ACK 74e2dbd. This is clearly an improvement.
  real-or-random:
    ACK 74e2dbd I've read the code but haven't tested it

Tree-SHA512: 850b32e893463be4be28185dcc127d429afe4b6076036a078b7c61d590e0f4ea89127e448760b71c087cf70ffbefc52d87db77a5131bee81f3e4f95cfbd3bd3e
  • Loading branch information
sipa committed Aug 6, 2019
2 parents e95f8ab + 74e2dbd commit 786dfb4
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 786dfb4

Please sign in to comment.