Make bn opaque
[openssl.git] / test / cms-test.pl
1 # test/cms-test.pl
2 # Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 # project.
4 #
5 # ====================================================================
6 # Copyright (c) 2008 The OpenSSL Project.  All rights reserved.
7 #
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 #
12 # 1. Redistributions of source code must retain the above copyright
13 #    notice, this list of conditions and the following disclaimer.
14 #
15 # 2. Redistributions in binary form must reproduce the above copyright
16 #    notice, this list of conditions and the following disclaimer in
17 #    the documentation and/or other materials provided with the
18 #    distribution.
19 #
20 # 3. All advertising materials mentioning features or use of this
21 #    software must display the following acknowledgment:
22 #    "This product includes software developed by the OpenSSL Project
23 #    for use in the OpenSSL Toolkit. (http://www.OpenSSL.org/)"
24 #
25 # 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
26 #    endorse or promote products derived from this software without
27 #    prior written permission. For written permission, please contact
28 #    licensing@OpenSSL.org.
29 #
30 # 5. Products derived from this software may not be called "OpenSSL"
31 #    nor may "OpenSSL" appear in their names without prior written
32 #    permission of the OpenSSL Project.
33 #
34 # 6. Redistributions of any form whatsoever must retain the following
35 #    acknowledgment:
36 #    "This product includes software developed by the OpenSSL Project
37 #    for use in the OpenSSL Toolkit (http://www.OpenSSL.org/)"
38 #
39 # THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
40 # EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 # PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
43 # ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45 # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47 # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48 # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50 # OF THE POSSIBILITY OF SUCH DAMAGE.
51 # ====================================================================
52
53 # CMS, PKCS7 consistency test script. Run extensive tests on
54 # OpenSSL PKCS#7 and CMS implementations.
55
56 my $ossl_path;
57 my $redir = " 2> cms.err > cms.out";
58 # Make VMS work
59 if ( $^O eq "VMS" && -f "OSSLX:openssl.exe" ) {
60     $ossl_path = "pipe mcr OSSLX:openssl";
61 }
62 # Make MSYS work
63 elsif ( $^O eq "MSWin32" && -f "../apps/openssl.exe" ) {
64     $ossl_path = "cmd /c ..\\apps\\openssl";
65 }
66 elsif ( -f "../apps/openssl$ENV{EXE_EXT}" ) {
67     $ossl_path = "../util/shlib_wrap.sh ../apps/openssl";
68 }
69 elsif ( -f "..\\out32dll\\openssl.exe" ) {
70     $ossl_path = "..\\out32dll\\openssl.exe";
71 }
72 elsif ( -f "..\\out32\\openssl.exe" ) {
73     $ossl_path = "..\\out32\\openssl.exe";
74 }
75 else {
76     die "Can't find OpenSSL executable";
77 }
78
79 my $pk7cmd   = "$ossl_path smime ";
80 my $cmscmd   = "$ossl_path cms ";
81 my $smdir    = "smime-certs";
82 my $halt_err = 1;
83
84 my $badcmd = 0;
85 my $no_ec;
86 my $no_ec2m;
87 my $ossl8 = `$ossl_path version -v` =~ /0\.9\.8/;
88
89 system ("$ossl_path no-ec >/dev/null");
90 if ($? == 0)
91         {
92         $no_ec = 1;
93         }
94 elsif ($? == 256)
95         {
96         $no_ec = 0;
97         }
98 else
99         {
100         die "Error checking for EC support\n";
101         }
102     
103 system ("$ossl_path no-ec2m >/dev/null");
104 if ($? == 0)
105         {
106         $no_ec2m = 1;
107         }
108 elsif ($? == 256)
109         {
110         $no_ec2m = 0;
111         }
112 else
113         {
114         die "Error checking for EC2M support\n";
115         }
116     
117 my @smime_pkcs7_tests = (
118
119     [
120         "signed content DER format, RSA key",
121         "-sign -in smcont.txt -outform \"DER\" -nodetach"
122           . " -certfile $smdir/smroot.pem"
123           . " -signer $smdir/smrsa1.pem -out test.cms",
124         "-verify -in test.cms -inform \"DER\" "
125           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
126     ],
127
128     [
129         "signed detached content DER format, RSA key",
130         "-sign -in smcont.txt -outform \"DER\""
131           . " -signer $smdir/smrsa1.pem -out test.cms",
132         "-verify -in test.cms -inform \"DER\" "
133           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt -content smcont.txt"
134     ],
135
136     [
137         "signed content test streaming BER format, RSA",
138         "-sign -in smcont.txt -outform \"DER\" -nodetach"
139           . " -stream -signer $smdir/smrsa1.pem -out test.cms",
140         "-verify -in test.cms -inform \"DER\" "
141           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
142     ],
143
144     [
145         "signed content DER format, DSA key",
146         "-sign -in smcont.txt -outform \"DER\" -nodetach"
147           . " -signer $smdir/smdsa1.pem -out test.cms",
148         "-verify -in test.cms -inform \"DER\" "
149           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
150     ],
151
152     [
153         "signed detached content DER format, DSA key",
154         "-sign -in smcont.txt -outform \"DER\""
155           . " -signer $smdir/smdsa1.pem -out test.cms",
156         "-verify -in test.cms -inform \"DER\" "
157           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt -content smcont.txt"
158     ],
159
160     [
161         "signed detached content DER format, add RSA signer",
162         "-resign -inform \"DER\" -in test.cms -outform \"DER\""
163           . " -signer $smdir/smrsa1.pem -out test2.cms",
164         "-verify -in test2.cms -inform \"DER\" "
165           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt -content smcont.txt"
166     ],
167
168     [
169         "signed content test streaming BER format, DSA key",
170         "-sign -in smcont.txt -outform \"DER\" -nodetach"
171           . " -stream -signer $smdir/smdsa1.pem -out test.cms",
172         "-verify -in test.cms -inform \"DER\" "
173           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
174     ],
175
176     [
177         "signed content test streaming BER format, 2 DSA and 2 RSA keys",
178         "-sign -in smcont.txt -outform \"DER\" -nodetach"
179           . " -signer $smdir/smrsa1.pem -signer $smdir/smrsa2.pem"
180           . " -signer $smdir/smdsa1.pem -signer $smdir/smdsa2.pem"
181           . " -stream -out test.cms",
182         "-verify -in test.cms -inform \"DER\" "
183           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
184     ],
185
186     [
187 "signed content test streaming BER format, 2 DSA and 2 RSA keys, no attributes",
188         "-sign -in smcont.txt -outform \"DER\" -noattr -nodetach"
189           . " -signer $smdir/smrsa1.pem -signer $smdir/smrsa2.pem"
190           . " -signer $smdir/smdsa1.pem -signer $smdir/smdsa2.pem"
191           . " -stream -out test.cms",
192         "-verify -in test.cms -inform \"DER\" "
193           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
194     ],
195
196     [
197         "signed content test streaming S/MIME format, 2 DSA and 2 RSA keys",
198         "-sign -in smcont.txt -nodetach"
199           . " -signer $smdir/smrsa1.pem -signer $smdir/smrsa2.pem"
200           . " -signer $smdir/smdsa1.pem -signer $smdir/smdsa2.pem"
201           . " -stream -out test.cms",
202         "-verify -in test.cms " . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
203     ],
204
205     [
206 "signed content test streaming multipart S/MIME format, 2 DSA and 2 RSA keys",
207         "-sign -in smcont.txt"
208           . " -signer $smdir/smrsa1.pem -signer $smdir/smrsa2.pem"
209           . " -signer $smdir/smdsa1.pem -signer $smdir/smdsa2.pem"
210           . " -stream -out test.cms",
211         "-verify -in test.cms " . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
212     ],
213
214     [
215         "enveloped content test streaming S/MIME format, 3 recipients",
216         "-encrypt -in smcont.txt"
217           . " -stream -out test.cms"
218           . " $smdir/smrsa1.pem $smdir/smrsa2.pem $smdir/smrsa3.pem ",
219         "-decrypt -recip $smdir/smrsa1.pem -in test.cms -out smtst.txt"
220     ],
221
222     [
223 "enveloped content test streaming S/MIME format, 3 recipients, 3rd used",
224         "-encrypt -in smcont.txt"
225           . " -stream -out test.cms"
226           . " $smdir/smrsa1.pem $smdir/smrsa2.pem $smdir/smrsa3.pem ",
227         "-decrypt -recip $smdir/smrsa3.pem -in test.cms -out smtst.txt"
228     ],
229
230     [
231 "enveloped content test streaming S/MIME format, 3 recipients, key only used",
232         "-encrypt -in smcont.txt"
233           . " -stream -out test.cms"
234           . " $smdir/smrsa1.pem $smdir/smrsa2.pem $smdir/smrsa3.pem ",
235         "-decrypt -inkey $smdir/smrsa3.pem -in test.cms -out smtst.txt"
236     ],
237
238     [
239 "enveloped content test streaming S/MIME format, AES-256 cipher, 3 recipients",
240         "-encrypt -in smcont.txt"
241           . " -aes256 -stream -out test.cms"
242           . " $smdir/smrsa1.pem $smdir/smrsa2.pem $smdir/smrsa3.pem ",
243         "-decrypt -recip $smdir/smrsa1.pem -in test.cms -out smtst.txt"
244     ],
245
246 );
247
248 my @smime_cms_tests = (
249
250     [
251         "signed content test streaming BER format, 2 DSA and 2 RSA keys, keyid",
252         "-sign -in smcont.txt -outform \"DER\" -nodetach -keyid"
253           . " -signer $smdir/smrsa1.pem -signer $smdir/smrsa2.pem"
254           . " -signer $smdir/smdsa1.pem -signer $smdir/smdsa2.pem"
255           . " -stream -out test.cms",
256         "-verify -in test.cms -inform \"DER\" "
257           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
258     ],
259
260     [
261         "signed content test streaming PEM format, 2 DSA and 2 RSA keys",
262         "-sign -in smcont.txt -outform PEM -nodetach"
263           . " -signer $smdir/smrsa1.pem -signer $smdir/smrsa2.pem"
264           . " -signer $smdir/smdsa1.pem -signer $smdir/smdsa2.pem"
265           . " -stream -out test.cms",
266         "-verify -in test.cms -inform PEM "
267           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
268     ],
269
270     [
271         "signed content MIME format, RSA key, signed receipt request",
272         "-sign -in smcont.txt -signer $smdir/smrsa1.pem -nodetach"
273           . " -receipt_request_to test\@openssl.org -receipt_request_all"
274           . " -out test.cms",
275         "-verify -in test.cms "
276           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
277     ],
278
279     [
280         "signed receipt MIME format, RSA key",
281         "-sign_receipt -in test.cms"
282           . " -signer $smdir/smrsa2.pem"
283           . " -out test2.cms",
284         "-verify_receipt test2.cms -in test.cms"
285           . " \"-CAfile\" $smdir/smroot.pem"
286     ],
287
288     [
289         "enveloped content test streaming S/MIME format, 3 recipients, keyid",
290         "-encrypt -in smcont.txt"
291           . " -stream -out test.cms -keyid"
292           . " $smdir/smrsa1.pem $smdir/smrsa2.pem $smdir/smrsa3.pem ",
293         "-decrypt -recip $smdir/smrsa1.pem -in test.cms -out smtst.txt"
294     ],
295
296     [
297         "enveloped content test streaming PEM format, KEK",
298         "-encrypt -in smcont.txt -outform PEM -aes128"
299           . " -stream -out test.cms "
300           . " -secretkey 000102030405060708090A0B0C0D0E0F "
301           . " -secretkeyid C0FEE0",
302         "-decrypt -in test.cms -out smtst.txt -inform PEM"
303           . " -secretkey 000102030405060708090A0B0C0D0E0F "
304           . " -secretkeyid C0FEE0"
305     ],
306
307     [
308         "enveloped content test streaming PEM format, KEK, key only",
309         "-encrypt -in smcont.txt -outform PEM -aes128"
310           . " -stream -out test.cms "
311           . " -secretkey 000102030405060708090A0B0C0D0E0F "
312           . " -secretkeyid C0FEE0",
313         "-decrypt -in test.cms -out smtst.txt -inform PEM"
314           . " -secretkey 000102030405060708090A0B0C0D0E0F "
315     ],
316
317     [
318         "data content test streaming PEM format",
319         "-data_create -in smcont.txt -outform PEM -nodetach"
320           . " -stream -out test.cms",
321         "-data_out -in test.cms -inform PEM -out smtst.txt"
322     ],
323
324     [
325         "encrypted content test streaming PEM format, 128 bit RC2 key",
326         "\"-EncryptedData_encrypt\" -in smcont.txt -outform PEM"
327           . " -rc2 -secretkey 000102030405060708090A0B0C0D0E0F"
328           . " -stream -out test.cms",
329         "\"-EncryptedData_decrypt\" -in test.cms -inform PEM "
330           . " -secretkey 000102030405060708090A0B0C0D0E0F -out smtst.txt"
331     ],
332
333     [
334         "encrypted content test streaming PEM format, 40 bit RC2 key",
335         "\"-EncryptedData_encrypt\" -in smcont.txt -outform PEM"
336           . " -rc2 -secretkey 0001020304"
337           . " -stream -out test.cms",
338         "\"-EncryptedData_decrypt\" -in test.cms -inform PEM "
339           . " -secretkey 0001020304 -out smtst.txt"
340     ],
341
342     [
343         "encrypted content test streaming PEM format, triple DES key",
344         "\"-EncryptedData_encrypt\" -in smcont.txt -outform PEM"
345           . " -des3 -secretkey 000102030405060708090A0B0C0D0E0F1011121314151617"
346           . " -stream -out test.cms",
347         "\"-EncryptedData_decrypt\" -in test.cms -inform PEM "
348           . " -secretkey 000102030405060708090A0B0C0D0E0F1011121314151617"
349           . " -out smtst.txt"
350     ],
351
352     [
353         "encrypted content test streaming PEM format, 128 bit AES key",
354         "\"-EncryptedData_encrypt\" -in smcont.txt -outform PEM"
355           . " -aes128 -secretkey 000102030405060708090A0B0C0D0E0F"
356           . " -stream -out test.cms",
357         "\"-EncryptedData_decrypt\" -in test.cms -inform PEM "
358           . " -secretkey 000102030405060708090A0B0C0D0E0F -out smtst.txt"
359     ],
360
361 );
362
363 my @smime_cms_comp_tests = (
364
365     [
366         "compressed content test streaming PEM format",
367         "-compress -in smcont.txt -outform PEM -nodetach"
368           . " -stream -out test.cms",
369         "-uncompress -in test.cms -inform PEM -out smtst.txt"
370     ]
371
372 );
373
374 my @smime_cms_param_tests = (
375     [
376         "signed content test streaming PEM format, RSA keys, PSS signature",
377         "-sign -in smcont.txt -outform PEM -nodetach"
378           . " -signer $smdir/smrsa1.pem -keyopt rsa_padding_mode:pss"
379           . " -out test.cms",
380         "-verify -in test.cms -inform PEM "
381           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
382     ],
383
384     [
385         "signed content test streaming PEM format, RSA keys, PSS signature, no attributes",
386         "-sign -in smcont.txt -outform PEM -nodetach -noattr"
387           . " -signer $smdir/smrsa1.pem -keyopt rsa_padding_mode:pss"
388           . " -out test.cms",
389         "-verify -in test.cms -inform PEM "
390           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
391     ],
392
393     [
394         "signed content test streaming PEM format, RSA keys, PSS signature, SHA384 MGF1",
395         "-sign -in smcont.txt -outform PEM -nodetach"
396           . " -signer $smdir/smrsa1.pem -keyopt rsa_padding_mode:pss"
397           . " -keyopt rsa_mgf1_md:sha384 -out test.cms",
398         "-verify -in test.cms -inform PEM "
399           . " \"-CAfile\" $smdir/smroot.pem -out smtst.txt"
400     ],
401
402     [
403 "enveloped content test streaming S/MIME format, OAEP default parameters",
404         "-encrypt -in smcont.txt"
405           . " -stream -out test.cms"
406           . " -recip $smdir/smrsa1.pem -keyopt rsa_padding_mode:oaep",
407         "-decrypt -recip $smdir/smrsa1.pem -in test.cms -out smtst.txt"
408     ],
409
410     [
411 "enveloped content test streaming S/MIME format, OAEP SHA256",
412         "-encrypt -in smcont.txt"
413           . " -stream -out test.cms"
414           . " -recip $smdir/smrsa1.pem -keyopt rsa_padding_mode:oaep"
415           . " -keyopt rsa_oaep_md:sha256",
416         "-decrypt -recip $smdir/smrsa1.pem -in test.cms -out smtst.txt"
417     ],
418
419     [
420 "enveloped content test streaming S/MIME format, ECDH",
421         "-encrypt -in smcont.txt"
422           . " -stream -out test.cms"
423           . " -recip $smdir/smec1.pem",
424         "-decrypt -recip $smdir/smec1.pem -in test.cms -out smtst.txt"
425     ],
426
427     [
428 "enveloped content test streaming S/MIME format, ECDH, AES128, SHA256 KDF",
429         "-encrypt -in smcont.txt"
430           . " -stream -out test.cms"
431           . " -recip $smdir/smec1.pem -aes128 -keyopt ecdh_kdf_md:sha256",
432         "-decrypt -recip $smdir/smec1.pem -in test.cms -out smtst.txt"
433     ],
434
435     [
436 "enveloped content test streaming S/MIME format, ECDH, K-283, cofactor DH",
437         "-encrypt -in smcont.txt"
438           . " -stream -out test.cms"
439           . " -recip $smdir/smec2.pem -aes128"
440           . " -keyopt ecdh_kdf_md:sha256 -keyopt ecdh_cofactor_mode:1",
441         "-decrypt -recip $smdir/smec2.pem -in test.cms -out smtst.txt"
442     ],
443
444     [
445 "enveloped content test streaming S/MIME format, X9.42 DH",
446         "-encrypt -in smcont.txt"
447           . " -stream -out test.cms"
448           . " -recip $smdir/smdh.pem -aes128",
449         "-decrypt -recip $smdir/smdh.pem -in test.cms -out smtst.txt"
450     ]
451 );
452
453 print "CMS => PKCS#7 compatibility tests\n";
454
455 run_smime_tests( \$badcmd, \@smime_pkcs7_tests, $cmscmd, $pk7cmd );
456
457 print "CMS <= PKCS#7 compatibility tests\n";
458
459 run_smime_tests( \$badcmd, \@smime_pkcs7_tests, $pk7cmd, $cmscmd );
460
461 print "CMS <=> CMS consistency tests\n";
462
463 run_smime_tests( \$badcmd, \@smime_pkcs7_tests, $cmscmd, $cmscmd );
464 run_smime_tests( \$badcmd, \@smime_cms_tests,   $cmscmd, $cmscmd );
465
466 print "CMS <=> CMS consistency tests, modified key parameters\n";
467 run_smime_tests( \$badcmd, \@smime_cms_param_tests,   $cmscmd, $cmscmd );
468
469 if ( `$ossl_path version -f` =~ /ZLIB/ ) {
470     run_smime_tests( \$badcmd, \@smime_cms_comp_tests, $cmscmd, $cmscmd );
471 }
472 else {
473     print "Zlib not supported: compression tests skipped\n";
474 }
475
476 print "Running modified tests for OpenSSL 0.9.8 cms backport\n" if($ossl8);
477
478 if ($badcmd) {
479     print "$badcmd TESTS FAILED!!\n";
480 }
481 else {
482     print "ALL TESTS SUCCESSFUL.\n";
483 }
484
485 unlink "test.cms";
486 unlink "test2.cms";
487 unlink "smtst.txt";
488 unlink "cms.out";
489 unlink "cms.err";
490
491 sub run_smime_tests {
492     my ( $rv, $aref, $scmd, $vcmd ) = @_;
493
494     foreach $smtst (@$aref) {
495         my ( $tnam, $rscmd, $rvcmd ) = @$smtst;
496         if ($ossl8)
497                 {
498                 # Skip smime resign: 0.9.8 smime doesn't support -resign        
499                 next if ($scmd =~ /smime/ && $rscmd =~ /-resign/);
500                 # Disable streaming: option not supported in 0.9.8
501                 $tnam =~ s/streaming//; 
502                 $rscmd =~ s/-stream//;  
503                 $rvcmd =~ s/-stream//;
504                 }
505         if ($no_ec && $tnam =~ /ECDH/)
506                 {
507                 print "$tnam: skipped, EC disabled\n";
508                 next;
509                 }
510         if ($no_ec2m && $tnam =~ /K-283/)
511                 {
512                 print "$tnam: skipped, EC2M disabled\n";
513                 next;
514                 }
515         system("$scmd$rscmd$redir");
516         if ($?) {
517             print "$tnam: generation error\n";
518             $$rv++;
519             exit 1 if $halt_err;
520             next;
521         }
522         system("$vcmd$rvcmd$redir");
523         if ($?) {
524             print "$tnam: verify error\n";
525             $$rv++;
526             exit 1 if $halt_err;
527             next;
528         }
529         if (!cmp_files("smtst.txt", "smcont.txt")) {
530             print "$tnam: content verify error\n";
531             $$rv++;
532             exit 1 if $halt_err;
533             next;
534         }
535         print "$tnam: OK\n";
536     }
537 }
538
539 sub cmp_files {
540     use FileHandle;
541     my ( $f1, $f2 ) = @_;
542     my $fp1 = FileHandle->new();
543     my $fp2 = FileHandle->new();
544
545     my ( $rd1, $rd2 );
546
547     if ( !open( $fp1, "<$f1" ) ) {
548         print STDERR "Can't Open file $f1\n";
549         return 0;
550     }
551
552     if ( !open( $fp2, "<$f2" ) ) {
553         print STDERR "Can't Open file $f2\n";
554         return 0;
555     }
556
557     binmode $fp1;
558     binmode $fp2;
559
560     my $ret = 0;
561
562     for ( ; ; ) {
563         $n1 = sysread $fp1, $rd1, 4096;
564         $n2 = sysread $fp2, $rd2, 4096;
565         last if ( $n1 != $n2 );
566         last if ( $rd1 ne $rd2 );
567
568         if ( $n1 == 0 ) {
569             $ret = 1;
570             last;
571         }
572
573     }
574
575     close $fp1;
576     close $fp2;
577
578     return $ret;
579
580 }
581