fix(mail(web)): display emails extracted from smime certificate

Fixes #5440
This commit is contained in:
Francis Lachapelle
2021-12-10 14:33:10 -05:00
parent cb4d555e4a
commit 93dff697e7
3 changed files with 16 additions and 5 deletions

View File

@@ -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
@@ -38,7 +38,8 @@
- (NSString *) validationMessage;
- (NSArray *) smimeCertificates;
- (NSDictionary *) certificateForSubject: (NSString *) subject
andIssuer: (NSString *) issuer;
andIssuer: (NSString *) issuer
withEmails: (NSArray *) emails;
@end

View File

@@ -159,7 +159,8 @@
BIO_free(buf);
[certificates addObject: [self certificateForSubject: subject
andIssuer: issuer]];
andIssuer: issuer
withEmails: emails]];
}
}
@@ -240,10 +241,12 @@
- (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];
}

View File

@@ -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">