Document ASN1_BIT_STRING functions#30690
Conversation
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
da6a76b to
b71846a
Compare
|
Deprecation PR #30692 |
|
|
||
|
|
||
| ASN1_BIT_STRING_name_print() prints the corresponding bit name specified in | ||
| I<tbl> to I<out> based on the bit string I<bs>. I<indent> might be specified for |
There was a problem hiding this comment.
Ugh, BIT_STRING_BITNAME is not documented; since ASN1_BIT_STRING_name_print, ASN1_BIT_STRING_num_asc, and ASN1_BIT_STRING_set_asc are the only users, its definition can just be added to SYNOPSIS here.
Also, it has to be described somewhere how tbl is generally interpreted: that it is an array of BIT_STRING_BITNAME structures, bitnum is a bit number (and the array is expected to be sorted in non-descending order on bitnum as the key), lname is a "long"(?), human-readable name for the bit, sname is a "short"(?), standards-defined name, the array is terminated with a { -1, NULL, NULL } sentinel (different functions use different fields for end-of-loop check), the table may contain repeated bitnum values, but expected to do so only for sequential records, with the ones following the first being interpreted as aliases (which are not used in ASN1_BIT_STRING_name_print, but are used for matching in ASN1_BIT_STRING_num_asc, v2i_ASN1_BIT_STRING, and maybe others).
There was a problem hiding this comment.
do you think it's worth to document the tbl? The usage you describe does not look that much consistent
There was a problem hiding this comment.
Added the struct to the synopsis, hope it's the format you were thinking of
There was a problem hiding this comment.
Well, it does help, but the currently added/present content leaves the question "what (in what format) should I provide as tbl to ASN1_BIT_STRING_name_print/ASN1_BIT_STRING_num_asc/ASN1_BIT_STRING_set_asc to make them work as I expect" unanswered.
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Signed-off-by: Norbert Pocs <norbertp@openssl.org>
|
This pull request is ready to merge |
Signed-off-by: Norbert Pocs <norbertp@openssl.org> Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org> MergeDate: Wed Apr 15 12:25:45 2026 (Merged from #30690)
|
Merged to master and 4.0. Thank you for the reviews! |
Signed-off-by: Norbert Pocs <norbertp@openssl.org> Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org> Reviewed-by: Nikola Pajkovsky <nikolap@openssl.org> MergeDate: Wed Apr 15 12:26:36 2026 (Merged from #30690)
Note: ASN1_BIT_STRING_set() is not mentioned here, because it gets deprecated in a following PR.
Checklist