From c8779caef289e704e9023a6bcdd5866e8c2a0740 Mon Sep 17 00:00:00 2001 From: Tankred Hase Date: Wed, 22 Apr 2015 17:48:38 +0200 Subject: [PATCH] [WO-03-014] Fix Spoofing of Signed Messages and general UI Concerns (High) Added signature 'verified' and 'invalid' icons from ModernPGP spec See https://github.com/ModernPGP/icons#signatures --- src/img/icons/signature-invalid.svg | 12 ++++++++++++ src/img/icons/signature-verified.svg | 12 ++++++++++++ src/js/util/dummy.js | 4 +++- src/sass/blocks/views/_read.scss | 22 +++++++++++++++------- src/tpl/mail-list.html | 11 +++++++++-- src/tpl/read.html | 17 ++++++++++++----- 6 files changed, 63 insertions(+), 15 deletions(-) create mode 100755 src/img/icons/signature-invalid.svg create mode 100755 src/img/icons/signature-verified.svg diff --git a/src/img/icons/signature-invalid.svg b/src/img/icons/signature-invalid.svg new file mode 100755 index 0000000..61fd2ac --- /dev/null +++ b/src/img/icons/signature-invalid.svg @@ -0,0 +1,12 @@ + + + + signature-invalid-cutout + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/src/img/icons/signature-verified.svg b/src/img/icons/signature-verified.svg new file mode 100755 index 0000000..04356a9 --- /dev/null +++ b/src/img/icons/signature-verified.svg @@ -0,0 +1,12 @@ + + + + signature-verified-cutout + Created with Sketch. + + + + + + + \ No newline at end of file diff --git a/src/js/util/dummy.js b/src/js/util/dummy.js index c0ffccd..37244a0 100644 --- a/src/js/util/dummy.js +++ b/src/js/util/dummy.js @@ -122,9 +122,11 @@ Dummy.prototype.listMails = function() { '>> from 0.7.0.1\n' + '>>\n' + '>> God speed!'; // plaintext body - this.html = '

Hello there' + Math.random() + '

'; + //this.html = '

Hello there' + Math.random() + '

'; this.encrypted = true; this.decrypted = true; + this.signed = true; + this.signaturesValid = true; }; var dummies = [], diff --git a/src/sass/blocks/views/_read.scss b/src/sass/blocks/views/_read.scss index f372c29..a34384c 100644 --- a/src/sass/blocks/views/_read.scss +++ b/src/sass/blocks/views/_read.scss @@ -55,6 +55,21 @@ & > .attachments { margin-top: 1em; } + + .signature-status { + & > svg { + vertical-align: middle; + width: 1.5em; + height: 1.5em; + margin-bottom: .2em; + fill: $color-main; + } + } + .signature-status--invalid { + & > svg { + fill: $color-error-area; + } + } } // only visible in stripped version of read view .mail-addresses__stripped { @@ -137,13 +152,6 @@ // Content components - &__signature-status { - margin-top: 0; - margin-bottom: 0.5em; - text-align: center; - color: $color-error; - padding: 0 $padding-horizontal; - } &__display-images { margin-bottom: 0.5em; text-align: center; diff --git a/src/tpl/mail-list.html b/src/tpl/mail-list.html index cddd544..81e2b5a 100644 --- a/src/tpl/mail-list.html +++ b/src/tpl/mail-list.html @@ -42,7 +42,7 @@ Not Starred
  • - Encrypted +
  • Answered @@ -74,4 +74,11 @@
    - + + +
    +
    +
    Message is encrypted.
    +
    + + diff --git a/src/tpl/read.html b/src/tpl/read.html index 603d33a..a3d929b 100644 --- a/src/tpl/read.html +++ b/src/tpl/read.html @@ -78,6 +78,13 @@ {{u.name || u.address}} + + + + + + @@ -111,11 +118,6 @@ -

    - Invalid PGP signature. This message could have been tampered with. -

    -
    @@ -164,6 +166,11 @@
    {{keyId}}
    +
    +
    +
    Message signature is valid.
    +
    Invalid message signature. This message could have been tampered with!
    +