Closed Bug 1393143 Opened 2 years ago Closed 2 years ago

remove some unused PKCS#11 interface methods and attributes

Categories

(Core :: Security: PSM, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: keeler, Assigned: keeler)

Details

(Whiteboard: [psm-assigned])

Attachments

(1 file)

Some of the PKCS#11 interfaces expose functionality we don't actually use, including:

nsIPK11TokenDB:
  listTokens()

nsIPKCS11ModuleDB:
  getInternal()
  getInternalFIPS()
  findSlotByName()

nsIPK11Token:
  minimumPasswordLength
  isHardwareToken()

nsIPK11Token has a few that only SeaMonkey uses:
  getAskPasswordTimes()
  getAskPasswordTimeout()
  setAskPasswordDefaults()

It's not crucial that these all be removed, but it will make some upcoming refactoring easier. I'm going to file a bug that the feature using them be removed from SeaMonkey (or at least reimplemented in SeaMonkey-specific code).
Comment on attachment 8900421 [details]
bug 1393143 - remove a few unused attributes and methods on PKCS#11 interfaces

https://reviewboard.mozilla.org/r/171766/#review177502

\o/

::: security/manager/ssl/nsPK11TokenDB.cpp
(Diff revision 1)
> -
> -  nsNSSShutDownPreventionLock locker;
> -  if (isAlreadyShutDown())
> -    return NS_ERROR_NOT_AVAILABLE;
> -
> -  *aMinimumPasswordLength = PK11_GetMinimumPwdLength(mSlot.get());

Hmm, DXR suggests not even NSS itself uses this function now, so we should try removing this from nss.symbols as well.
(Ignore if the expectation is SeaMonkey will likely try to move this code over to c-c.)

::: security/manager/ssl/nsPK11TokenDB.cpp
(Diff revision 1)
> -  nsNSSShutDownPreventionLock locker;
> -  if (isAlreadyShutDown())
> -    return NS_ERROR_NOT_AVAILABLE;
> -
> -  int askTimeout;
> -  PK11_GetSlotPWValues(mSlot.get(), askTimes, &askTimeout);

Similar nss.symbols comment.

::: security/manager/ssl/nsPK11TokenDB.cpp
(Diff revision 1)
> -{
> -  nsNSSShutDownPreventionLock locker;
> -  if (isAlreadyShutDown())
> -    return NS_ERROR_NOT_AVAILABLE;
> -
> -  PK11_SetSlotPWValues(mSlot.get(), askTimes, askTimeout);

Similar nss.symbols comment.
Attachment #8900421 - Flags: review?(cykesiopka.bmo) → review+
Pushed by dkeeler@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/73af09f7cb84
remove a few unused attributes and methods on PKCS#11 interfaces r=Cykesiopka
https://hg.mozilla.org/mozilla-central/rev/73af09f7cb84
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.