Blame SOURCES/enforce-smartcard-at-unlock.patch

0999a2
From d2c12a372ea0ccbe6ba682c553d8b83b3253169f Mon Sep 17 00:00:00 2001
0999a2
From: Ray Strode <rstrode@redhat.com>
0999a2
Date: Mon, 28 Sep 2015 10:57:02 -0400
0999a2
Subject: [PATCH 1/3] smartcardManager: add way to detect if user logged using
0999a2
 (any) token
0999a2
0999a2
If a user uses a token at login time, we need to make sure they continue
0999a2
to use the token at unlock time.
0999a2
0999a2
As a prerequisite for addressing that problem we need to know up front
0999a2
if a user logged in with a token at all.
0999a2
0999a2
This commit adds the necessary api to detect that case.
0999a2
---
0999a2
 js/misc/smartcardManager.js | 7 +++++++
0999a2
 1 file changed, 7 insertions(+)
0999a2
0999a2
diff --git a/js/misc/smartcardManager.js b/js/misc/smartcardManager.js
0999a2
index d9b6ff474..26f9f5aaa 100644
0999a2
--- a/js/misc/smartcardManager.js
0999a2
+++ b/js/misc/smartcardManager.js
0999a2
@@ -111,5 +111,12 @@ var SmartcardManager = class {
0999a2
 
0999a2
         return true;
0999a2
     }
0999a2
+
0999a2
+    loggedInWithToken() {
0999a2
+        if (this._loginToken)
0999a2
+            return true;
0999a2
+
0999a2
+        return false;
0999a2
+    }
0999a2
 };
0999a2
 Signals.addSignalMethods(SmartcardManager.prototype);
0999a2
-- 
0999a2
2.31.1
0999a2
0999a2
0999a2
From 98393eef884edc9e685b712c71356751acdd552f Mon Sep 17 00:00:00 2001
0999a2
From: Ray Strode <rstrode@redhat.com>
0999a2
Date: Mon, 28 Sep 2015 19:56:53 -0400
0999a2
Subject: [PATCH 2/3] gdm: only unlock with smartcard, if smartcard used for
0999a2
 login
0999a2
0999a2
If a smartcard is used for login, we need to make sure the smartcard
0999a2
gets used for unlock, too.
0999a2
---
0999a2
 js/gdm/util.js | 7 +++++--
0999a2
 1 file changed, 5 insertions(+), 2 deletions(-)
0999a2
0999a2
diff --git a/js/gdm/util.js b/js/gdm/util.js
0999a2
index 72561daab..6b92e3564 100644
0999a2
--- a/js/gdm/util.js
0999a2
+++ b/js/gdm/util.js
0999a2
@@ -149,7 +149,6 @@ var ShellUserVerifier = class {
0999a2
         this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
0999a2
         this._settings.connect('changed',
0999a2
                                this._updateDefaultService.bind(this));
0999a2
-        this._updateDefaultService();
0999a2
 
0999a2
         this._fprintManager = new FprintManagerProxy(Gio.DBus.system,
0999a2
             'net.reactivated.Fprint',
0999a2
@@ -166,6 +165,8 @@ var ShellUserVerifier = class {
0999a2
         this.smartcardDetected = false;
0999a2
         this._checkForSmartcard();
0999a2
 
0999a2
+        this._updateDefaultService();
0999a2
+
0999a2
         this._smartcardInsertedId = this._smartcardManager.connect('smartcard-inserted',
0999a2
                                                                    this._checkForSmartcard.bind(this));
0999a2
         this._smartcardRemovedId = this._smartcardManager.connect('smartcard-removed',
0999a2
@@ -527,7 +528,9 @@ var ShellUserVerifier = class {
0999a2
     }
0999a2
 
0999a2
     _updateDefaultService() {
0999a2
-        if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
0999a2
+        if (this._smartcardManager.loggedInWithToken())
0999a2
+            this._defaultService = SMARTCARD_SERVICE_NAME;
0999a2
+        else if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
0999a2
             this._defaultService = PASSWORD_SERVICE_NAME;
0999a2
         else if (this._settings.get_boolean(SMARTCARD_AUTHENTICATION_KEY))
0999a2
             this._defaultService = SMARTCARD_SERVICE_NAME;
0999a2
-- 
0999a2
2.31.1
0999a2
0999a2
0999a2
From 57ca969a0af6f65e71dc1158163b9c826bdb7079 Mon Sep 17 00:00:00 2001
0999a2
From: Ray Strode <rstrode@redhat.com>
0999a2
Date: Mon, 28 Sep 2015 19:57:36 -0400
0999a2
Subject: [PATCH 3/3] gdm: update default service when smartcard inserted
0999a2
0999a2
Early on at start up we may not know if a smartcard is
0999a2
available.  Make sure we reupdate the default service
0999a2
after we get a smartcard insertion event.
0999a2
---
0999a2
 js/gdm/util.js | 2 ++
0999a2
 1 file changed, 2 insertions(+)
0999a2
0999a2
diff --git a/js/gdm/util.js b/js/gdm/util.js
0999a2
index 6b92e3564..e62114cb1 100644
0999a2
--- a/js/gdm/util.js
0999a2
+++ b/js/gdm/util.js
0999a2
@@ -420,6 +420,8 @@ var ShellUserVerifier = class {
0999a2
             else if (this._preemptingService == SMARTCARD_SERVICE_NAME)
0999a2
                 this._preemptingService = null;
0999a2
 
0999a2
+            this._updateDefaultService();
0999a2
+
0999a2
             this.emit('smartcard-status-changed');
0999a2
         }
0999a2
     }
0999a2
-- 
0999a2
2.31.1
0999a2