Repository navigation
lib: simplify attr_util - #3605
Open
AndreasFuchsTPM wants to merge 3 commits into
Open
AndreasFuchsTPM wants to merge 3 commits into
AndreasFuchsTPM wants to merge 3 commits into
Conversation
AndreasFuchsTPM
force-pushed
the
simplify_attr_util
branch
from
August 11, 2026 14:11
1e7640f to
36819d8
Compare
AndreasFuchsTPM
force-pushed
the
simplify_attr_util
branch
2 times, most recently
from
August 11, 2026 14:31
3798513 to
8a316b1
Compare
moritzbuhl
force-pushed
the
simplify_attr_util
branch
from
August 25, 2026 08:57
8a316b1 to
b8da06e
Compare
AndreasFuchsTPM
force-pushed
the
simplify_attr_util
branch
from
August 26, 2026 14:56
39fb80a to
f0940af
Compare
Member
|
The following things are still needed to match the old functionality: reserved bits are no longer allowed, old code wrote nt=0x... and formatting values other than the named ones from the enum. boolean tokens accept an equals sign, e.g. |
AndreasFuchsTPM
force-pushed
the
simplify_attr_util
branch
3 times, most recently
from
September 11, 2026 13:09
90b7090 to
80cd0a1
Compare
Signed-off-by: Andreas Fuchs <andreas.fuchs@infineon.com>
AndreasFuchsTPM
force-pushed
the
simplify_attr_util
branch
2 times, most recently
from
September 11, 2026 14:47
c679b7d to
f1a1259
Compare
moritzbuhl
reviewed
Sep 11, 2026
moritzbuhl
reviewed
Sep 11, 2026
| tpm_nt_ordinary = true; | ||
| } | ||
|
|
||
| while ((token = strtok_r((save)? NULL : str, "|", &save))) { |
Member
There was a problem hiding this comment.
for (token = strtok_r(str, "|", &save); token != NULL; token = strtok_r(NULL, "|", &save)) {
Member
There was a problem hiding this comment.
So FreeBSD's libc sets save = NULL (https://github.com/freebsd/freebsd-src/blob/main/lib/libc/string/strtok.c#L67), glibc does not: https://github.com/lattera/glibc/blob/master/string/strtok_r.c#L59
moritzbuhl
force-pushed
the
simplify_attr_util
branch
from
September 11, 2026 21:39
2100c09 to
074f500
Compare
Instead of a table driven dispatch logic, use a simpler approach. Also instead of the nt=0x? notation the tools will now output the usable name, e.g. counter, extend, pinpass, etc We do not output ordinary for backwards compatibility. Signed-off-by: Andreas Fuchs <andreas.fuchs@infineon.com>
This is an API change where instead of printing or allowing the notion of "<reserved(20)>" for reserved bits in bitmasks we return errors now. Signed-off-by: Andreas Fuchs <andreas.fuchs@infineon.com>
AndreasFuchsTPM
force-pushed
the
simplify_attr_util
branch
from
September 15, 2026 08:48
074f500 to
2c17fd3
Compare
moritzbuhl
approved these changes
Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Instead of a table driven dispatch logic, use a simple linear switch case like approach.
So I did break API here.
Old output: "authread|authwrite|nt=0x2"
New output: "authread|authwrtie|extend"
Parsing still accepts all variants though...
I like this much more; oppinions?
Also question: Should the tools return a bunch of "<reserved(8)>" reports or should the library's to text rather fail here ?
Fixes: #1797
Implements: #1798
Superseeds: #3600