This file is indexed.

/usr/share/zentyal/templates/ca/index.mas is in zentyal-ca 2.3.6+quantal1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<%doc>
  Template to show the current certificate list and issue a new
  certificate.
</%doc>
<%args>
  $certs # A reference to the list with all available certificates
  $caNeeded => 0 # set whether the CA certificate is needed to issue
  $passRequired => '' # set if the CA is password-aware
  $caExpirationDays => '' # default value for certificate expiration
</%args>
<%init>
use EBox::Gettext;
use EBox::CA::DN;
</%init>
<!-- Issue a new certificate -->
<%perl>
  # Common args to issueCertificate and issueCACertificate
  my @issueTable = (
            [ name => 'caNeeded', input => 'hidden',
              value => $caNeeded ],
           );

  my $printableName = __('Organization Name');
  $printableName = __('Common Name') unless ($caNeeded);
  push ( @issueTable, [ name => 'name',
            printableName => $printableName,
            input => 'text' ],
       );

#  if ( $passRequired or $caNeeded ) {
#    push ( @issueTable, [ name => 'caPassphrase', input => 'password',
#                          printableName => __('CA Passphrase') ]);
#
#  }

  if ( $caNeeded ) {
#    push ( @issueTable, [ name => 'reCAPassphrase',
#                          input => 'password',
#                          printableName => __('Re CA Passphrase')]
#         );
      push( @issueTable, [ name => 'countryName', input => 'text',
                           printableName => __('Country code'),
                           size => 2, optional => 1 ]);
      push( @issueTable, [ name => 'localityName', input => 'text',
                           printableName => __('City'),
                           optional => 1 ]);
      push( @issueTable, [ name => 'stateName', input => 'text',
                           printableName => __('State'),
                           optional => 1 ]);

  }
  push( @issueTable,[ name => 'expiryDays',
                      printableName => __('Days to expire'),
                      value => $caExpirationDays,
                      size => 5, input => 'text' ]);

  unless ( $caNeeded ) {
      push( @issueTable, [ name => 'subjectAltName', input => 'text',
                           printableName => __('Subject Alternative Names'),
                           help => __x('Multi-value separated by '
                                      . 'commas, only valid types are: '
                                      . '{dns}, {ip} and {email}. For '
                                      . 'instance, {example}',
                                      dns     => 'DNS',
                                      ip      => 'IP',
                                      email   => 'email',
                                      example => 'DNS:host.domain.com,IP:10.2.2.2'
                                      ),
                           optional => 1 ]);
  }


  push ( @issueTable, [ name => 'certificate',
            value => __('Issue'),
            input => 'submit' ]
       );

  # Set the list of suitable certificates to reissue
  my %validCerts = map { $_->{'dn'}->attribute('commonName') => 1 } grep { $_->{state} eq 'V' } @{$certs};

</%perl>
<div class="help">
  <% __("Certificate changes will take effect immediately.") %>
% if ( $caNeeded ) {
  <% '.' . __('The CA passphrase is optional') %>
% }
</div>
% if ($caNeeded) {
  <h3><% __('Issue the Certification Authority Certificate') %></h3>
% } else {
  <h3><% __('Issue a New Certificate')  %></h3>
% }
<form action="IssueCertificate" method="post" >
  <& formTable.mas, rows => \@issueTable &>
</form>

<!-- List current certificates in a table -->
<h3><% __("Current Certificate List")  %></h3>
<div class="help">
  <% __("Date refers to Expiration Date in Valid/Expired and to Revokation Date in Revoked certificates respectively") %>.
</div>
<table class="dataTable">
  <thead>
    <th><% __("Name")  %></th>
    <th><% __("State") %></th>
    <th><% __("Date")  %></th>
    <th class="thOptions"><% __("Actions") %></th>
  </thead>
  <tbody>
