|
|
671c89 |
From 8ce91c85fe052d1a9f4fed0743bceae7d9654aa0 Mon Sep 17 00:00:00 2001
|
|
|
671c89 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
671c89 |
Date: Mon, 28 Sep 2015 10:57:02 -0400
|
|
|
671c89 |
Subject: [PATCH 1/3] smartcardManager: add way to detect if user logged using
|
|
|
671c89 |
(any) token
|
|
|
671c89 |
|
|
|
671c89 |
If a user uses a token at login time, we need to make sure they continue
|
|
|
671c89 |
to use the token at unlock time.
|
|
|
671c89 |
|
|
|
671c89 |
As a prerequisite for addressing that problem we need to know up front
|
|
|
671c89 |
if a user logged in with a token at all.
|
|
|
671c89 |
|
|
|
671c89 |
This commit adds the necessary api to detect that case.
|
|
|
671c89 |
---
|
|
|
671c89 |
js/misc/smartcardManager.js | 7 +++++++
|
|
|
671c89 |
1 file changed, 7 insertions(+)
|
|
|
671c89 |
|
|
|
671c89 |
diff --git a/js/misc/smartcardManager.js b/js/misc/smartcardManager.js
|
|
|
671c89 |
index fda782d1e..bb43c96e7 100644
|
|
|
671c89 |
--- a/js/misc/smartcardManager.js
|
|
|
671c89 |
+++ b/js/misc/smartcardManager.js
|
|
|
671c89 |
@@ -112,5 +112,12 @@ var SmartcardManager = class {
|
|
|
671c89 |
return true;
|
|
|
671c89 |
}
|
|
|
671c89 |
|
|
|
671c89 |
+ loggedInWithToken() {
|
|
|
671c89 |
+ if (this._loginToken)
|
|
|
671c89 |
+ return true;
|
|
|
671c89 |
+
|
|
|
671c89 |
+ return false;
|
|
|
671c89 |
+ }
|
|
|
671c89 |
+
|
|
|
671c89 |
};
|
|
|
671c89 |
Signals.addSignalMethods(SmartcardManager.prototype);
|
|
|
671c89 |
--
|
|
|
671c89 |
2.21.0
|
|
|
671c89 |
|
|
|
671c89 |
|
|
|
671c89 |
From 6decf5560d309579760e10048533d3bd9bc56c3c Mon Sep 17 00:00:00 2001
|
|
|
671c89 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
671c89 |
Date: Mon, 28 Sep 2015 19:56:53 -0400
|
|
|
671c89 |
Subject: [PATCH 2/3] gdm: only unlock with smartcard, if smartcard used for
|
|
|
671c89 |
login
|
|
|
671c89 |
|
|
|
671c89 |
If a smartcard is used for login, we need to make sure the smartcard
|
|
|
671c89 |
gets used for unlock, too.
|
|
|
671c89 |
---
|
|
|
671c89 |
js/gdm/util.js | 7 +++++--
|
|
|
671c89 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
|
671c89 |
|
|
|
671c89 |
diff --git a/js/gdm/util.js b/js/gdm/util.js
|
|
|
671c89 |
index 2e9935250..2b80e1dd9 100644
|
|
|
671c89 |
--- a/js/gdm/util.js
|
|
|
671c89 |
+++ b/js/gdm/util.js
|
|
|
671c89 |
@@ -126,7 +126,6 @@ var ShellUserVerifier = class {
|
|
|
671c89 |
this._settings = new Gio.Settings({ schema_id: LOGIN_SCREEN_SCHEMA });
|
|
|
671c89 |
this._settings.connect('changed',
|
|
|
671c89 |
this._updateDefaultService.bind(this));
|
|
|
671c89 |
- this._updateDefaultService();
|
|
|
671c89 |
|
|
|
671c89 |
this._fprintManager = Fprint.FprintManager();
|
|
|
671c89 |
this._smartcardManager = SmartcardManager.getSmartcardManager();
|
|
|
671c89 |
@@ -138,6 +137,8 @@ var ShellUserVerifier = class {
|
|
|
671c89 |
this.smartcardDetected = false;
|
|
|
671c89 |
this._checkForSmartcard();
|
|
|
671c89 |
|
|
|
671c89 |
+ this._updateDefaultService();
|
|
|
671c89 |
+
|
|
|
671c89 |
this._smartcardInsertedId = this._smartcardManager.connect('smartcard-inserted',
|
|
|
671c89 |
this._checkForSmartcard.bind(this));
|
|
|
671c89 |
this._smartcardRemovedId = this._smartcardManager.connect('smartcard-removed',
|
|
|
671c89 |
@@ -407,7 +408,9 @@ var ShellUserVerifier = class {
|
|
|
671c89 |
}
|
|
|
671c89 |
|
|
|
671c89 |
_updateDefaultService() {
|
|
|
671c89 |
- if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
|
|
|
671c89 |
+ if (this._smartcardManager.loggedInWithToken())
|
|
|
671c89 |
+ this._defaultService = SMARTCARD_SERVICE_NAME;
|
|
|
671c89 |
+ else if (this._settings.get_boolean(PASSWORD_AUTHENTICATION_KEY))
|
|
|
671c89 |
this._defaultService = PASSWORD_SERVICE_NAME;
|
|
|
671c89 |
else if (this._settings.get_boolean(SMARTCARD_AUTHENTICATION_KEY))
|
|
|
671c89 |
this._defaultService = SMARTCARD_SERVICE_NAME;
|
|
|
671c89 |
--
|
|
|
671c89 |
2.21.0
|
|
|
671c89 |
|
|
|
671c89 |
|
|
|
671c89 |
From dd844c98c3450dd1b21bcc580b51162c1b00ed2a Mon Sep 17 00:00:00 2001
|
|
|
671c89 |
From: Ray Strode <rstrode@redhat.com>
|
|
|
671c89 |
Date: Mon, 28 Sep 2015 19:57:36 -0400
|
|
|
671c89 |
Subject: [PATCH 3/3] gdm: update default service when smartcard inserted
|
|
|
671c89 |
|
|
|
671c89 |
Early on at start up we may not know if a smartcard is
|
|
|
671c89 |
available. Make sure we reupdate the default service
|
|
|
671c89 |
after we get a smartcard insertion event.
|
|
|
671c89 |
---
|
|
|
671c89 |
js/gdm/util.js | 2 ++
|
|
|
671c89 |
1 file changed, 2 insertions(+)
|
|
|
671c89 |
|
|
|
671c89 |
diff --git a/js/gdm/util.js b/js/gdm/util.js
|
|
|
671c89 |
index 2b80e1dd9..6e940d2ab 100644
|
|
|
671c89 |
--- a/js/gdm/util.js
|
|
|
671c89 |
+++ b/js/gdm/util.js
|
|
|
671c89 |
@@ -327,6 +327,8 @@ var ShellUserVerifier = class {
|
|
|
671c89 |
else if (this._preemptingService == SMARTCARD_SERVICE_NAME)
|
|
|
671c89 |
this._preemptingService = null;
|
|
|
671c89 |
|
|
|
671c89 |
+ this._updateDefaultService();
|
|
|
671c89 |
+
|
|
|
671c89 |
this.emit('smartcard-status-changed');
|
|
|
671c89 |
}
|
|
|
671c89 |
}
|
|
|
671c89 |
--
|
|
|
671c89 |
2.21.0
|
|
|
671c89 |
|