no need to grep the input when we're using awk (v2)

awk has an inbuilt version of grep, also truncate processing as soon
as we find what we're looking for

This version uses slightly different syntax that is compatible with old
awk
add caching of intermediate CA certificates
add ability to also save leaf certificates and untrusted ones
clean up the extracted certificate

the certificate extracted in the above way will contain some junk
from openssl s_client output we don't want like verification status
we can remove it ro reduce disk usage for saved certificates
use CApath for certificates and store certificates (v2)

CApath is about 20% faster than CAfile so use it, also
save the received certificates from the servers for later analysis
(proper hostname checking, looking for certificates sharing private key,
etc.)

Use the mechanism from cipherscan to find location of ca cert bundle
don't calculate sha sums for the certificates over and over

we can use cksum to calculate simple checksum much faster than
with using openssl, so we can compute sums only once
few less forks in the script

again, we can use arrays and a bit advanced awk syntax to reduce
the number of forks necessary to run the script
make handling of self signed certs more robust

openssl sometimes will print the filename, then the error, and finish
with OK, matching the colon and space prevents from considering such
certs to be valid
limit number of forks needed to speed up execution

bash has a built in regular expression processor, we can match
lines using =~

moreover, stuff that will match while being inside parentheses is
later available in the BASH_REMATCH array

the IFS (Internal Field Separator) by default includes space, tab and
new line, as such we can use it to split longer lines to separate
words, just as awk '{print $1}' can, just need to put the value to
an array for that

we also don't have to use $(echo $var) when assigning variables, $var
is enough

bash has also built in substitution engine, so we can do ${var/,/ & }
to switch all commas to ampersands when using the variable
Merge pull request #33 from tomato42/cipherscan-fixes-3

Cipherscan fixes, speedups and saving of certificates (v3)