Quick demonstration - doing a statistics on first
decimal place digit of large number of time-stamps:

----- sample output:
...
### BEFORE:
0: 0%         <--- !
1:11%
2:11%
3:11%
4:10%
5:11%
6:11%
7:12%
8:12%
9:11%
### AFTER:
0:10%
1:10%
2:10%
3:10%
4:10%
5:10%
6:10%
7:10%
8:10%
9:10%

----- script:
#!/bin/sh

cp apps/openssl.cnf /tmp/ossl.cnf

cat <<EOF >> /tmp/ossl.cnf
[ tsa_test ]
basicConstraints=CA:TRUE
extendedKeyUsage=critical,timeStamping
[ tsr_test ]
clock_precision_digits  = 6
serial = /tmp/serial
default_policy = 2.999.0
digests = sha1
EOF

openssl req -x509 -newkey rsa:2048 -config /tmp/ossl.cnf -nodes -batch \
  -extensions tsa_test -out /tmp/tsa_.pem -keyout /tmp/tsa_.pem

for ossl in openssl /usr/local/ssl/bin/openssl; do
  [ $ossl = openssl ] && echo "### BEFORE:" || echo "### AFTER:"
  for i in `seq 1 2000`; do
    $ossl ts -reply -config /tmp/ossl.cnf -queryfile /tmp/x.tsq \
      -signer /tmp/tsa_.pem -inkey /tmp/tsa_.pem -section tsr_test \
      | openssl ts -reply -in /dev/stdin -text \
      | grep '^Time stamp'
  done 2>/tmp/osslerr.out | perl -ne \
    '/\.(\d)/;$h{$1}++}{for(0..9){printf"%i:%2.f%%\n",$_,100*$h{$_}/$.}'
done


______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to