Update copyright year
[openssl.git] / test / recipes / 80-test_ssl_old.t
1 #! /usr/bin/env perl
2 # Copyright 2015-2020 The OpenSSL Project Authors. All Rights Reserved.
3 #
4 # Licensed under the Apache License 2.0 (the "License").  You may not use
5 # this file except in compliance with the License.  You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
8
9
10 use strict;
11 use warnings;
12
13 use POSIX;
14 use File::Basename;
15 use File::Copy;
16 use OpenSSL::Test qw/:DEFAULT with bldtop_file bldtop_dir srctop_file srctop_dir cmdstr/;
17 use OpenSSL::Test::Utils;
18
19 BEGIN {
20 setup("test_ssl");
21 }
22
23 use lib srctop_dir('Configurations');
24 use lib bldtop_dir('.');
25 use platform;
26
27 $ENV{CTLOG_FILE} = srctop_file("test", "ct", "log_list.cnf");
28 $ENV{OPENSSL_MODULES} = bldtop_dir("providers");
29 $ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
30
31 my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
32 my ($no_rsa, $no_dsa, $no_dh, $no_ec, $no_psk,
33     $no_ssl3, $no_tls1, $no_tls1_1, $no_tls1_2, $no_tls1_3,
34     $no_dtls, $no_dtls1, $no_dtls1_2, $no_ct) =
35     anydisabled qw/rsa dsa dh ec psk
36                    ssl3 tls1 tls1_1 tls1_2 tls1_3
37                    dtls dtls1 dtls1_2 ct/;
38 my $no_anytls = alldisabled(available_protocols("tls"));
39 my $no_anydtls = alldisabled(available_protocols("dtls"));
40
41 plan skip_all => "No SSL/TLS/DTLS protocol is support by this OpenSSL build"
42     if $no_anytls && $no_anydtls;
43
44 my $digest = "-sha1";
45 my @reqcmd = ("openssl", "req");
46 my @x509cmd = ("openssl", "x509", $digest);
47 my @verifycmd = ("openssl", "verify");
48 my @genpkeycmd = ("openssl", "genpkey");
49 my $dummycnf = srctop_file("apps", "openssl.cnf");
50
51 my $CAkey = "keyCA.ss";
52 my $CAcert="certCA.ss";
53 my $CAserial="certCA.srl";
54 my $CAreq="reqCA.ss";
55 my $CAconf=srctop_file("test","CAss.cnf");
56 my $CAreq2="req2CA.ss"; # temp
57
58 my $Uconf=srctop_file("test","Uss.cnf");
59 my $Ukey="keyU.ss";
60 my $Ureq="reqU.ss";
61 my $Ucert="certU.ss";
62
63 my $Dkey="keyD.ss";
64 my $Dreq="reqD.ss";
65 my $Dcert="certD.ss";
66
67 my $Ekey="keyE.ss";
68 my $Ereq="reqE.ss";
69 my $Ecert="certE.ss";
70
71 my $P1conf=srctop_file("test","P1ss.cnf");
72 my $P1key="keyP1.ss";
73 my $P1req="reqP1.ss";
74 my $P1cert="certP1.ss";
75 my $P1intermediate="tmp_intP1.ss";
76
77 my $P2conf=srctop_file("test","P2ss.cnf");
78 my $P2key="keyP2.ss";
79 my $P2req="reqP2.ss";
80 my $P2cert="certP2.ss";
81 my $P2intermediate="tmp_intP2.ss";
82
83 my $server_sess="server.ss";
84 my $client_sess="client.ss";
85
86 # ssltest_old.c is deprecated in favour of the new framework in ssl_test.c
87 # If you're adding tests here, you probably want to convert them to the
88 # new format in ssl_test.c and add recipes to 80-test_ssl_new.t instead.
89 plan tests =>
90    ($no_fips ? 0 : 1 + 5) # For fipsinstall + testssl with fips provider
91     + 1                   # For testss
92     + 5                   # For the testssl with default provider
93     ;
94
95 unless ($no_fips) {
96     ok(run(app(['openssl', 'fipsinstall',
97                 '-out', bldtop_file('providers', 'fipsinstall.cnf'),
98                 '-module', bldtop_file('providers', platform->dso('fips')),
99                 '-provider_name', 'fips', '-mac_name', 'HMAC',
100                 '-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
101                 '-section_name', 'fips_sect'])),
102        "fipsinstall");
103 }
104
105 subtest 'test_ss' => sub {
106     if (testss()) {
107         open OUT, ">", "intP1.ss";
108         copy($CAcert, \*OUT); copy($Ucert, \*OUT);
109         close OUT;
110
111         open OUT, ">", "intP2.ss";
112         copy($CAcert, \*OUT); copy($Ucert, \*OUT); copy($P1cert, \*OUT);
113         close OUT;
114     }
115 };
116
117 note('test_ssl -- key U');
118 testssl("keyU.ss", $Ucert, $CAcert, "default", srctop_file("test","default.cnf"));
119 unless ($no_fips) {
120     testssl("keyU.ss", $Ucert, $CAcert, "fips", srctop_file("test","fips.cnf"));
121 }
122
123 # -----------
124 # subtest functions
125 sub testss {
126     my @req_dsa = ("-newkey",
127                    "dsa:".srctop_file("apps", "dsa1024.pem"));
128     my $dsaparams = srctop_file("apps", "dsa1024.pem");
129     my @req_new;
130     if ($no_rsa) {
131         @req_new = @req_dsa;
132     } else {
133         @req_new = ("-new");
134     }
135
136     plan tests => 17;
137
138   SKIP: {
139       skip 'failure', 16 unless
140           ok(run(app([@reqcmd, "-config", $CAconf,
141                       "-out", $CAreq, "-keyout", $CAkey,
142                       @req_new])),
143              'make cert request');
144
145       skip 'failure', 15 unless
146           ok(run(app([@x509cmd, "-CAcreateserial", "-in", $CAreq, "-days", "30",
147                       "-req", "-out", $CAcert, "-signkey", $CAkey,
148                       "-extfile", $CAconf, "-extensions", "v3_ca"],
149                      stdout => "err.ss")),
150              'convert request into self-signed cert');
151
152       skip 'failure', 14 unless
153           ok(run(app([@x509cmd, "-in", $CAcert,
154                       "-x509toreq", "-signkey", $CAkey, "-out", $CAreq2],
155                      stdout => "err.ss")),
156              'convert cert into a cert request');
157
158       skip 'failure', 13 unless
159           ok(run(app([@reqcmd, "-config", $dummycnf,
160                       "-verify", "-in", $CAreq, "-noout"])),
161              'verify request 1');
162
163
164       skip 'failure', 12 unless
165           ok(run(app([@reqcmd, "-config", $dummycnf,
166                       "-verify", "-in", $CAreq2, "-noout"])),
167              'verify request 2');
168
169       skip 'failure', 11 unless
170           ok(run(app([@verifycmd, "-CAfile", $CAcert, $CAcert])),
171              'verify signature');
172
173       skip 'failure', 10 unless
174           ok(run(app([@reqcmd, "-config", $Uconf,
175                       "-out", $Ureq, "-keyout", $Ukey, @req_new],
176                      stdout => "err.ss")),
177              'make a user cert request');
178
179       skip 'failure', 9 unless
180           ok(run(app([@x509cmd, "-CAcreateserial", "-in", $Ureq, "-days", "30",
181                       "-req", "-out", $Ucert,
182                       "-CA", $CAcert, "-CAkey", $CAkey, "-CAserial", $CAserial,
183                       "-extfile", $Uconf, "-extensions", "v3_ee"],
184                      stdout => "err.ss"))
185              && run(app([@verifycmd, "-CAfile", $CAcert, $Ucert])),
186              'sign user cert request');
187
188       skip 'failure', 8 unless
189           ok(run(app([@x509cmd,
190                       "-subject", "-issuer", "-startdate", "-enddate",
191                       "-noout", "-in", $Ucert])),
192              'Certificate details');
193
194       skip 'failure', 7 unless
195           subtest 'DSA certificate creation' => sub {
196               plan skip_all => "skipping DSA certificate creation"
197                   if $no_dsa;
198
199               plan tests => 5;
200
201             SKIP: {
202                 $ENV{CN2} = "DSA Certificate";
203                 skip 'failure', 4 unless
204                     ok(run(app([@genpkeycmd, "-out", $Dkey,
205                                 "-paramfile", $dsaparams],
206                                stdout => "err.ss")),
207                        "make a DSA key");
208                 skip 'failure', 3 unless
209                     ok(run(app([@reqcmd, "-new", "-config", $Uconf,
210                                 "-out", $Dreq, "-key", $Dkey],
211                                stdout => "err.ss")),
212                        "make a DSA user cert request");
213                 skip 'failure', 2 unless
214                     ok(run(app([@x509cmd, "-CAcreateserial",
215                                 "-in", $Dreq,
216                                 "-days", "30",
217                                 "-req",
218                                 "-out", $Dcert,
219                                 "-CA", $CAcert, "-CAkey", $CAkey,
220                                 "-CAserial", $CAserial,
221                                 "-extfile", $Uconf,
222                                 "-extensions", "v3_ee_dsa"],
223                                stdout => "err.ss")),
224                        "sign DSA user cert request");
225                 skip 'failure', 1 unless
226                     ok(run(app([@verifycmd, "-CAfile", $CAcert, $Dcert])),
227                        "verify DSA user cert");
228                 skip 'failure', 0 unless
229                     ok(run(app([@x509cmd,
230                                 "-subject", "-issuer",
231                                 "-startdate", "-enddate", "-noout",
232                                 "-in", $Dcert])),
233                        "DSA Certificate details");
234               }
235       };
236
237       skip 'failure', 6 unless
238           subtest 'ECDSA/ECDH certificate creation' => sub {
239               plan skip_all => "skipping ECDSA/ECDH certificate creation"
240                   if $no_ec;
241
242               plan tests => 5;
243
244             SKIP: {
245                 $ENV{CN2} = "ECDSA Certificate";
246                 skip 'failure', 4 unless
247                     ok(run(app(["openssl", "genpkey", "-genparam",
248                                 "-algorithm", "EC",
249                                 "-pkeyopt", "ec_paramgen_curve:P-256",
250                                 "-pkeyopt", "ec_param_enc:named_curve",
251                                 "-out", "ecp.ss"])),
252                        "make EC parameters");
253                 skip 'failure', 3 unless
254                     ok(run(app([@reqcmd, "-config", $Uconf,
255                                 "-out", $Ereq, "-keyout", $Ekey,
256                                 "-newkey", "ec:ecp.ss"],
257                                stdout => "err.ss")),
258                        "make a ECDSA/ECDH user cert request");
259                 skip 'failure', 2 unless
260                     ok(run(app([@x509cmd, "-CAcreateserial",
261                                 "-in", $Ereq,
262                                 "-days", "30",
263                                 "-req",
264                                 "-out", $Ecert,
265                                 "-CA", $CAcert, "-CAkey", $CAkey,
266                                 "-CAserial", $CAserial,
267                                 "-extfile", $Uconf,
268                                 "-extensions", "v3_ee_ec"],
269                                stdout => "err.ss")),
270                        "sign ECDSA/ECDH user cert request");
271                 skip 'failure', 1 unless
272                     ok(run(app([@verifycmd, "-CAfile", $CAcert, $Ecert])),
273                        "verify ECDSA/ECDH user cert");
274                 skip 'failure', 0 unless
275                     ok(run(app([@x509cmd,
276                                 "-subject", "-issuer",
277                                 "-startdate", "-enddate", "-noout",
278                                 "-in", $Ecert])),
279                        "ECDSA Certificate details");
280               }
281       };
282
283       skip 'failure', 5 unless
284           ok(run(app([@reqcmd, "-config", $P1conf,
285                       "-out", $P1req, "-keyout", $P1key, @req_new],
286                      stdout => "err.ss")),
287              'make a proxy cert request');
288
289
290       skip 'failure', 4 unless
291           ok(run(app([@x509cmd, "-CAcreateserial", "-in", $P1req, "-days", "30",
292                       "-req", "-out", $P1cert,
293                       "-CA", $Ucert, "-CAkey", $Ukey,
294                       "-extfile", $P1conf, "-extensions", "v3_proxy"],
295                      stdout => "err.ss")),
296              'sign proxy with user cert');
297
298       copy($Ucert, $P1intermediate);
299       run(app([@verifycmd, "-CAfile", $CAcert,
300                "-untrusted", $P1intermediate, $P1cert]));
301       ok(run(app([@x509cmd,
302                   "-subject", "-issuer", "-startdate", "-enddate",
303                   "-noout", "-in", $P1cert])),
304          'Certificate details');
305
306       skip 'failure', 2 unless
307           ok(run(app([@reqcmd, "-config", $P2conf,
308                       "-out", $P2req, "-keyout", $P2key,
309                       @req_new],
310                      stdout => "err.ss")),
311              'make another proxy cert request');
312
313
314       skip 'failure', 1 unless
315           ok(run(app([@x509cmd, "-CAcreateserial", "-in", $P2req, "-days", "30",
316                       "-req", "-out", $P2cert,
317                       "-CA", $P1cert, "-CAkey", $P1key,
318                       "-extfile", $P2conf, "-extensions", "v3_proxy"],
319                      stdout => "err.ss")),
320              'sign second proxy cert request with the first proxy cert');
321
322
323       open OUT, ">", $P2intermediate;
324       copy($Ucert, \*OUT); copy($P1cert, \*OUT);
325       close OUT;
326       run(app([@verifycmd, "-CAfile", $CAcert,
327                "-untrusted", $P2intermediate, $P2cert]));
328       ok(run(app([@x509cmd,
329                   "-subject", "-issuer", "-startdate", "-enddate",
330                   "-noout", "-in", $P2cert])),
331          'Certificate details');
332     }
333 }
334
335 sub testssl {
336     my ($key, $cert, $CAtmp, $provider, $configfile) = @_;
337     my @CA = $CAtmp ? ("-CAfile", $CAtmp) : ("-CApath", bldtop_dir("certs"));
338
339     my @ssltest = ("ssltest_old",
340                    "-s_key", $key, "-s_cert", $cert,
341                    "-c_key", $key, "-c_cert", $cert,
342                    "-provider", $provider,
343                    "-config", $configfile);
344
345     my $serverinfo = srctop_file("test","serverinfo.pem");
346
347     my $dsa_cert = 0;
348     if (grep /DSA Public Key/, run(app(["openssl", "x509", "-in", $cert,
349                                         "-text", "-noout"]), capture => 1)) {
350         $dsa_cert = 1;
351     }
352
353
354     # plan tests => 11;
355
356     subtest 'standard SSL tests' => sub {
357         ######################################################################
358       plan tests => 13;
359
360       SKIP: {
361           skip "SSLv3 is not supported by this OpenSSL build", 4
362               if disabled("ssl3");
363
364           skip "SSLv3 is not supported by the FIPS provider", 4
365               if $provider eq "fips";
366
367           ok(run(test([@ssltest, "-bio_pair", "-ssl3"])),
368              'test sslv3 via BIO pair');
369           ok(run(test([@ssltest, "-bio_pair", "-ssl3", "-server_auth", @CA])),
370              'test sslv3 with server authentication via BIO pair');
371           ok(run(test([@ssltest, "-bio_pair", "-ssl3", "-client_auth", @CA])),
372              'test sslv3 with client authentication via BIO pair');
373           ok(run(test([@ssltest, "-bio_pair", "-ssl3", "-server_auth", "-client_auth", @CA])),
374              'test sslv3 with both server and client authentication via BIO pair');
375         }
376
377       SKIP: {
378           skip "Neither SSLv3 nor any TLS version are supported by this OpenSSL build", 1
379               if $no_anytls;
380
381           ok(run(test([@ssltest, "-bio_pair"])),
382              'test sslv2/sslv3 via BIO pair');
383         }
384
385       SKIP: {
386           skip "Neither SSLv3 nor any TLS version are supported by this OpenSSL build", 8
387               if $no_anytls;
388
389         SKIP: {
390             skip "skipping test of sslv2/sslv3 w/o (EC)DHE test", 1 if $dsa_cert;
391
392             ok(run(test([@ssltest, "-bio_pair", "-no_dhe", "-no_ecdhe"])),
393                'test sslv2/sslv3 w/o (EC)DHE via BIO pair');
394           }
395
396           ok(run(test([@ssltest, "-bio_pair", "-dhe1024dsa", "-v"])),
397              'test sslv2/sslv3 with 1024bit DHE via BIO pair');
398           ok(run(test([@ssltest, "-bio_pair", "-server_auth", @CA])),
399              'test sslv2/sslv3 with server authentication');
400           ok(run(test([@ssltest, "-bio_pair", "-client_auth", @CA])),
401              'test sslv2/sslv3 with client authentication via BIO pair');
402           ok(run(test([@ssltest, "-bio_pair", "-server_auth", "-client_auth", @CA])),
403              'test sslv2/sslv3 with both client and server authentication via BIO pair');
404           ok(run(test([@ssltest, "-bio_pair", "-server_auth", "-client_auth", "-app_verify", @CA])),
405              'test sslv2/sslv3 with both client and server authentication via BIO pair and app verify');
406
407         SKIP: {
408             skip "No IPv4 available on this machine", 1
409                 unless !disabled("sock") && have_IPv4();
410             ok(run(test([@ssltest, "-ipv4"])),
411                'test TLS via IPv4');
412           }
413
414         SKIP: {
415             skip "No IPv6 available on this machine", 1
416                 unless !disabled("sock") && have_IPv6();
417             ok(run(test([@ssltest, "-ipv6"])),
418                'test TLS via IPv6');
419           }
420         }
421     };
422
423     subtest "Testing ciphersuites" => sub {
424
425         my @exkeys = ();
426         my $ciphers = "-PSK:-SRP";
427
428         if (!$no_dsa) {
429             push @exkeys, "-s_cert", "certD.ss", "-s_key", "keyD.ss";
430         }
431
432         if (!$no_ec) {
433             push @exkeys, "-s_cert", "certE.ss", "-s_key", "keyE.ss";
434         }
435
436         my @protocols = ();
437         # We only use the flags that ssltest_old understands
438         push @protocols, "-tls1_3" unless $no_tls1_3;
439         push @protocols, "-tls1_2" unless $no_tls1_2;
440         push @protocols, "-tls1" unless $no_tls1 || $provider eq "fips";
441         push @protocols, "-ssl3" unless $no_ssl3 || $provider eq "fips";
442         my $protocolciphersuitecount = 0;
443         my %ciphersuites = ();
444         my %ciphersstatus = ();
445         foreach my $protocol (@protocols) {
446             my $ciphersstatus = undef;
447             my @ciphers = run(app(["openssl", "ciphers", "-s", $protocol,
448                                    "ALL:$ciphers"]),
449                               capture => 1, statusvar => \$ciphersstatus);
450             @ciphers = grep {!/CAMELLIA|ARIA|CHACHA/} @ciphers;
451             $ciphersstatus{$protocol} = $ciphersstatus;
452             if ($ciphersstatus) {
453                 $ciphersuites{$protocol} = [ map { s|\R||; split(/:/, $_) }
454                                              @ciphers ];
455                 $protocolciphersuitecount += scalar @{$ciphersuites{$protocol}};
456             }
457         }
458
459         plan skip_all => "None of the ciphersuites to test are available in this OpenSSL build"
460             if $protocolciphersuitecount + scalar(keys %ciphersuites) == 0;
461
462         # The count of protocols is because in addition to the ciphersuites
463         # we got above, we're running a weak DH test for each protocol (except
464         # TLSv1.3)
465         my $testcount = scalar(@protocols) + $protocolciphersuitecount
466                         + scalar(keys %ciphersuites);
467         $testcount-- unless $no_tls1_3;
468         plan tests => $testcount;
469
470         foreach my $protocol (@protocols) {
471             ok($ciphersstatus{$protocol}, "Getting ciphers for $protocol");
472         }
473
474         foreach my $protocol (sort keys %ciphersuites) {
475             note "Testing ciphersuites for $protocol";
476             # ssltest_old doesn't know -tls1_3, but that's fine, since that's
477             # the default choice if TLSv1.3 enabled
478             my $flag = $protocol eq "-tls1_3" ? "" : $protocol;
479             my $ciphersuites = "";
480             foreach my $cipher (@{$ciphersuites{$protocol}}) {
481                 if ($protocol eq "-ssl3" && $cipher =~ /ECDH/ ) {
482                     note "*****SKIPPING $protocol $cipher";
483                     ok(1);
484                 } else {
485                     if ($protocol eq "-tls1_3") {
486                         $ciphersuites = $cipher;
487                         $cipher = "";
488                     }
489                     ok(run(test([@ssltest, @exkeys, "-cipher", $cipher,
490                                  "-ciphersuites", $ciphersuites, $flag || ()])),
491                        "Testing $cipher");
492                 }
493             }
494             next if $protocol eq "-tls1_3";
495             is(run(test([@ssltest,
496                          "-s_cipher", "EDH",
497                          "-c_cipher", 'EDH:@SECLEVEL=1',
498                          "-dhe512",
499                          $protocol])), 0,
500                "testing connection with weak DH, expecting failure");
501         }
502     };
503
504     subtest 'RSA/(EC)DHE/PSK tests' => sub {
505         ######################################################################
506
507         plan tests => 5;
508
509       SKIP: {
510           skip "TLSv1.0 is not supported by this OpenSSL build", 5
511               if $no_tls1 || $provider eq "fips";
512
513         SKIP: {
514             skip "skipping anonymous DH tests", 1
515               if ($no_dh);
516
517             ok(run(test([@ssltest, "-v", "-bio_pair", "-tls1", "-cipher", "ADH", "-dhe1024dsa", "-num", "10", "-f", "-time"])),
518                'test tlsv1 with 1024bit anonymous DH, multiple handshakes');
519           }
520
521         SKIP: {
522             skip "skipping RSA tests", 2
523                 if $no_rsa;
524
525             ok(run(test(["ssltest_old", "-provider", "default", "-v", "-bio_pair", "-tls1", "-s_cert", srctop_file("apps","server2.pem"), "-no_dhe", "-no_ecdhe", "-num", "10", "-f", "-time"])),
526                'test tlsv1 with 1024bit RSA, no (EC)DHE, multiple handshakes');
527
528             skip "skipping RSA+DHE tests", 1
529                 if $no_dh;
530
531             ok(run(test(["ssltest_old", "-provider", "default", "-v", "-bio_pair", "-tls1", "-s_cert", srctop_file("apps","server2.pem"), "-dhe1024dsa", "-num", "10", "-f", "-time"])),
532                'test tlsv1 with 1024bit RSA, 1024bit DHE, multiple handshakes');
533           }
534
535         SKIP: {
536             skip "skipping PSK tests", 2
537                 if ($no_psk);
538
539             ok(run(test([@ssltest, "-tls1", "-cipher", "PSK", "-psk", "abc123"])),
540                'test tls1 with PSK');
541
542             ok(run(test([@ssltest, "-bio_pair", "-tls1", "-cipher", "PSK", "-psk", "abc123"])),
543                'test tls1 with PSK via BIO pair');
544           }
545         }
546
547     };
548
549     subtest 'Custom Extension tests' => sub {
550         ######################################################################
551
552         plan tests => 1;
553
554       SKIP: {
555           skip "TLSv1.0 is not supported by this OpenSSL build", 1
556               if $no_tls1 || $provider eq "fips";
557
558           ok(run(test([@ssltest, "-bio_pair", "-tls1", "-custom_ext"])),
559              'test tls1 with custom extensions');
560         }
561     };
562
563     subtest 'Serverinfo tests' => sub {
564         ######################################################################
565
566         plan tests => 5;
567
568       SKIP: {
569           skip "TLSv1.0 is not supported by this OpenSSL build", 5
570               if $no_tls1 || $provider eq "fips";
571
572           note('echo test tls1 with serverinfo');
573           ok(run(test([@ssltest, "-bio_pair", "-tls1", "-serverinfo_file", $serverinfo])));
574           ok(run(test([@ssltest, "-bio_pair", "-tls1", "-serverinfo_file", $serverinfo, "-serverinfo_sct"])));
575           ok(run(test([@ssltest, "-bio_pair", "-tls1", "-serverinfo_file", $serverinfo, "-serverinfo_tack"])));
576           ok(run(test([@ssltest, "-bio_pair", "-tls1", "-serverinfo_file", $serverinfo, "-serverinfo_sct", "-serverinfo_tack"])));
577           ok(run(test([@ssltest, "-bio_pair", "-tls1", "-custom_ext", "-serverinfo_file", $serverinfo, "-serverinfo_sct", "-serverinfo_tack"])));
578         }
579     };
580 }