Fix looking up DNS Name fields if the CN doesn't match the hostname.

There were two bugs:

* check_cn() aborted when the data read from the CN field wasn't exactly
  length of the hostname. What makes more sense to check here is to make
  sure that the number of bytes read matches the length of the buffer it
  was read into, cn_buf.
* check_san() didn't check any further DNS Names when the first didn't
  match as a wildcard name (the hostname needs to match on just one of
  the DNS Names, not all of them).