summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorNiranjan Mallapadi <mrniranjan@redhat.com>2014-11-26 21:19:55 +0530
committerNiranjan Mallapadi <mrniranjan@redhat.com>2014-11-26 21:20:45 +0530
commit6b1d5758fd906e7f2b5a4b64a5318647af9d3836 (patch)
tree810c51db3c410195de4f595dc0e258e1f67776b3 /tests
parent3b7a8fcc533a212af06fa7a8b00dda01b57cc66a (diff)
downloadpki-6b1d5758fd906e7f2b5a4b64a5318647af9d3836.tar.gz
pki-6b1d5758fd906e7f2b5a4b64a5318647af9d3836.tar.xz
pki-6b1d5758fd906e7f2b5a4b64a5318647af9d3836.zip
Remove /dev/urandom from key-cli
Diffstat (limited to 'tests')
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-archive-kra.sh36
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-find-kra.sh16
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-generate-kra.sh192
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-kra.sh4
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-mod-kra.sh66
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-recover-kra.sh14
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-find-kra.sh18
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-review-kra.sh154
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-show-kra.sh14
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-retrieve-kra.sh12
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-show-kra.sh14
-rwxr-xr-xtests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-template-show-kra.sh2
12 files changed, 271 insertions, 271 deletions
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-archive-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-archive-kra.sh
index 3abbd00f9..c73833c16 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-archive-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-archive-kra.sh
@@ -84,8 +84,8 @@ run_pki-key-archive-kra_tests()
local key_request_review_output=$TmpDir/key-request-review.out
local key_retrieve_output=$TmpDir/key-retrieve.out
local cert_request_submit="$TEMP_NSS_DB/pki-cert-request-submit.out"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
- local tmp_passphrase=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
+ local tmp_passphrase=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local profile=caUserCert
@@ -103,7 +103,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-001: Create a passphrase archival request and verify by approving the request"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -142,9 +142,9 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-002: Create a passphrase archival request with passphrase containing special characters"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
- local tmp_passphrase=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
- local spl_characters=$(cat /dev/urandom | tr -dc '*?%^()+@!#{\}/-' | fold -w 10 | head -n 1)
+ local rand=$RANDOM
+ local tmp_passphrase=$(openssl rand -base64 50 | perl -p -e 's/\n//')
+ local spl_characters+="#%^*()"
local client_id=temp$rand
local passphrase=$tmp_passphrase-$spl_characters
local base64_passphrase=$(echo -n "$passphrase" | base64)
@@ -183,8 +183,8 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-003: Create a passphrase of 100 characters and verify by archiving the passphrase"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
- local tmp_passphrase=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 100 | head -n 1)
+ local rand=$RANDOM
+ local tmp_passphrase=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -226,7 +226,7 @@ run_pki-key-archive-kra_tests()
rlPhaseStartTest "pki_key_archive-004: Create a archival request of passphrase containing i18n characters"
for i in "${i18n_array[@]}"; do
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local passphrase=$i
local client_id=temp$rand
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -266,7 +266,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-005: Verify when no data is passed to --clientKeyId key-archive should fail with command help"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=''
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -288,7 +288,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-006: Verify when no data is passed to --passphrase key-archive should fail with command help"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=''
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -310,7 +310,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-007: creating passphrase archival request using Admin cert(not a member of agents group) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -325,7 +325,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-008: creating passphrase archival request using Revoked Agent cert(not a member of agents group) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -340,7 +340,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-009: creating passphrase archival request using Revoked Admin cert(not a member of agents group) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -405,7 +405,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-0012: creating passphrase archival request using valid Audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -420,7 +420,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-0013: creating passphrase archival request using valid operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -501,7 +501,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-0014: creating passphrase archival request using User (not a member of any group) Cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
@@ -516,7 +516,7 @@ run_pki-key-archive-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_archive-0015: creating passphrase archival request using host URI parameter(https)"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local base64_passphrase=$(echo -n $passphrase | base64)
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-find-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-find-kra.sh
index e98575cbc..c5c8dc5b4 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-find-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-find-kra.sh
@@ -74,9 +74,9 @@ run_pki-key-find-kra_tests()
local cert_info="$TmpDir/cert_info"
local key_find_output=$TmpDir/key-find.out
local key_generate_output=$TmpDir/key-generate.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local cert_request_submit="$TEMP_NSS_DB/pki-cert-request-submit.out"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local profile=caUserCert
# Config test of pki key-find
@@ -93,7 +93,7 @@ run_pki-key-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_find-001: Search keys with Valid clientId using Agent Cert"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -159,7 +159,7 @@ run_pki-key-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_find-005: Search keys with --maxResults 5 and verify 5 results are returned"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local maxResults=5
local algo=AES
@@ -297,7 +297,7 @@ run_pki-key-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_find-0015: Search keys with key status active using Agent Cert"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -326,7 +326,7 @@ run_pki-key-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_find-0016: Search keys with key status inactive using Agent Cert"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -455,7 +455,7 @@ run_pki-key-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_find-0023: Generate more than 100 keys and verify --size 105 returns 105 key results"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local size=105
local algo=AES
@@ -589,7 +589,7 @@ run_pki-key-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_find-0031: Searching keys using normal user cert(without any privileges) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local pki_user="idm1_user_$rand"
local pki_user_fullName="Idm1 User $rand"
local pki_pwd="Secret123"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-generate-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-generate-kra.sh
index 4b42a1625..91929bda4 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-generate-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-generate-kra.sh
@@ -74,9 +74,9 @@ run_pki-key-generate-kra_tests()
local expout="$TmpDir/exp_out"
local cert_info="$TmpDir/cert_info"
local key_generate_output=$TmpDir/key-generate.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local cert_request_submit="$TEMP_NSS_DB/pki-cert-request-submit.out"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local profile=caUserCert
# Config test of pki key-generate
@@ -131,7 +131,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-002: Generate symmetric keys with AES algo of size 192 with --usages unwrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=192
@@ -159,7 +159,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-003: Generate symmetric keys with AES algo of size 256 with --usages sign"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=256
@@ -187,7 +187,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-004: Generate symmetric keys with AES algo of size 128 with --usages verify"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -216,7 +216,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-005: Generate symmetric keys with AES algo of size 128 with --usages encrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -244,7 +244,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-006: Generate symmetric keys with AES algo of size 128 with --usages decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -272,7 +272,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-007: Generate symmetric keys with AES algo of size 128 with --usages wrap,unwrap,sign,encrypt,decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -301,7 +301,7 @@ run_pki-key-generate-kra_tests()
rlPhaseStartTest "pki_key_generate-008: Generate symmetric keys with AES algo of size 128 with --usages <no-data-passed>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -317,7 +317,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-009: Generate symmetric keys with AES algo of size 128 with --usages <junk data>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -333,7 +333,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0010: Generating symmetric keys with AES algo and invalid key size should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=1283323
@@ -349,7 +349,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0011: Generating symmetric keys with AES algo and negative key size should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=-128
@@ -366,7 +366,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0012: Generating symmetric keys with AES algo with no key size provided should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=
@@ -382,7 +382,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0013: Generating symmetric keys with AES algo with --usages wrap,unwrap,sign,encrypt,decrypt,junk-data should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -398,7 +398,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0014: Generating symmetric keys should fail when no client id is provided"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=
local algo=AES
local key_size=128
@@ -414,7 +414,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0015: Generate symmetric keys with AES algo with existing ClientID should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -440,7 +440,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0016: Generate symmetric keys with DES algo with --usages wrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=wrap
@@ -467,7 +467,7 @@ run_pki-key-generate-kra_tests()
rlPhaseStartTest "pki_key_generate-0017: Generate symmetric keys with DES algo with --usages unwrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=unwrap
@@ -493,7 +493,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0018: Generate symmetric keys with DES algo with --usages sign"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=sign
@@ -519,7 +519,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0019: Generate symmetric keys with DES algo with --usages verify"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=verify
@@ -546,7 +546,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0020: Generate symmetric keys with DES algo --usages encrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=encrypt
@@ -572,7 +572,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0021: Generate symmetric keys with DES algo with --usages decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=decrypt
@@ -598,7 +598,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0022: Generate symmetric keys with DES algo with --usages wrap,unwrap,sign,encrypt,decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -624,7 +624,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0023: Generate symmetric keys with DES algo with --usages <no-data-passed>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=
@@ -638,7 +638,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0024: Generate symmetric keys with DES algo with --usages <junk data>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=$tmp_junk_data
@@ -652,7 +652,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0025: Generating symmetric keys with DES algo with --usages wrap,unwrap,sign,encrypt,decrypt,junk-data should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=wrap,unwrap,sign,encrypt,decrypt,$tmp_junk_data
@@ -666,7 +666,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0026: Generating symmetric keys with DES algo should fail when no client id is provided"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=
local algo=DES
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -680,7 +680,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0027: Generate symmetric keys with DES algo with existing ClientID should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -703,7 +703,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0028: Generate symmetric keys with DES3 algo with --usages wrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=wrap
@@ -730,7 +730,7 @@ run_pki-key-generate-kra_tests()
rlPhaseStartTest "pki_key_generate-0029: Generate symmetric keys with DES3 algo with --usages unwrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=unwrap
@@ -756,7 +756,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0030: Generate symmetric keys with DES3 algo with --usages sign"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=unwrap
@@ -782,7 +782,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0031: Generate symmetric keys with DES3 algo with --usages verify"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=verify
@@ -809,7 +809,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0032: Generate symmetric keys with DES3 algo --usages encrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=encrypt
@@ -835,7 +835,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0033: Generate symmetric keys with DES3 algo with --usages decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=decrypt
@@ -861,7 +861,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0034: Generate symmetric keys with DES3 algo with --usages wrap,unwrap,sign,encrypt,decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -887,7 +887,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0035: Generate symmetric keys with DES3 algo with --usages <no-data-passed>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=
@@ -901,7 +901,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0036: Generate symmetric keys with DES3 algo with --usages <junk data>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=$tmp_junk_data
@@ -915,7 +915,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0037: Generating symmetric keys with DES3 algo with --usages wrap,unwrap,sign,encrypt,decrypt,junk-data should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=wrap,unwrap,sign,encrypt,decrypt,$tmp_junk_data
@@ -929,7 +929,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0038: Generating symmetric keys with DES3 algo should fail when no client id is provided"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=
local algo=DES3
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -943,7 +943,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0039: Generate symmetric keys with DES3 algo with existing ClientID should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DES3
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -966,7 +966,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0040: Generate symmetric keys with RC2 algo of size 128 with --usages wrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -994,7 +994,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0041: Generate symmetric keys with RC2 algo of size 192 with --usages unwrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=192
@@ -1022,7 +1022,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0042: Generate symmetric keys with RC2 algo of size 256 with --usages sign"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=256
@@ -1050,7 +1050,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0043: Generate symmetric keys with RC2 algo of size 128 with --usages verify"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1079,7 +1079,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0044: Generate symmetric keys with RC2 algo of size 128 with --usages encrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1107,7 +1107,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0045: Generate symmetric keys with RC2 algo of size 128 with --usages decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1135,7 +1135,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0046: Generate symmetric keys with RC2 algo of size 128 with --usages wrap,unwrap,sign,encrypt,decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1164,7 +1164,7 @@ run_pki-key-generate-kra_tests()
rlPhaseStartTest "pki_key_generate-0047: Generate symmetric keys with RC2 algo of size 128 with --usages <no-data-passed>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1180,7 +1180,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0048: Generate symmetric keys with RC2 algo of size 128 with --usages <junk data>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1196,7 +1196,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0049: Generating symmetric keys with RC2 algo and invalid key size should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=1283323
@@ -1212,7 +1212,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0050: Generating symmetric keys with RC2 algo using negative key size should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=-128
@@ -1229,7 +1229,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0051: Generating symmetric keys with RC2 algo with no key size provided should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=
@@ -1245,7 +1245,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0052: Generating symmetric keys with RC2 algo with --usages wrap,unwrap,sign,encrypt,decrypt,junk-data should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1261,7 +1261,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0053: Generating symmetric keys using RC2 should fail when no client id is provided"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=
local algo=RC2
local key_size=128
@@ -1277,7 +1277,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0054: Generate symmetric keys with RC2 algo with existing ClientID should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1303,7 +1303,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0055: Generate symmetric keys with RC2 algo with existing ClientID but with different key size should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=128
@@ -1330,7 +1330,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0056: Generate symmetric keys with RC4 algo of size 128 with --usages wrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1358,7 +1358,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0057: Generate symmetric keys with RC4 algo of size 192 with --usages unwrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=192
@@ -1386,7 +1386,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0058: Generate symmetric keys with RC4 algo of size 256 with --usages sign"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=256
@@ -1414,7 +1414,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0059: Generate symmetric keys with RC4 algo of size 128 with --usages verify"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1443,7 +1443,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0060: Generate symmetric keys with RC4 algo of size 128 with --usages encrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1471,7 +1471,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0061: Generate symmetric keys with RC4 algo of size 128 with --usages decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1499,7 +1499,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0062: Generate symmetric keys with RC4 algo of size 128 with --usages wrap,unwrap,sign,encrypt,decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1528,7 +1528,7 @@ run_pki-key-generate-kra_tests()
rlPhaseStartTest "pki_key_generate-0063: Generate symmetric keys with RC4 algo of size 128 with --usages <no-data-passed>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1544,7 +1544,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0064: Generate symmetric keys with RC4 algo of size 128 with --usages <junk data>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1560,7 +1560,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0065: Generating symmetric keys with RC4 algo and invalid key size should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC2
local key_size=1283abced
@@ -1576,7 +1576,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0066: Generating symmetric keys with RC4 algo and negative key size should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=-128
@@ -1593,7 +1593,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0067: Generating symmetric keys with RC4 algo with no key size provided should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=
@@ -1609,7 +1609,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0068: Generating symmetric keys with RC4 algo with --usages wrap,unwrap,sign,encrypt,decrypt,junk-data should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1625,7 +1625,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0069: Generating symmetric keys using RC4 should fail when no client id is provided"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=
local algo=RC4
local key_size=128
@@ -1641,7 +1641,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0070: Generate symmetric keys with RC4 algo with existing ClientID should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1667,7 +1667,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0071: Generate symmetric keys with RC4 algo with existing ClientID but with different key size should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=128
@@ -1694,7 +1694,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0072: Generate symmetric keys with RC4 algo with existing ClientID should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RC4
local key_size=256
@@ -1721,7 +1721,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0073: Generate symmetric keys with DESede algo with --usages wrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=wrap
@@ -1748,7 +1748,7 @@ run_pki-key-generate-kra_tests()
rlPhaseStartTest "pki_key_generate-0074: Generate symmetric keys with DESede algo with --usages unwrap"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=unwrap
@@ -1774,7 +1774,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0075: Generate symmetric keys with DESede algo with --usages sign"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=unwrap
@@ -1800,7 +1800,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0076: Generate symmetric keys with DESede algo with --usages verify"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=verify
@@ -1827,7 +1827,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0077: Generate symmetric keys with DESede algo --usages encrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=encrypt
@@ -1853,7 +1853,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0078: Generate symmetric keys with DESede algo with --usages decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=decrypt
@@ -1879,7 +1879,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0079: Generate symmetric keys with DESede algo with --usages wrap,unwrap,sign,encrypt,decrypt"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -1905,7 +1905,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0080: Generate symmetric keys with DESede algo with --usages <no-data-passed>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=
@@ -1919,7 +1919,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0081: Generate symmetric keys with DESede algo with --usages <junk data>"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=$tmp_junk_data
@@ -1933,7 +1933,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0082: Generating symmetric keys with DESede algo with --usages wrap,unwrap,sign,encrypt,decrypt,junk-data should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=wrap,unwrap,sign,encrypt,decrypt,$tmp_junk_data
@@ -1947,7 +1947,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0083: Generating symmetric keys with DESede algo should fail when no client id is provided"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=
local algo=DESede
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -1961,7 +1961,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0084: Generate symmetric keys with DESede algo with existing ClientID should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DESede
local usages=wrap,unwrap,sign,encrypt,decrypt
@@ -1984,7 +1984,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0085: Generating symmetric keys using valid admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2003,7 +2003,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0086: Generating symmetric keys using revoked Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2023,7 +2023,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0087: Generating symmetric keys using admin(not a member of Agents Group) cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2052,7 +2052,7 @@ run_pki-key-generate-kra_tests()
rlRun "chronyc -a -m 'offline' 'settime $end_date + 1 day' 'makestep' 'manual reset' 1> $TmpDir/chrony.out"
rlAssertGrep "200 OK" "$TmpDir/chrony.out"
rlLog "Date after modifying using chrony: $(date)"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2085,7 +2085,7 @@ run_pki-key-generate-kra_tests()
rlRun "chronyc -a -m 'offline' 'settime $end_date + 1 day' 'makestep' 'manual reset' 1> $TmpDir/chrony.out"
rlAssertGrep "200 OK" "$TmpDir/chrony.out"
rlLog "Date after modifying using chrony: $(date)"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2108,7 +2108,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0090: Generating symmetric key using valid audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2127,7 +2127,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0091: Generate symmetric key using valid operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2209,7 +2209,7 @@ run_pki-key-generate-kra_tests()
-c $CERTDB_DIR_PASSWORD -h $tmp_kra_host -p $target_unsecure_port \
-t kra user-cert-add $pki_user \
--input $TEMP_NSS_DB/$pki_user-out.pem 1> $TEMP_NSS_DB/pki_user_cert_add.out" 0 "Cert is added to the user $pki_user"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2228,7 +2228,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0093: Generate symmetric key using host URI parameter(https)"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2248,7 +2248,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0094:Generate symmetric key using valid user should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2266,7 +2266,7 @@ run_pki-key-generate-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_generate-0095: Generating symmetric key using in-valid user should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-kra.sh
index cfb3ecee0..06eb60bde 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-kra.sh
@@ -67,9 +67,9 @@ run_pki-key-kra_tests()
rlPhaseStartTest "pki_key001: pki key with junk characters should return invalid module"
local temp_out1="$TmpDir/pki_key001"
- local rand=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9*?$@#!%^&*()' | fold -w 40 | head -n 1)
+ local rand=$(openssl rand -base64 50 | perl -p -e 's/\n//')
rlLog "Executing pki cert \"$junk\" characters"
- rlRun "pki key \"$rand\" 2> $temp_out1" 1,255 "Command pki cert with junk characters"
+ rlRun "pki key \"$junk\" 2> $temp_out1" 1,255 "Command pki cert with junk characters"
rlAssertGrep "Error: Invalid module" "$temp_out1"
rlPhaseEnd
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-mod-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-mod-kra.sh
index fcd345b40..74a5319f4 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-mod-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-mod-kra.sh
@@ -77,9 +77,9 @@ run_pki-key-mod-kra_tests()
local key_show_output=$TmpDir/key-show.out
local key_mod_output=$TmpDir/key-mod.out
local key_archive_output=$TmpDir/key-archive.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local cert_request_submit="$TEMP_NSS_DB/pki-cert-request-submit.out"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
local profile=caUserCert
# Config test of pki key-mod
@@ -92,7 +92,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-001: Modifying the status of valid key of type SymmetricKey from active to Inactive should be successful"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -126,7 +126,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-002: Modifying the status of Valid key of type SymmetricKey from Inactive to Active should be successful"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -170,7 +170,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-003: Modifying the status of Rejected key of type Symmetric Key to active should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=reject
@@ -201,7 +201,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-004: Modifying the status of Rejected key of type Symmetric Key to inactive should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=reject
@@ -232,7 +232,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-005: Modifying the status of canceled key of type Symmetric Key to active should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=cancel
@@ -263,7 +263,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-006: Modifying the status of canceled key of type Symmetric Key to inactive should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=cancel
@@ -294,7 +294,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-007: Modifying the status of valid key from Active state to Unknown State(not inactive) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -324,7 +324,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-008: Modifying the status of valid key from Existing state to it's same existing should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -358,7 +358,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-009: Modifying the status of valid key of type securityDataEnrollment from active to Inactive should be successful"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=approve
@@ -391,7 +391,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0010: Modifying the status of Valid key of type securityDataEnrollment from Inactive to Active should be successful"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=approve
@@ -436,7 +436,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0011: Modifying the status of Rejected key of type securityDataEnrollment key to active should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=reject
@@ -461,7 +461,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0012: Modifying the status of Rejected key of type securityDataEnrollment key to in-active should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=reject
@@ -486,7 +486,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0013: Modifying the status of Canceled key of type securityDataEnrollment key to active should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=cancel
@@ -511,7 +511,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0014: Modifying the status of Canceled key of type securityDataEnrollment key to in-active should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=cancel
@@ -536,7 +536,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0015: Modifying the status of valid key of type securityDataEnrollment from active to Invalid State should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=approve
@@ -567,7 +567,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0016: Modifying the status of valid key of type securityDataEnrollment from Existing state to it's same state should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=approve
@@ -600,7 +600,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0017: Modifying the status of Key using Admin Cert(not a member of agent group) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -630,7 +630,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0018: Modifying the status of Key from Active to Inactive using Revoked Admin Cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -661,7 +661,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0019: Modifying the status of Key from Active to Inactive using Revoked Agent Cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -745,7 +745,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0022: Modifying the status of Key using audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -775,7 +775,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0023: Modifying the status of Key using operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -805,7 +805,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0024: Modifying the status of Key by connecting to KRA using https URI using valid agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -839,7 +839,7 @@ run_pki-key-mod-kra_tests()
rlPhaseStartTest "pki_key_mod-0025: Modifying the status of key using Normal user(Not a member of any group) cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local pki_user="idm1_user_$rand"
local pki_user_fullName="Idm1 User $rand"
local pki_pwd="Secret123"
@@ -937,7 +937,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0028: Modifying the status of valid key of type asymmetric from active to Inactive should be successful"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local action=approve
@@ -971,7 +971,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0029: Modifying the status of Valid key of type asymmetric from Inactive to Active should be successful"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local action=approve
@@ -1015,7 +1015,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0030: Modifying the status of Rejected key of type asymmetric to active should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local action=reject
@@ -1046,7 +1046,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0031: Modifying the status of Rejected key of type asymmetric to inactive should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local action=reject
@@ -1077,7 +1077,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0032: Modifying the status of canceled key of type asymmetric to active should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local action=cancel
@@ -1108,7 +1108,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0033: Modifying the status of Canceled key of type asymmetric to inactive should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local action=cancel
@@ -1139,7 +1139,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0034: Modifying the status of valid Asymmetric key from Active state to Unknown State(not inactive) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local action=approve
@@ -1169,7 +1169,7 @@ run_pki-key-mod-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_mod-0035: Modifying the status of valid Asymmetric key from Existing state to it's same existing should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local action=approve
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-recover-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-recover-kra.sh
index 97c09802d..6bb45c02f 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-recover-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-recover-kra.sh
@@ -74,9 +74,9 @@ run_pki-key-recover-kra_tests()
local key_generate_output=$TmpDir/key-generate.out
local key_archive_output=$TmpDir/key-archive.out
local key_recover_output=$TmpDir/key-recover.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
- local tmp_passphrase=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local rand=$RANDOM
+ local tmp_passphrase=$(openssl rand -base64 10 | perl -p -e 's/\n//')
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
# Config test of pki key-recover
rlPhaseStartTest "pki_key_cli-configtest: pki key-recover --help configuration test"
@@ -89,7 +89,7 @@ run_pki-key-recover-kra_tests()
rlPhaseEnd
rlPhaseStartSetup "Generate Approved Symmetric key"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -120,7 +120,7 @@ run_pki-key-recover-kra_tests()
rlPhaseEnd
rlPhaseStartSetup "Generate Approve Asymmetric Keys"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local action=approve
@@ -151,7 +151,7 @@ run_pki-key-recover-kra_tests()
rlPhaseEnd
rlPhaseStartSetup "Archive Passphrase in KRA"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local action=approve
@@ -235,7 +235,7 @@ run_pki-key-recover-kra_tests()
rlPhaseStartSetup: "Generate symmetric key"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-find-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-find-kra.sh
index aa43f1fb2..c8680d2b0 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-find-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-find-kra.sh
@@ -75,9 +75,9 @@ run_pki-key-request-find-kra_tests()
local key_request_find_output=$TmpDir/key-request-find.out
local key_generate_output=$TmpDir/key-generate.out
local key_archive_output=$TmpDir/key-archive.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local cert_request_submit="$TEMP_NSS_DB/pki-cert-request-submit.out"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
# Config test of pki key-request-find
rlPhaseStartTest "pki_key_cli-configtest: pki key-request-find --help configuration test"
@@ -94,7 +94,7 @@ run_pki-key-request-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_find-001: Search key requests with Valid clientId using Agent Cert"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=NULL
@@ -160,7 +160,7 @@ run_pki-key-request-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_find-005: Search key requests with --maxResults 5 and verify 5 results are returned"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local maxResults=5
local algo=AES
@@ -301,7 +301,7 @@ run_pki-key-request-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_find-0015: Search key requests with key status complete using Agent Cert"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=NULL
@@ -421,7 +421,7 @@ run_pki-key-request-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_find-0022: Generate more than 100 key requests and verify --pageSize 105 returns 105 key results"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local size=105
local algo=AES
@@ -578,7 +578,7 @@ run_pki-key-request-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_find-0032: Searching key requests using normal user cert(without any privileges) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local pki_user="idm1_user_$rand"
local pki_user_fullName="Idm1 User $rand"
local pki_pwd="Secret123"
@@ -688,7 +688,7 @@ run_pki-key-request-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_find-0036: Searching key request of type symkeyGenRequest using agent cert"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local req_type=symkeyGenRequest
local client_id=temp$rand
local algo=AES
@@ -712,7 +712,7 @@ run_pki-key-request-find-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_find-0037: Searching key request of type securityDataEnrollment using agent cert"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local req_type=securityDataEnrollment
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-review-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-review-kra.sh
index 2d817720a..1b6a1c94e 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-review-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-review-kra.sh
@@ -75,9 +75,9 @@ run_pki-key-request-review-kra_tests()
local key_archive_output=$TmpDir/key-archive.out
local key_recover_output=$TmpDir/key-recover.out
local key_request_review_output=$TmpDir/key-request-review.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
- local tmp_passphrase=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local rand=$RANDOM
+ local tmp_passphrase=$(openssl rand -base64 10 | perl -p -e 's/\n//')
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
# Config test of pki key-request-review
@@ -90,7 +90,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-001: Approving symmetric key archival request as valid agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -123,7 +123,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-002: Rejecting symmetric key archival request as valid agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -156,7 +156,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-003: Canceling symmetric key archival requestas as valid agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -189,7 +189,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-004: Specifying invalid action to symmetric key archival request should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -224,7 +224,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-005: Approving assymmetric key archival request as valid agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -257,7 +257,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-006: Rejecting asymmetric key archival request by agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -290,7 +290,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-007: Canceling asymmetric key archival request by agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -323,7 +323,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-008: Passing invalid action to asymetric key archival request should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local key_size=512
@@ -358,7 +358,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-009: Approving passphrase archival request by agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=approve
@@ -388,7 +388,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0010: Rejecting passphrase archival request by agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=reject
@@ -418,7 +418,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0011: Canceling passphrase archival request by agent cert should succeed"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=cancel
@@ -448,7 +448,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0012: Pass invalid action to passphrase archival request should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=invalid_request
@@ -481,7 +481,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0013: Approving symmetric key archival request by admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -513,7 +513,7 @@ run_pki-key-request-review-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0014: Approving symmetric key archival request by Revoked Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -546,7 +546,7 @@ run_pki-key-request-review-kra_tests()
exit 1;
rlPhaseStartTest "pki_request_review-0015: Approving symmetric key archival request by Revoked Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -578,7 +578,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0016: Approving symmetric key archival request by Expired Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -624,7 +624,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0017: Approving symmetric key archival request by Expired Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -670,7 +670,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0018: Approving symmetric key archival request by Audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -702,7 +702,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0019: Approving symmetric key archival request by operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -800,7 +800,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0020: Approving symmetric key archival request by Normal user cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -877,7 +877,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0023: Approving asymmetric key archival request by admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local key_size=512
@@ -909,7 +909,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0024: Approving asymmetric key archival request by Revoked agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -941,7 +941,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0025: Approving asymmetric key archival request by Revoked admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -973,7 +973,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0026: Approving asymmetric key archival request by Expired agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1019,7 +1019,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0027: Approving asymmetric key archival request by Expired admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1065,7 +1065,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0028: Approving asymmetric key archival request by audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1097,7 +1097,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0029: Approving asymmetric key archival request by operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1129,7 +1129,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0030: Approving asymmetric key archival request by Normal User cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1225,7 +1225,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0034: Approving passphrase archival request admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=approve
@@ -1255,7 +1255,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0035: Approving passphrase archival request by Revoked Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=approve
@@ -1285,7 +1285,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0036: Approving passphrase archival request by Revoked Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=approve
@@ -1453,7 +1453,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0046: Rejecting symmetric key archival request by admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -1485,7 +1485,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0047: Rejecting symmetric archival request by Revoked Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -1517,7 +1517,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0048: Rejecting symmetric key archival request by Revoked Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -1549,7 +1549,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0049: Rejecting symmetric key archival request by Expired Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -1595,7 +1595,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0050: Rejecting symmetric key archival request by Expired Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -1641,7 +1641,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0051: Rejecting symmetric key archival request by Audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -1673,7 +1673,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0052: Rejecting symmetric key archival request by operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -1705,7 +1705,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0053: Rejecting symmetric key archival request by Normal user cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -1780,7 +1780,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0056: Rejecting asymmetric key archival request by admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local key_size=512
@@ -1812,7 +1812,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0057: Rejecting asymmetric key archival request by Revoked agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1844,7 +1844,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0058: Rejecting asymmetric key archival request by Revoked admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1876,7 +1876,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0059: Rejecting asymmetric key archival request by Expired agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1922,7 +1922,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0060: Rejecting asymmetric key archival request by Expired admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -1968,7 +1968,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0061: Rejecting asymmetric key archival request by audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2000,7 +2000,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0062: Rejecting asymmetric key archival request by operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2032,7 +2032,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0063: Rejecting asymmetric key archival request by Normal User cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2131,7 +2131,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0067: Rejecting passphrase archival request admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=reject
@@ -2161,7 +2161,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0068: Rejecting passphrase archival request by Revoked Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=reject
@@ -2191,7 +2191,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0069: Rejecting passphrase archival request by Revoked Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=reject
@@ -2399,7 +2399,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0078: Canceling symmetric key archival request by admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2431,7 +2431,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0079: Canceling symmetric archival request by Revoked Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2463,7 +2463,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0080: Canceling symmetric key archival request by Revoked Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2495,7 +2495,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0081: Canceling symmetric key archival request by Expired Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2541,7 +2541,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0082: Canceling symmetric key archival request by Expired Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2587,7 +2587,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0083: Canceling symmetric key archival request by Audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2619,7 +2619,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0084: Canceling symmetric key archival request by operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2651,7 +2651,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0085: Canceling symmetric key archival request by Normal user cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local key_size=128
@@ -2728,7 +2728,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0088: Canceling asymmetric key archival request by admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local key_size=512
@@ -2760,7 +2760,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0089: Canceling asymmetric key archival request by Revoked agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2792,7 +2792,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0090: Canceling asymmetric key archival request by Revoked admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2824,7 +2824,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0091: Canceling asymmetric key archival request by Expired agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2870,7 +2870,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0092: Canceling asymmetric key archival request by Expired admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2916,7 +2916,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0093: Canceling asymmetric key archival request by audit cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2948,7 +2948,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0094: Canceling asymmetric key archival request by operator cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -2980,7 +2980,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0095: Canceling asymmetric key archival request by Normal User cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local key_size=2048
@@ -3079,7 +3079,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0099: Canceling passphrase archival request admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=cancel
@@ -3109,7 +3109,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0101: Canceling passphrase archival request by Revoked Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=cancel
@@ -3139,7 +3139,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0102: Canceling passphrase archival request by Revoked Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=$tmp_passphrase
local request_action=cancel
@@ -3350,7 +3350,7 @@ exit 1;
rlPhaseStartSetup "Generate Approved Symmetric key"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -3397,7 +3397,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartSetup "Generate Approved Asymmetric key"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=RSA
local action=approve
@@ -3440,7 +3440,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0113: Approving Recovery request by Revoked Agent cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=DSA
local action=approve
@@ -3480,7 +3480,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartTest "pki_request_review-0114: Approving Recovery request by Revoked Admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -3520,7 +3520,7 @@ exit 1;
rlPhaseEnd
rlPhaseStartSetup "Generate Approved Symmetric key"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-show-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-show-kra.sh
index 1c74aa15c..f323fd880 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-show-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-request-show-kra.sh
@@ -78,8 +78,8 @@ run_pki-key-request-show-kra_tests()
local key_archive_output=$TmpDir/key-archive.out
local key_request_show_output=$TmpDir/key-request-show.out
local tmp_request_review_out=$TmpDir/key-request-review.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local rand=$RANDOM
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
# Config test of pki key-request-show
rlPhaseStartTest "pki_key_request_show_cli-configtest: pki key-request-show --help configuration test"
@@ -89,7 +89,7 @@ run_pki-key-request-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_show-001: pki key-request-show < valid Request ID(hexadecimal) > should show key details"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=NULL
@@ -112,7 +112,7 @@ run_pki-key-request-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_show-002: pki key-request-show < valid Request ID(decimal) > should show key details"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=NULL
@@ -163,7 +163,7 @@ run_pki-key-request-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_show-005: Archive a passphrase and issue pki key-request-show against the Request ID to verify the output is correct"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local req_type=securityDataEnrollment
@@ -190,7 +190,7 @@ run_pki-key-request-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_show-006: Executing pki key-request-show <Request ID> using valid admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=NULL
@@ -293,7 +293,7 @@ run_pki-key-request-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_request_show-0012: Executing pki key-request-show <Request ID> using normal user cert(without any privileges) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local pki_user="idm1_user_$rand"
local pki_user_fullName="Idm1 User $rand"
local pki_pwd="Secret123"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-retrieve-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-retrieve-kra.sh
index c28a170d3..1d887b50f 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-retrieve-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-retrieve-kra.sh
@@ -75,9 +75,9 @@ run_pki-key-retrieve-kra_tests()
local key_recover_output=$TmpDir/key-recover.out
local key_ret_output=$TmpDir/key-retrieve.out
local key_store=$TmpDir/key-store.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
- local tmp_passphrase=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 10 | head -n 1)
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local rand=$RANDOM
+ local tmp_passphrase=$(openssl rand -base64 10 | perl -p -e 's/\n//')
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
# Config test of pki key-recover
@@ -97,7 +97,7 @@ run_pki-key-retrieve-kra_tests()
rlPhaseEnd
rlPhaseStartSetup "Generate a approved symmetric key and archive it"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo_1=AES
local action=approve
@@ -124,7 +124,7 @@ run_pki-key-retrieve-kra_tests()
rlPhaseEnd
rlPhaseStartSetup "Generate asymmetric keys and archive"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo_2=RSA
local action=approve
@@ -151,7 +151,7 @@ run_pki-key-retrieve-kra_tests()
rlPhaseEnd
rlPhaseStartSetup "Archive Passphrase in KRA"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase_1=Secret123
local action=approve
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-show-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-show-kra.sh
index a741d9e3a..28af257ce 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-show-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-show-kra.sh
@@ -78,8 +78,8 @@ run_pki-key-show-kra_tests()
local key_archive_output=$TmpDir/key-archive.out
local key_show_output=$TmpDir/key-show.out
local tmp_request_review_out=$TmpDir/key-request-review.out
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local rand=$RANDOM
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
# Config test of pki key-show
rlPhaseStartTest "pki_key_show_cli-configtest: pki key-show --help configuration test"
@@ -89,7 +89,7 @@ run_pki-key-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_show-001: pki key-show < valid Key ID(hexadecimal) > should show key details"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -112,7 +112,7 @@ run_pki-key-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_show-002: pki key-show < valid Key ID(decimal) > should show key details"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -162,7 +162,7 @@ run_pki-key-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_show-005: Archive a passphrase and issue pki key-show against the Key ID to verify the output is correct"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local passphrase=Secret123
local req_type=securityDataEnrollment
@@ -195,7 +195,7 @@ run_pki-key-show-kra_tests()
rlAssertGrep "Owner: $valid_agent_cert" "$key_show_output"
rlPhaseEnd
rlPhaseStartTest "pki_key_show-006: Executing pki key-show <Key ID> using valid admin cert should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local client_id=temp$rand
local algo=AES
local action=approve
@@ -299,7 +299,7 @@ run_pki-key-show-kra_tests()
rlPhaseEnd
rlPhaseStartTest "pki_key_show-0012: Executing pki key-show <Key ID> using normal user cert(without any privileges) should fail"
- local rand=$(cat /dev/urandom | tr -dc '0-9' | fold -w 5 | head -n 1)
+ local rand=$RANDOM
local pki_user="idm1_user_$rand"
local pki_user_fullName="Idm1 User $rand"
local pki_pwd="Secret123"
diff --git a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-template-show-kra.sh b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-template-show-kra.sh
index ad6dcb90e..352d9ff8a 100755
--- a/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-template-show-kra.sh
+++ b/tests/dogtag/acceptance/cli-tests/pki-key-cli/pki-key-cli-template-show-kra.sh
@@ -44,7 +44,7 @@ run_pki-key-template-show-kra_tests()
rlPhaseEnd
local keytemplates=("retrieveKey" "generatekey" "archiveKey")
local temp_out1="$TmpDir/pki_key_template_show_001"
- local tmp_junk_data=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 200 | head -n 1)
+ local tmp_junk_data=$(openssl rand -base64 50 | perl -p -e 's/\n//')
rlPhaseStartTest "pki key-template-show --help Test: Show all the options of pki key-template-show"
local temp_out="$TmpDir/pki_key-template-show"