Hello community,

here is the log from the commit of package google-guest-oslogin for 
openSUSE:Factory checked in at 2020-08-29 20:32:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/google-guest-oslogin (Old)
 and      /work/SRC/openSUSE:Factory/.google-guest-oslogin.new.3399 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "google-guest-oslogin"

Sat Aug 29 20:32:50 2020 rev:2 rq:829588 version:20200819.00

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/google-guest-oslogin/google-guest-oslogin.changes    
    2020-08-17 14:39:31.126560868 +0200
+++ 
/work/SRC/openSUSE:Factory/.google-guest-oslogin.new.3399/google-guest-oslogin.changes
      2020-08-29 20:33:07.149232115 +0200
@@ -1,0 +2,10 @@
+Tue Aug 25 15:27:35 UTC 2020 - John Paul Adrian Glaubitz 
<[email protected]>
+
+- Update to version 20200819.00 (bsc#1175740, bsc#1175741)
+  * deny non-2fa users (#37)
+  * use asterisks instead (#39)
+  * set passwords to ! (#38)
+  * correct index 0 bug (#36)
+  * Support security key generated OTP challenges. (#35)
+
+-------------------------------------------------------------------

Old:
----
  google-guest-oslogin-20200507.00.tar.gz

New:
----
  google-guest-oslogin-20200819.00.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ google-guest-oslogin.spec ++++++
--- /var/tmp/diff_new_pack.9JhTeK/_old  2020-08-29 20:33:09.245232997 +0200
+++ /var/tmp/diff_new_pack.9JhTeK/_new  2020-08-29 20:33:09.249233000 +0200
@@ -15,16 +15,17 @@
 # Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 Name:           google-guest-oslogin
-Version:        20200507.00
+Version:        20200819.00
 Release:        0
 Summary:        Google Cloud Guest OS Login
 License:        Apache-2.0
 Group:          System/Daemons
 URL:            https://github.com/GoogleCloudPlatform/guest-oslogin
 Source0:        %{name}-%{version}.tar.gz
-Requires:       pam
 Requires:       openssh
+Requires:       pam
 Requires(post): glibc
 %if 0%{?suse_version} && 0%{?suse_version} <= 1315
 BuildRequires:  boost-devel

++++++ google-guest-oslogin-20200507.00.tar.gz -> 
google-guest-oslogin-20200819.00.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-oslogin-20200507.00/src/cache_refresh/cache_refresh.cc 
new/guest-oslogin-20200819.00/src/cache_refresh/cache_refresh.cc
--- old/guest-oslogin-20200507.00/src/cache_refresh/cache_refresh.cc    
2020-05-07 22:16:09.000000000 +0200
+++ new/guest-oslogin-20200819.00/src/cache_refresh/cache_refresh.cc    
2020-08-19 23:33:58.000000000 +0200
@@ -19,6 +19,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <syslog.h>
+#include <string.h>
 #include <unistd.h>
 #include <sstream>
 
@@ -80,6 +81,9 @@
       }
       continue;
     }
+    if (strlen(pwd.pw_passwd) == 0) {
+      pwd.pw_passwd = (char *)"*";
+    }
     cache_file << pwd.pw_name << ":" << pwd.pw_passwd << ":" << pwd.pw_uid
                << ":" << pwd.pw_gid << ":" << pwd.pw_gecos << ":" << pwd.pw_dir
                << ":" << pwd.pw_shell << "\n";
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/guest-oslogin-20200507.00/src/include/compat.h 
new/guest-oslogin-20200819.00/src/include/compat.h
--- old/guest-oslogin-20200507.00/src/include/compat.h  2020-05-07 
22:16:09.000000000 +0200
+++ new/guest-oslogin-20200819.00/src/include/compat.h  2020-08-19 
23:33:58.000000000 +0200
@@ -49,6 +49,7 @@
 
 #define PAM_SYSLOG(pamh, ...) syslog(__VA_ARGS__)
 #define DEFAULT_SHELL "/bin/sh"
+#define DEFAULT_PASSWD "*"
 
 #else /* __FreeBSD__ */
 
@@ -65,6 +66,7 @@
 
 #define PAM_SYSLOG pam_syslog
 #define DEFAULT_SHELL "/bin/bash"
+#define DEFAULT_PASSWD "*"
 
 #define DECLARE_NSS_METHOD_TABLE(name, ...)
 #define NSS_METHOD_PROTOTYPE(m)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-oslogin-20200507.00/src/include/oslogin_utils.h 
new/guest-oslogin-20200819.00/src/include/oslogin_utils.h
--- old/guest-oslogin-20200507.00/src/include/oslogin_utils.h   2020-05-07 
22:16:09.000000000 +0200
+++ new/guest-oslogin-20200819.00/src/include/oslogin_utils.h   2020-08-19 
23:33:58.000000000 +0200
@@ -25,6 +25,7 @@
 #define AUTHZEN "AUTHZEN"
 #define INTERNAL_TWO_FACTOR "INTERNAL_TWO_FACTOR"
 #define IDV_PREREGISTERED_PHONE "IDV_PREREGISTERED_PHONE"
+#define SECURITY_KEY_OTP "SECURITY_KEY_OTP"
 
 #define INITGROUP_CACHE_EXPIRE_SECONDS 500
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/guest-oslogin-20200507.00/src/oslogin_utils.cc 
new/guest-oslogin-20200819.00/src/oslogin_utils.cc
--- old/guest-oslogin-20200507.00/src/oslogin_utils.cc  2020-05-07 
22:16:09.000000000 +0200
+++ new/guest-oslogin-20200819.00/src/oslogin_utils.cc  2020-08-19 
23:33:58.000000000 +0200
@@ -373,15 +373,16 @@
       return false;
     }
   }
+  if (strlen(result->pw_passwd) == 0) {
+    if (!buf->AppendString(DEFAULT_PASSWD, &result->pw_passwd, errnop)) {
+      return false;
+    }
+  }
 
-  // OS Login does not utilize the passwd field and reserves the gecos field.
-  // Set these to be empty.
+  // OS Login reserves the GECOS field.
   if (!buf->AppendString("", &result->pw_gecos, errnop)) {
     return false;
   }
-  if (!buf->AppendString("", &result->pw_passwd, errnop)) {
-    return false;
-  }
   return true;
 }
 
@@ -572,6 +573,7 @@
   result->pw_shell = (char*)"";
   result->pw_name = (char*)"";
   result->pw_dir = (char*)"";
+  result->pw_passwd = (char*)"";
 
   // Iterate through the json response and populate the passwd struct.
   if (json_object_get_type(posix_accounts) != json_type_object) {
@@ -921,6 +923,7 @@
 
   jarr = json_object_new_array();
   json_object_array_add(jarr, json_object_new_string(INTERNAL_TWO_FACTOR));
+  json_object_array_add(jarr, json_object_new_string(SECURITY_KEY_OTP));
   json_object_array_add(jarr, json_object_new_string(AUTHZEN));
   json_object_array_add(jarr, json_object_new_string(TOTP));
   json_object_array_add(jarr, json_object_new_string(IDV_PREREGISTERED_PHONE));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/guest-oslogin-20200507.00/src/pam/pam_oslogin_login.cc 
new/guest-oslogin-20200819.00/src/pam/pam_oslogin_login.cc
--- old/guest-oslogin-20200507.00/src/pam/pam_oslogin_login.cc  2020-05-07 
22:16:09.000000000 +0200
+++ new/guest-oslogin-20200819.00/src/pam/pam_oslogin_login.cc  2020-08-19 
23:33:58.000000000 +0200
@@ -1,4 +1,4 @@
-// Copyright 2017 Google Inc. All Rights Reserved.
+// Copyright 2020 Google Inc. All Rights Reserved.
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -167,7 +167,7 @@
   }
 
   if (status == "NO_AVAILABLE_CHALLENGES") {
-    return PAM_SUCCESS; // User is not two-factor enabled.
+    return PAM_PERM_DENIED; // User is not two-factor enabled, deny login.
   }
 
   std::string session_id;
@@ -188,6 +188,7 @@
   user_prompts[INTERNAL_TWO_FACTOR] = "Security code from security key";
   user_prompts[IDV_PREREGISTERED_PHONE] =
       "Voice or text message verification code";
+  user_prompts[SECURITY_KEY_OTP] = "Security code from a security key";
 
   oslogin_utils::Challenge challenge;
   if (challenges.size() > 1) {
@@ -202,14 +203,17 @@
     if (pam_prompt(pamh, PAM_PROMPT_ECHO_ON, &choice, "%s",
                    prompt.str().c_str()) != PAM_SUCCESS) {
       pam_error(pamh, "Unable to get user input");
+      return PAM_PERM_DENIED;
     }
 
     int choicei;
-    if (sscanf(choice, "%d", &choicei) == EOF) {
-      pam_error(pamh, "Unable to get user input");
+    if (sscanf(choice, "%d", &choicei) != 1) {
+      pam_error(pamh, "Error parsing user input");
+      return PAM_PERM_DENIED;
     }
-    if (size_t(choicei) > challenges.size()) {
+    if (size_t(choicei) > challenges.size() || choicei <= 0) {
       pam_error(pamh, "Invalid option");
+      return PAM_PERM_DENIED;
     }
     challenge = challenges[choicei - 1];
   } else {
@@ -231,23 +235,33 @@
     if (pam_prompt(pamh, PAM_PROMPT_ECHO_ON, &user_token,
                    "Enter your security code: ") != PAM_SUCCESS) {
       pam_error(pamh, "Unable to get user input");
+      return PAM_PERM_DENIED;
+    }
+  } else if (challenge.type == SECURITY_KEY_OTP) {
+    if (pam_prompt(pamh, PAM_PROMPT_ECHO_ON, &user_token,
+                   "Enter your security code by visiting g.co/sc: ") != 
PAM_SUCCESS) {
+      pam_error(pamh, "Unable to get user input");
+      return PAM_PERM_DENIED;
     }
   } else if (challenge.type == TOTP) {
     if (pam_prompt(pamh, PAM_PROMPT_ECHO_ON, &user_token,
                    "Enter your one-time password: ") != PAM_SUCCESS) {
       pam_error(pamh, "Unable to get user input");
+      return PAM_PERM_DENIED;
     }
   } else if (challenge.type == AUTHZEN) {
     if (pam_prompt(pamh, PAM_PROMPT_ECHO_ON, &user_token,
                    "A login prompt has been sent to your enrolled device. "
                    "Press enter to continue") != PAM_SUCCESS) {
       pam_error(pamh, "Unable to get user input");
+      return PAM_PERM_DENIED;
     }
   } else if (challenge.type == IDV_PREREGISTERED_PHONE) {
     if (pam_prompt(pamh, PAM_PROMPT_ECHO_ON, &user_token,
                    "A security code has been sent to your phone. "
                    "Enter code to continue: ") != PAM_SUCCESS) {
       pam_error(pamh, "Unable to get user input");
+      return PAM_PERM_DENIED;
     }
   } else {
     PAM_SYSLOG(pamh, LOG_ERR, "Unsupported challenge type %s",


Reply via email to