[poppler] poppler/SecurityHandler.cc poppler/SecurityHandler.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jan 9 22:42:32 UTC 2020


 poppler/SecurityHandler.cc |   19 ++-----------------
 poppler/SecurityHandler.h  |    6 ------
 2 files changed, 2 insertions(+), 23 deletions(-)

New commits:
commit 12a657c5f787605602bb2ad9d79ef719bbf7678f
Author: Albert Astals Cid <aacid at kde.org>
Date:   Thu Jan 9 14:58:15 2020 +0100

    Remove getAuthData function that did "nothing"

diff --git a/poppler/SecurityHandler.cc b/poppler/SecurityHandler.cc
index 575e5912..eea78117 100644
--- a/poppler/SecurityHandler.cc
+++ b/poppler/SecurityHandler.cc
@@ -13,7 +13,7 @@
 // All changes made under the Poppler project to this file are licensed
 // under GPL version 2 or later
 //
-// Copyright (C) 2010, 2012, 2015, 2017, 2018 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2010, 2012, 2015, 2017, 2018, 2020 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2013 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2014 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2016 Alok Anand <alok4nand at gmail.com>
@@ -65,27 +65,16 @@ SecurityHandler::~SecurityHandler() {
 bool SecurityHandler::checkEncryption(const GooString *ownerPassword,
 				       const GooString *userPassword) {
   void *authData;
-  bool ok;
-  int i;
 
   if (ownerPassword || userPassword) {
     authData = makeAuthData(ownerPassword, userPassword);
   } else {
     authData = nullptr;
   }
-  ok = authorize(authData);
+  const bool ok = authorize(authData);
   if (authData) {
     freeAuthData(authData);
   }
-  for (i = 0; !ok && i < 3; ++i) {
-    if (!(authData = getAuthData())) {
-      break;
-    }
-    ok = authorize(authData);
-    if (authData) {
-      freeAuthData(authData);
-    }
-  }
   if (!ok) {
     if (!ownerPassword && !userPassword) {
       GooString dummy;
@@ -310,10 +299,6 @@ void *StandardSecurityHandler::makeAuthData(const GooString *ownerPassword,
 			                   : nullptr);
 }
 
-void *StandardSecurityHandler::getAuthData() {
-  return nullptr;
-}
-
 void StandardSecurityHandler::freeAuthData(void *authData) {
   delete (StandardAuthData *)authData;
 }
diff --git a/poppler/SecurityHandler.h b/poppler/SecurityHandler.h
index 0c9147e6..57d5c15d 100644
--- a/poppler/SecurityHandler.h
+++ b/poppler/SecurityHandler.h
@@ -66,11 +66,6 @@ public:
   virtual void *makeAuthData(const GooString *ownerPassword,
 			     const GooString *userPassword) = 0;
 
-  // Construct authorization data, typically by prompting the user for
-  // a password.  Returns an authorization data object, or NULL to
-  // cancel.
-  virtual void *getAuthData() = 0;
-
   // Free the authorization data returned by makeAuthData or
   // getAuthData.
   virtual void freeAuthData(void *authData) = 0;
@@ -109,7 +104,6 @@ public:
   bool isUnencrypted() const override;
   void *makeAuthData(const GooString *ownerPassword,
 			     const GooString *userPassword) override;
-  void *getAuthData() override;
   void freeAuthData(void *authData) override;
   bool authorize(void *authData) override;
   int getPermissionFlags() const override { return permFlags; }


More information about the poppler mailing list