View Issue Details

IDProjectCategoryView StatusLast Update
0009953Talerqtartpublic2025-08-31 17:40
Reporterfefe Assigned ToResolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeverityminorReproducibilityhave not tried
Status implementingResolutionopen 
Product Version1.0 
Target Versionpost-1.0 
Summary0009953: unexplained numeric constants in js_talercrypto_eddsa_sign
DescriptionIn tart_module.c:

 595 unsigned char sk[crypto_sign_SECRETKEYBYTES];
 596 unsigned char pk[crypto_sign_PUBLICKEYBYTES];
 597 unsigned char sig[64];

Why 64?

 605 seed = JS_GetArrayBuffer(ctx, &seed_size, argv[1]);
 606 if (!seed) {
 607 return JS_EXCEPTION;
 608 }
 609 if (seed_size != 32) {
 610 return JS_ThrowTypeError(ctx, "invalid private key size");
 611 }

Why 32? Also the error string is probably wrong because crypto_sign_SECRETKEYBYTES is 64 not 32.

 617 res = crypto_sign_detached((uint8_t *)sig,
 618 NULL,
 619 (uint8_t *)data,
 620 data_size,
 621 sk);

The second argument (NULL here) is supposed to return the size of the signature (always 64).

 625 return make_js_ta_copy(ctx, sig, 64);

This looks like it is meant to be algorithm agnostic (calls crypto_sign_detached instead of crypto_sign_ed25519_detached), but what if a future version of libsodium changes the algorithm and thus the sizes change too? Maybe better call the ed25519 function directly?
Tagssecurity

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

There are no notes attached to this issue.

Issue History

Date ModifiedUsernameFieldChange
2025-05-13 12:12fefeNew Issue
2025-05-13 12:39Christian GrothoffAssigned To => Florian Dold
2025-05-13 12:39Christian GrothoffStatusnew => assigned
2025-06-04 22:06Florian DoldTarget Version => 1.1
2025-06-04 22:22Christian GrothoffTag Attached: security
2025-06-04 23:55Florian DoldTarget Version1.1 => 1.6
2025-08-31 17:25Christian GrothoffProduct Version => 1.0
2025-08-31 17:25Christian GrothoffTarget Version1.6 => post-1.0
2025-08-31 17:40Christian GrothoffAssigned ToFlorian Dold =>
2025-08-31 17:40Christian GrothoffStatusassigned => implementing