Skip to content

Commit 2ee006c

Browse files
authored
fix: length registration record should be OPAQUE_REGISTRATION_RECORD_LEN (#40)
The record received from opaque_FinalizeRequest and send to opaque_StoreUserRecord has length OPAQUE_REGISTRATION_RECORD_LEN
1 parent 36d38d0 commit 2ee006c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

java/jni.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ static jobject c_finalizeReg(JNIEnv *env, jobject obj, jbyteArray sec_, jbyteArr
396396
getids(env, ids_, &ids, &gc);
397397

398398
uint8_t export_key[crypto_hash_sha512_BYTES];
399-
uint8_t rec[OPAQUE_USER_RECORD_LEN];
399+
uint8_t rec[OPAQUE_REGISTRATION_RECORD_LEN];
400400

401401
if(0!=opaque_FinalizeRequest(sec, pub, &ids, rec, export_key)) {
402402
exception(env,"opaque register() failed...");
@@ -428,7 +428,7 @@ static jbyteArray c_storeRec(JNIEnv *env, jobject obj, jbyteArray sec_, jbyteArr
428428
sec = (char*) sec_jb;
429429

430430
size_t recU_len= (*env)->GetArrayLength(env, recU_);
431-
if(recU_len<=OPAQUE_REGISTRATION_RECORD_LEN) {
431+
if(recU_len!=OPAQUE_REGISTRATION_RECORD_LEN) {
432432
exception(env, "recU has invalid size");
433433
return NULL;
434434
}

0 commit comments

Comments
 (0)