Skip to content

Commit

Permalink
https://github.com/the-djmaze/snappymail/issues/1450#issuecomment-197…
Browse files Browse the repository at this point in the history
…2147950
  • Loading branch information
the-djmaze committed Mar 1, 2024
1 parent d84f39b commit 2efe90f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions dev/Model/Identity.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export class IdentityModel extends AbstractModel {
});

addComputablesTo(this, {
smimeKeyEncrypted: () => this.smimeKey().includes('-----BEGIN ENCRYPTED PRIVATE KEY-----')
// smimeKeyValid: () => this.smimeKeyEncrypted() | this.smimeKey().includes('-----BEGIN PRIVATE KEY-----')
// smimeCertificateValid: () => this.smimeKey().includes('-----BEGIN CERTIFICATE-----')
smimeKeyEncrypted: () => this.smimeKey().includes('-----BEGIN ENCRYPTED PRIVATE KEY-----'),
smimeKeyValid: () => /^-----BEGIN (ENCRYPTED )?PRIVATE KEY-----/.test(this.smimeKey()),
smimeCertificateValid: () => /^-----BEGIN CERTIFICATE-----/.test(this.smimeCertificate())
});
}

Expand Down
2 changes: 1 addition & 1 deletion dev/View/Popup/Compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,7 @@ export class ComposePopupView extends AbstractViewPopup {
key && options.push(['OpenPGP', key]);
key = GnuPGUserStore.getPrivateKeyFor(email, 1);
key && options.push(['GnuPG', key]);
identity.smimeKey() && identity.smimeCertificate() && identity.email() === email
identity.smimeKeyValid() && identity.smimeCertificateValid() && identity.email() === email
&& options.push(['S/MIME']);
console.dir({signOptions: options});
this.signOptions(options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ <h3 data-bind="visible: edit" data-i18n="POPUPS_IDENTITY/TITLE_UPDATE_IDENTITY">
-->
<details>
<summary><strong>S/MIME</strong></summary>
<div class="control-group">
<div class="control-group" data-bind="css: {'error': smimeKey() && !smimeKeyValid()}">
<label data-i18n="CRYPTO/PRIVATE_KEY"></label>
<textarea name="smimeKey" class="input-xxlarge" rows="14" autofocus="" autocomplete="off" data-bind="value: smimeKey"></textarea>
</div>
<div class="control-group">
<div class="control-group" data-bind="css: {'error': smimeCertificate() && !smimeCertificateValid()}">
<label data-i18n="SMIME/CERTIFICATE"></label>
<textarea name="smimeCertificate" class="input-xxlarge" rows="14" autofocus="" autocomplete="off" data-bind="value: smimeCertificate"></textarea>
</div>
Expand Down

0 comments on commit 2efe90f

Please sign in to comment.