Closed Bug 1369871 Opened 4 years ago Closed 4 years ago

CreateEncodedBasicConstraints' long* arg should be const

Categories

(Core :: Security: PSM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: dholbert, Assigned: dholbert)

References

Details

Attachments

(1 file)

CreateEncodedBasicConstraints has an optional numerical arg which is represented as type "long*".

To make it clearer it's an input parameter (not an outparam), and to allow clients to pass in pointers to const values, we should change that arg to have type "const long*".
Comment on attachment 8873996 [details]
Bug 1369871: Add "const" keyword to a long* param in a pkix test function.

https://reviewboard.mozilla.org/r/145444/#review149378

::: security/pkix/test/lib/pkixtestutil.h:367
(Diff revision 1)
>  ByteString CreateEncodedSerialNumber(long value);
>  
>  enum class Critical { No = 0, Yes = 1 };
>  
>  ByteString CreateEncodedBasicConstraints(bool isCA,
> -                                         /*optional*/ long* pathLenConstraint,
> +                                         /*optional*/ const long* pathLenConstraint,

We've generally annotated these as /*optional in*/, but not a big deal.
Attachment #8873996 - Flags: review?(dkeeler) → review+
Comment on attachment 8873996 [details]
Bug 1369871: Add "const" keyword to a long* param in a pkix test function.

https://reviewboard.mozilla.org/r/145444/#review149378

> We've generally annotated these as /*optional in*/, but not a big deal.

OK, fixed. Thanks for the review!
Pushed by dholbert@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3226b56675ff
Add "const" keyword to a long* param in a pkix test function. r=keeler
https://hg.mozilla.org/mozilla-central/rev/3226b56675ff
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.