%   # XXX: We need the CN of the CA certificates to filter revoked ones
%   my $caCertName = '';
%   foreach my $cert (@{$certs}) {
%   # It is needed to check if it is the CA certificate
%     if ( $cert->{'isCACert'} and $cert->{'state'} eq 'V' ) {
%      $caCertName = $cert->{'dn'}->attribute('commonName');
       <tr class="highlight">
%     }
     <td class="tleft"
%     if ( defined($cert->{'subjAltNames'}) and @{$cert->{'subjAltNames'}} > 0 ) {
%            my $subjAltNamesStr = join(', ', map { qq{$_->{type}: $_->{value}} } @{$cert->{'subjAltNames'}});
             title="<% $subjAltNamesStr %>"
% }
         >
%     if ( $cert->{'isCACert'} ) {
        <% $cert->{'dn'}->attribute('commonName') %>
        <% __('from') %>
            <% $cert->{'dn'}->attribute('organizationName') %>
%     }
%     else {
            <% $cert->{'dn'}->attribute('commonName') %>
%     }
         </td>
    <!-- Print the state string -->
<%perl>
   my $stateStr = "";
   if ( $cert->{"state"} eq "V" ) {
     $stateStr = __("Valid");
   } elsif ( $cert->{"state"} eq "E" ) {
     $stateStr = __("Expired");
   } elsif ( $cert->{"state"} eq "R" ) {
     $stateStr = __("Revoked");
   }
</%perl>
      <td class="tcenter"
%     if ( $cert->{"state"} eq 'R' ) {
          title="<% __x('Reason: {reason}', reason => $cert->{'reason'}) %>"
%     }
        >
        <% $stateStr %>
      </td>
      <td>
  <!-- Print the expiration or revocation date -->
<%perl>
    my $date = undef;
    if ( $cert->{"state"} =~ m/[VE]/ ) {
      $date = $cert->{"expiryDate"};
    } else {
      $date = $cert->{"revokeDate"};
    }
</%perl>
        <%
      sprintf("%04d-%02d-%02d %02d:%02d:%02d", $date->year(),
          $date->month(), $date->day(), $date->hours(),
          $date->minutes(), $date->seconds())
        %>
      </td>
      <td class="tcenter">
%   if ( $cert->{"state"} eq "V" ) {
        <a
    href="ShowForm?action=revoke&cn=<%$cert->{'dn'}->attribute('commonName')
| u%>"
    >
      <img src="/data/images/deny-active.gif"
           alt="<% __('Revoke') %>" />
    </a>
        <img src="/data/images/sep.gif" alt="-" />
%   }
%   if ( $cert->{"state"} eq "V" ) {
        <a
    href="DownloadFiles?cn=<%$cert->{'dn'}->attribute('commonName') | u%>"
    >
      <img src="/data/images/install.gif"
           alt="<% __('Download Key(s) and Certificate') %>" />
    </a>
        <img src="/data/images/sep.gif" alt="-" />
%   }
%   if ( $cert->{"state"} eq "V" ) {
        <a
    href="ShowForm?action=renew&cn=<%$cert->{'dn'}->attribute('commonName')
    | u%>"
    >
      <img src="/data/images/reload.png"
           alt="<% __('Renew') %>" />
    </a>
        <img src="/data/images/sep.gif" alt="-" />
%   }
%   if (($cert->{'state'} eq 'E' or $cert->{'state'} eq 'R')
%        and not $caNeeded
%        and ($cert->{'dn'}->attribute('commonName') ne $caCertName)
%        and (not exists($validCerts{$cert->{'dn'}->attribute('commonName')})) ) {
        <a
    href="ShowForm?action=reissue&cn=<%$cert->{'dn'}->attribute('commonName')
    | u%>"
    >
      <img src="/data/images/reload.png"
           alt="<% __('Reissue') %>" />
    </a>
%   }

      </td>
    </tr>
%   }
  </tbody>
</table>
<!-- Put the legend underneath the list -->
<%perl>
  my @legendElements = (
            { imgFile => "/data/images/deny-active.gif",
              imgName => __("Revoke") },
            { imgFile => "/data/images/install.gif",
              imgName => __("Download Key(s) and Certificate") },
            { imgFile => "/data/images/reload.png",
              imgName => __("Renew or reissue") }
               );
</%perl>
<& legendTable.mas, elements => \@legendElements, nColumns => 3 &>