defensive-coding-guide/pot/snippets/Features-TLS-Client-GNUTLS-Match.pot

47 lines
1.4 KiB
Text

#
# AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: 0\n"
"POT-Creation-Date: 2013-09-18T00:49:43\n"
"PO-Revision-Date: 2013-09-18T00:49:43\n"
"Last-Translator: Automatically generated\n"
"Language-Team: None\n"
"MIME-Version: 1.0\n"
"Content-Type: application/x-publican; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. Tag: programlisting
#, no-c-format
msgid "\n"
"// Match the peer certificate against the host name.\n"
"// We can only obtain a set of DER-encoded certificates from the\n"
"// session object, so we have to re-parse the peer certificate into\n"
"// a certificate object.\n"
"gnutls_x509_crt_t cert;\n"
"ret = gnutls_x509_crt_init(&amp;cert);\n"
"if (ret != GNUTLS_E_SUCCESS) {\n"
" fprintf(stderr, \"error: gnutls_x509_crt_init: %s\n"
"\",\n"
" gnutls_strerror(ret));\n"
" exit(1);\n"
"}\n"
"// The peer certificate is the first certificate in the list.\n"
"ret = gnutls_x509_crt_import(cert, certs, GNUTLS_X509_FMT_DER);\n"
"if (ret != GNUTLS_E_SUCCESS) {\n"
" fprintf(stderr, \"error: gnutls_x509_crt_import: %s\n"
"\",\n"
" gnutls_strerror(ret));\n"
" exit(1);\n"
"}\n"
"ret = gnutls_x509_crt_check_hostname(cert, host);\n"
"if (ret == 0 &amp;&amp; !certificate_host_name_override(certs[0], host)) {\n"
" fprintf(stderr, \"error: host name does not match certificate\n"
"\");\n"
" exit(1);\n"
"}\n"
"gnutls_x509_crt_deinit(cert);\n"
""
msgstr ""