Open Bug 184728 Opened 22 years ago Updated 2 years ago

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

Categories

(NSS :: Tools, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: thayes0993, Unassigned)

Details

Attachments

(1 file)

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.)
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.
Status: NEW → ASSIGNED
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
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: