summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/sha/sha256.c
diff options
context:
space:
mode:
authorbeck <>2023-05-28 09:02:01 +0000
committerbeck <>2023-05-28 09:02:01 +0000
commitfa13c61b67163471b62143c6d6c5bf85974c2914 (patch)
tree7bfc6527c3c57631f84017c3a82e2c993e8e2077 /src/lib/libcrypto/sha/sha256.c
parenta95e36808ea4031670010ec297a8701fa0500aaa (diff)
downloadopenbsd-fa13c61b67163471b62143c6d6c5bf85974c2914.tar.gz
openbsd-fa13c61b67163471b62143c6d6c5bf85974c2914.tar.bz2
openbsd-fa13c61b67163471b62143c6d6c5bf85974c2914.zip
Refactor tls_check_common_name to use lower level API.
X509_NAME_get_text_by_NID is kind of a bad interface that we wish to make safer, and does not give us the visibility we really want here to detect hostile things. Instead call the lower level functions to do some better checking that should be done by X509_NAME_get_text_by_NID, but is not in the OpenSSL version. Specifically we will treat the input as hostile and fail if: 1) The certificate contains more than one CN in the subject. 2) The CN does not decode as UTF-8 3) The CN is of invalid length (must be between 1 and 64 bytes) 4) The CN contains a 0 byte 4) matches the existing logic, 1 and 2, and 3 are new checks. ok tb@
Diffstat (limited to 'src/lib/libcrypto/sha/sha256.c')
0 files changed, 0 insertions, 0 deletions