I've been looking in NSS docs and ML archives for a solution to the
following problem, with no luck. Asking around on IRC, I was pointed to
this ML. Hopefully it's the appropriate forum.

I'm trying to migrate existing NSS DBs from the old Berkeley DB format
to the new, SQLite-based format that can be shared by multiple
applications, using a snipped of C code from your migration guide. The
relevant code looks like this (abbreviated for clarity):

  /* STEP 1: Signal that update/merge may be needed  */

  rv = NSS_InitWithMerge ("sql:/home/user/new_db",
                          "", "", "secmod.db",
                          "/home/user/old_db", "", "",
                          "myapp", "myapp",

  if (rv == SECFailure)
    /* Fallback code */
    return rv;

  slot = PK11_GetInternalKeySlot ();

  /* Step 2: Determine if update/merge is needed. */

  if (PK11_IsRemovable (slot))
    /* need to update/Merge the database */

    /* Step 3: Authenticate to the token */

    rv = PK11_Authenticate (slot, PR_FALSE, &pwdata);
    if (rv != SECSuccess)
      fprintf (stderr, "*** Auth call failed: %u.\n", PORT_GetError ());
      return rv;

This works for some databases, but not others. It doesn't seem to matter
which application created the database (I've tried with databases from
Firefox and Evolution) - e.g. one user's database may fail while another
user's database may migrate properly. When it fails, it's always on the
first PK11_Authenticate () call (step 3). The code above produces the
following output:

*** Auth call failed: 4294959104.

That is, 0xffffe000. If I set up an auth callback, it never gets called.
Do you have any suggestions as to what I'm doing wrong here?

Hans Petter Jansson <[EMAIL PROTECTED]>

dev-tech-crypto mailing list

Reply via email to