Compare commits

..

No commits in common. "8791b2474227774cf951e2880daccbf2ba25a77e" and "38cb01c629fb6d87dd324f23bbf286edda6cc646" have entirely different histories.

7 changed files with 28 additions and 36 deletions

View File

@ -25,5 +25,3 @@ CO01:
exclusions:
files: []
messages: []
VC:
disabled: false

View File

@ -365,18 +365,10 @@ pdfjs-editor-stamp-add-image-button-label = Add image
pdfjs-editor-free-highlight-thickness-input = Thickness
pdfjs-editor-free-highlight-thickness-title =
.title = Change thickness when highlighting items other than text
pdfjs-editor-add-signature-container =
.aria-label = Signature controls and saved signatures
pdfjs-editor-signature-add-signature-button =
.title = Add new signature
pdfjs-editor-signature-add-signature-button-label = Add new signature
# Used on the button to use an already saved signature.
# Variables:
# $description (String) - a string describing/labeling the signature.
pdfjs-editor-add-saved-signature-button =
.title = Saved signature: { $description }
# .default-content is used as a placeholder in an empty text editor.
pdfjs-free-text2 =
.aria-label = Text Editor
@ -611,9 +603,9 @@ pdfjs-editor-add-signature-add-button = Add
## Main menu for adding/removing signatures
pdfjs-editor-delete-signature-button1 =
.title = Remove saved signature
pdfjs-editor-delete-signature-button-label1 = Remove saved signature
pdfjs-editor-delete-signature-button =
.title = Remove signature
pdfjs-editor-delete-signature-button-label = Remove signature
## Editor toolbar

View File

@ -916,15 +916,23 @@ class CipherTransformFactory {
cipher = new ARCFourCipher(derivedKey);
checkData = cipher.encryptBlock(checkData);
}
for (j = 0, n = checkData.length; j < n; ++j) {
if (userPassword[j] !== checkData[j]) {
return null;
}
}
} else {
cipher = new ARCFourCipher(encryptionKey);
checkData = cipher.encryptBlock(
CipherTransformFactory._defaultPasswordBytes
);
for (j = 0, n = checkData.length; j < n; ++j) {
if (userPassword[j] !== checkData[j]) {
return null;
}
}
}
return checkData.every((data, k) => userPassword[k] === data)
? encryptionKey
: null;
return encryptionKey;
}
#decodeUserPassword(password, ownerPassword, revision, keyLength) {
@ -1125,13 +1133,12 @@ class CipherTransformFactory {
perms
);
}
if (!encryptionKey) {
if (!password) {
throw new PasswordException(
"No password given",
PasswordResponses.NEED_PASSWORD
);
}
if (!encryptionKey && !password) {
throw new PasswordException(
"No password given",
PasswordResponses.NEED_PASSWORD
);
} else if (!encryptionKey && password) {
// Attempting use the password as an owner password
const decodedPassword = this.#decodeUserPassword(
passwordBytes,

View File

@ -992,7 +992,7 @@
"password": "ELXRTQWS",
"md5": "db2fedbd36d6fa27d4e52f9bd2d96b8c",
"rounds": 1,
"type": "eq"
"type": "load"
},
{
"id": "issue5334",
@ -5961,7 +5961,7 @@
"md5": "b58adce5dbb08936ddb0d904f0da8716",
"rounds": 1,
"link": false,
"type": "eq",
"type": "load",
"password": "abc"
},
{
@ -5970,7 +5970,7 @@
"md5": "73a8091d0ab2a47af5ca45047f04da99",
"rounds": 1,
"link": false,
"type": "eq",
"type": "load",
"password": "\u00E6\u00F8\u00E5",
"about": "The password (æøå) is UTF8 encoded."
},

View File

@ -48,6 +48,7 @@
.signatureDialog {
--primary-color: var(--text-primary-color);
--description-input-color: var(--primary-color);
--border-color: #8f8f9d;
--open-link-fg: var(--link-fg-color);
--open-link-hover-fg: var(--link-hover-fg-color);

View File

@ -708,17 +708,11 @@ class SignatureManager {
button.append(svg);
const span = document.createElement("span");
span.ariaHidden = true;
button.append(span);
button.classList.add("toolbarAddSignatureButton");
button.type = "button";
span.textContent = description;
button.setAttribute(
"data-l10n-id",
"pdfjs-editor-add-saved-signature-button"
);
button.setAttribute("data-l10n-args", JSON.stringify({ description }));
button.title = span.textContent = description;
button.tabIndex = 0;
const path = svgFactory.createElement("path");
@ -735,7 +729,7 @@ class SignatureManager {
deleteButton.classList.add("toolbarButton", "deleteButton");
deleteButton.setAttribute(
"data-l10n-id",
"pdfjs-editor-delete-signature-button1"
"pdfjs-editor-delete-signature-button"
);
deleteButton.type = "button";
deleteButton.tabIndex = 0;
@ -755,7 +749,7 @@ class SignatureManager {
deleteButton.append(deleteSpan);
deleteSpan.setAttribute(
"data-l10n-id",
"pdfjs-editor-delete-signature-button-label1"
"pdfjs-editor-delete-signature-button-label"
);
this.#addSignatureToolbarButton.before(div);

View File

@ -249,7 +249,7 @@ See https://github.com/adobe-type-tools/cmap-resources
<span data-l10n-id="pdfjs-editor-signature-button-label">Add signature</span>
</button>
<div class="editorParamsToolbar hidden doorHangerRight menu" id="editorSignatureParamsToolbar">
<div id="addSignatureDoorHanger" class="menuContainer" role="region" data-l10n-id="pdfjs-editor-add-signature-container">
<div id="addSignatureDoorHanger" class="menuContainer">
<button id="editorSignatureAddSignature" class="toolbarButton labeled" type="button" title="Add new signature" tabindex="0" data-l10n-id="pdfjs-editor-signature-add-signature-button">
<span data-l10n-id="pdfjs-editor-signature-add-signature-button-label" class="editorParamsLabel">Add new signature</span>
</button>