Skip to content

Commit

Permalink
fix(mail(web)): display emails extracted from smime certificate
Browse files Browse the repository at this point in the history
Fixes #5440
  • Loading branch information
cgx committed Dec 10, 2021
1 parent cb4d555 commit 93dff69
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
5 changes: 3 additions & 2 deletions UI/MailPartViewers/UIxMailPartSignedViewer.h
@@ -1,6 +1,6 @@
/* UIxMailPartSignedViewer.h - this file is part of SOGo
*
* Copyright (C) 2009-2018 Inverse inc.
* Copyright (C) 2009-2021 Inverse inc.
*
* This file is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -38,7 +38,8 @@
- (NSString *) validationMessage;
- (NSArray *) smimeCertificates;
- (NSDictionary *) certificateForSubject: (NSString *) subject
andIssuer: (NSString *) issuer;
andIssuer: (NSString *) issuer
withEmails: (NSArray *) emails;

@end

Expand Down
9 changes: 6 additions & 3 deletions UI/MailPartViewers/UIxMailPartSignedViewer.m
Expand Up @@ -159,7 +159,8 @@ - (void) _processMessage
BIO_free(buf);

[certificates addObject: [self certificateForSubject: subject
andIssuer: issuer]];
andIssuer: issuer
withEmails: emails]];
}
}

Expand Down Expand Up @@ -240,10 +241,12 @@ - (BOOL) validSignature

- (NSDictionary *) certificateForSubject: (NSString *) subject
andIssuer: (NSString *) issuer
withEmails: (NSArray *) emails
{
return [NSDictionary dictionaryWithObjectsAndKeys:
[subject componentsFromMultilineDN], @"subject",
[issuer componentsFromMultilineDN], @"issuer",
[subject componentsFromMultilineDN], @"subject",
[issuer componentsFromMultilineDN], @"issuer",
emails, @"emails",
nil];
}

Expand Down
7 changes: 7 additions & 0 deletions UI/Templates/MailerUI/UIxMailViewTemplate.wox
Expand Up @@ -275,6 +275,13 @@
<div class="md-margin" md-whiteframe="3">
<div class="md-padding" layout="row" layout-wrap="layout-wrap">
<div flex="50" flex-xs="100">
<div class="sg-padded--bottom" ng-if="::viewer.message.signed.certificate.emails">
<div class="md-subhead md-default-theme md-fg md-primary"
ng-bind="::'Email Addresses' | loc"><!-- Subject Name --></div>
<div class="pseudo-input-field md-body-1"
ng-repeat="email in ::viewer.message.signed.certificate.emails"
ng-bind="email"><!-- email address --></div>
</div>
<div class="md-subhead md-default-theme md-fg md-primary"
ng-bind="::'Subject Name' | loc"><!-- Subject Name --></div>
<div ng-repeat="field in ::viewer.message.signed.certificate.subject">
Expand Down

0 comments on commit 93dff69

Please sign in to comment.