digest: Use no-DB init and add new SHA digests

NEW
Unassigned

Status

NSS
Tools
P3
enhancement
16 years ago
8 years ago

People

(Reporter: Terry Hayes, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

16 years ago
Improve the digest utility by adding a -d <directory> option to be consistant 
with other tools.  In addition, make changes necessary to support the new SHA 
digests when they are implemented in NSS libraries.

(SHA changes are already partly done in NSS, which causes errors in the 
current digest utility when the command usage is displayed.  This patch 
recognizes the new digests, but will fail to generate results until NSS 
changes are complete.)
(Reporter)

Comment 1

16 years ago
Created attachment 108933 [details] [diff] [review]
Proposed patch for the digest tool
In the patch, I see this:

+    optstate = PL_CreateOptState(argc, argv, "t:i:o:d:");
     while ((status = PL_GetNextOpt(optstate)) == PL_OPT_OK) {
        switch (optstate->option) {
          case '?':
            Usage(progName);
            break;

IINM, the case '?' is dead code since '?' is not part of the options string.
AFAIK, PK_CreateOptState doesn't special-case '?', so if it's not in the 
options string, it will not be treated as an option.  


The while loop that handles options should probably be followed with the 
following code:

    if (status == PL_OPT_BAD) {
      Usage(progname);
    }
    PL_DestroyOptState(optstate)

These issues with command parsing are common to numerous NSS commands.
(Reporter)

Updated

16 years ago
Status: NEW → ASSIGNED
(Reporter)

Comment 3

16 years ago
I'm changing this request.  Rather than add a new option to specify the 
directory for database files, I'm going to use the NSS_NoDB_Init method.  This 
means that no databases are required to use this tool.

The only negative of this approach is that there is no way to add other crypto 
tokens that may be able to perform the digest functions (no secmod.db).
Assignee: wtc → thayes
Status: ASSIGNED → NEW
Summary: digest: Add -d option and new SHA digests → digest: Use no-DB init and add new SHA digests
Terry, did you produce a revised patch?
Priority: -- → P3
QA Contact: bishakhabanerjee → jason.m.reid
QA Contact: jason.m.reid → tools
Assignee: thayes0993 → nobody
OS: Windows XP → All
Hardware: x86 → All
You need to log in before you can comment on or make changes to this bug.