Closed Bug 962762 Opened 11 years ago Closed 11 years ago

RSA_BlockType: Remove confusing comment and unnecessary values

Categories

(NSS :: Libraries, defect)

3.15.5
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: KaiE, Assigned: KaiE)

Details

Attachments

(2 files, 1 obsolete file)

Type RSA_BlockType is prefixed with a comment. A part of that comment says: * The explicit value assignments are not needed (because C would give * us those same values anyway) but are included as a reminder... This is wrong, because the enum values aren't consecutive. Value 3 is missing. I guess the comment was correct in the past, but probably something for value 3 got removed (?). I propose to remove the mentioned two lines from the comment.
Value 3 was removed as part of this commit from bug 158747: https://hg.mozilla.org/projects/nss/rev/7f5f39a8d010
Attached patch p-962762 (obsolete) — Splinter Review
Attachment #8363926 - Flags: review?(ryan.sleevi)
Comment on attachment 8363926 [details] [diff] [review] p-962762 Review of attachment 8363926 [details] [diff] [review]: ----------------------------------------------------------------- r=wtc. ::: lib/freebl/rsapkcs.c @@ +23,5 @@ > > /* > * RSA block types > * > * The actual values are important -- they are fixed, *not* arbitrary. Only the values of RSA_BlockPrivate and RSA_BlockPublic are fixed. This means, for example, RSA_BlockRaw can take the value of 3. But this comment is fine. @@ +30,5 @@ > RSA_BlockUnused = 0, /* unused */ > RSA_BlockPrivate = 1, /* pad for a private-key operation */ > RSA_BlockPublic = 2, /* pad for a public-key operation */ > RSA_BlockRaw = 4, /* simply justify the block appropriately */ > RSA_BlockTotal We should remove the RSA_BlockTotal enum constant. It is not used and doesn't really make sense when there is a missing value (3). We can also remove the RSA_BlockUnused enum constant. It is not used.
Attachment #8363926 - Flags: review+
Attached patch p2-962762Splinter Review
how about this?
Assignee: nobody → kaie
Attachment #8363926 - Attachment is obsolete: true
Attachment #8363926 - Flags: review?(ryan.sleevi)
Attachment #8363954 - Flags: review?(wtc)
r=ryan.sleevi as well
Comment on attachment 8363954 [details] [diff] [review] p2-962762 Review of attachment 8363954 [details] [diff] [review]: ----------------------------------------------------------------- r=wtc. ::: lib/freebl/rsapkcs.c @@ +32,3 @@ > RSA_BlockPrivate = 1, /* pad for a private-key operation */ > RSA_BlockPublic = 2, /* pad for a public-key operation */ > RSA_BlockRaw = 4, /* simply justify the block appropriately */ Nit: it would be a good idea to remove this comma. Some older compiler may not allow it.
Attachment #8363954 - Flags: review?(wtc) → review+
Keywords: checkin-needed
Target Milestone: --- → 3.16
Summary: RSA_BlockType: Remove confusing comment about unnecessary enum assignments → RSA_BlockType: Remove confusing comment and unnecessary values
Attached patch p3-962762Splinter Review
removing the comma as suggested
Status: NEW → RESOLVED
Closed: 11 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: