From 2cfd6f0860b1b4f9348347be3dcc2f52c7758e1b Mon Sep 17 00:00:00 2001 From: "Peter D. Gray" Date: Wed, 8 Feb 2023 12:35:51 -0500 Subject: [PATCH] No need for card presence during removal --- docs/microsd-2fa.md | 7 ++++--- shared/pwsave.py | 9 +-------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/docs/microsd-2fa.md b/docs/microsd-2fa.md index f91f0412..a4394085 100644 --- a/docs/microsd-2fa.md +++ b/docs/microsd-2fa.md @@ -45,9 +45,10 @@ enrolled card). "Check Card" validates the card inserted and indicates if it would be accepted or not. -Use "Remove Card #N" is remove cards from the system. When the last -card is removed, the feature is disabled and no card will be required -for login. +Use "Remove Card #N" is remove cards from the approved list. When +the last card is removed, the feature is disabled and no card will +be required for login. Access to the card in question is not required +to remove it. ## During Login diff --git a/shared/pwsave.py b/shared/pwsave.py index c8d604d7..3e64441a 100644 --- a/shared/pwsave.py +++ b/shared/pwsave.py @@ -271,7 +271,7 @@ class MicroSD2FA(PassphraseSaver): async def remove(self, nonce): # remove indicated nonce from records - # - delete file if present and found, but ok if missing + # - doesn't delete file, since might not have card anymore and useless w/o nonce from glob import dis, settings v = self.get_nonces() @@ -282,13 +282,6 @@ class MicroSD2FA(PassphraseSaver): else: settings.set('sd2fa', v2) settings.save() - - try: - with CardSlot() as card: - fn = self.filename(card) - os.remove(fn) - except: - pass @classmethod def menu(cls):