- (djm) Shadow expiry check fix from Pavel Troller <patrol@omni.sinus.cz>
 - (djm) Re-enable int64_t types - we need them for sftp
 - (djm) Use libexecdir from configure , rather than libexecdir/ssh
 - (djm) Update Redhat SPEC file accordingly
 - (djm) Add Kevin Steves <stevesk@sweden.hp.com> HP/UX contrib files
 - (djm) Add Charles Levert <charles@comm.polymtl.ca> getpgrp patch
 - (djm) Fix password auth on HP/UX 10.20. Patch from Dirk De Wachter
   <Dirk.DeWachter@rug.ac.be>
 - (djm) Fixprogs and entropy list fixes from Larry Jones
   <larry.jones@sdrc.com>
 - (djm) Fix for SuSE spec file from Takashi YOSHIDA
   <tyoshida@gemini.rc.kyushu-u.ac.jp>
diff --git a/auth-passwd.c b/auth-passwd.c
index 2782416..055a036 100644
--- a/auth-passwd.c
+++ b/auth-passwd.c
@@ -111,6 +111,9 @@
 #ifdef HAVE_GETPWANAM
 	struct passwd_adjunct *spw;
 #endif
+# ifdef HAVE_HPUX_TRUSTED_SYSTEM_PW
+	struct pr_passwd *prpw;
+#endif
 #ifdef WITH_AIXAUTHENTICATE
 	char *authmsg;
 	char *loginmsg;
@@ -167,11 +170,16 @@
 	}
 #endif
 
-	/* Check for users with no password. */
-	if (strcmp(password, "") == 0 && strcmp(pw->pw_passwd, "") == 0)
-		return 1;
-
+# ifdef HAVE_HPUX_TRUSTED_SYSTEM_PW
+	prpw = getprpwnam(pw->pw_name);
+	pw_password = prpw->ufld.fd_encrypt;
+#else
 	pw_password = pw->pw_passwd;
+#endif
+
+	/* Check for users with no password. */
+	if (strcmp(password, "") == 0 && strcmp(pw_password, "") == 0)
+		return 1;
 
 #if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
 	spw = getspnam(pw->pw_name);