summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2020-01-09 14:58:15 +0100
committerAlbert Astals Cid <aacid@kde.org>2020-01-09 14:59:55 +0100
commit12a657c5f787605602bb2ad9d79ef719bbf7678f (patch)
tree264e81fa25db366190bad417f24d12d150c5ecda
parentff404bdfcb5763ae5e219e075ca08b41c220f8ec (diff)
Remove getAuthData function that did "nothing"
-rw-r--r--poppler/SecurityHandler.cc19
-rw-r--r--poppler/SecurityHandler.h6
2 files changed, 2 insertions, 23 deletions
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@kde.org>
+// Copyright (C) 2010, 2012, 2015, 2017, 2018, 2020 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2014 Fabio D'Urso <fabiodurso@hotmail.it>
// Copyright (C) 2016 Alok Anand <alok4nand@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; }