VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.7/test/recipes/05-test_rand.t@ 106165

最後變更 在這個檔案從106165是 104078,由 vboxsync 提交於 8 月 前

openssl-3.1.5: Applied and adjusted our OpenSSL changes to 3.1.4. bugref:10638

檔案大小: 1.3 KB
 
1#! /usr/bin/env perl
2# Copyright 2015-2023 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
9use strict;
10use warnings;
11use OpenSSL::Test;
12use OpenSSL::Test::Utils;
13
14plan tests => 5;
15setup("test_rand");
16
17ok(run(test(["rand_test"])));
18ok(run(test(["drbgtest"])));
19ok(run(test(["rand_status_test"])));
20
21SKIP: {
22 skip "engine is not supported by this OpenSSL build", 2
23 if disabled("engine") || disabled("dynamic-engine");
24
25 my $success;
26 my @randdata;
27 my $expected = '0102030405060708090a0b0c0d0e0f10';
28
29 @randdata = run(app(['openssl', 'rand', '-engine', 'ossltest', '-hex', '16' ]),
30 capture => 1, statusvar => \$success);
31 chomp(@randdata);
32 ok($success && $randdata[0] eq $expected,
33 "rand with ossltest: Check rand output is as expected");
34
35 @randdata = run(app(['openssl', 'rand', '-engine', 'dasync', '-hex', '16' ]),
36 capture => 1, statusvar => \$success);
37 chomp(@randdata);
38 ok($success && length($randdata[0]) == 32,
39 "rand with dasync: Check rand output is of expected length");
40}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette