Merge #583: JNI: fix use sig array

74e2dbd JNI: fix use sig array (liuyujun)

Pull request description:

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

Tree-SHA512: 850b32e893463be4be28185dcc127d429afe4b6076036a078b7c61d590e0f4ea89127e448760b71c087cf70ffbefc52d87db77a5131bee81f3e4f95cfbd3bd3e
This commit is contained in:
Pieter Wuille 2019-08-06 15:32:20 -07:00
commit 786dfb49f5
No known key found for this signature in database
GPG Key ID: A636E97631F767E0
1 changed files with 3 additions and 3 deletions

View File

@ -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;