lynx   »   [go: up one dir, main page]

Page MenuHomePhabricator

Bug 1741849 - Add constant-time checks to bltest and fbectest r=#nss-reviewers
Needs RevisionPublic

Authored by johny on Nov 18 2021, 12:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 4, 1:32 PM
Unknown Object (File)
Fri, Apr 4, 12:53 PM
Unknown Object (File)
Feb 15 2025, 6:40 PM
Unknown Object (File)
Jan 27 2025, 12:07 AM
Unknown Object (File)
Jan 18 2025, 3:35 AM
Unknown Object (File)
Jan 12 2025, 10:06 AM
Unknown Object (File)
Jan 9 2025, 12:04 AM
Unknown Object (File)
Jun 4 2024, 9:49 AM

Details

Reviewers
mt
ckerschb
Group Reviewers
nss-reviewers
Bugzilla Bug ID
1741849
Summary

Enable the --ct-verif switch to toggle the CT_VERIF define in
bltest and fbectest. Add Valgrind instrumentation for
constant-timeness checks to bltest and fbectest.

Diff Detail

Repository
rNSS nss
Branch
default
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.

Just a quick note; I didn't spend the time necessary to determine that the coverage here is adequate. That's probably the hardest part of reviewing any change of this sort.

cmd/bltest/blapitest.c
28–30

I think that it would be a good idea to define a new macro (CT_POISON(b, l) say) here. When CT_VERIF is on it can use the valgrind macro; otherwise it can be a noop. That will avoid the need for #ifdef statements throughout the code.

I have implemented the suggested CT_POISON macro. Btw. there are already mpi_taint and mpi_untaint functions defined and implemented under CT_VERIF in mpi.c, so maybe this can get unified.
However, those functions are only used in one unittest, which is disabled by default.

W.r.t coverage, feel free to let me know where to look for more primitives to include, I am quite new to NSS.

@johny

Hello! Thanks for your patch.
Could I ask you to write a small README section about what you have done in this patch? For example, in the macros.

Thanks :)

I also added two small comments:

cmd/bltest/blapitest.c
1710

Would it make sense to also have

CT_POISON(sk->iv.buf.data, sk->iv.buf.len);

?

1953

Why in some cases you have CT_VERIF, but not in the others?

ckerschb added a subscriber: ckerschb.

We, the crypto engineering team, are in the process of improving our review and landing queue, basically patches that are tagged with 'nss-reviewers'. Part of this process is to clean out 'stalled' patches. For whatever reason this changeset has not seen any movement for a long time and we consider it 'stalled'. If you feel this is a mistake or incorrect, please follow up, e.g. by rebasing the patch and/or by resetting the tag 'nss-reviewers' and drive this patch forward!

Thank you for your contributions!

This revision now requires changes to proceed.Jun 24 2024, 7:49 AM
Лучший частный хостинг