comparison src/event/ngx_event_openssl.c @ 5779:e0eaf2d92a8c

SSL: let it build against LibreSSL. LibreSSL developers decided that LibreSSL is OpenSSL-2.0.0, so tests for OpenSSL-1.0.2+ are now passing, even though the library doesn't provide functions that are expected from that version of OpenSSL. Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
author Piotr Sikora <piotr@cloudflare.com>
date Wed, 30 Jul 2014 04:32:16 -0700
parents 45ed2f1f0a6a
children 275e35d54626
comparison
equal deleted inserted replaced
5778:45ed2f1f0a6a 5779:e0eaf2d92a8c
48 static int ngx_ssl_session_ticket_key_callback(ngx_ssl_conn_t *ssl_conn, 48 static int ngx_ssl_session_ticket_key_callback(ngx_ssl_conn_t *ssl_conn,
49 unsigned char *name, unsigned char *iv, EVP_CIPHER_CTX *ectx, 49 unsigned char *name, unsigned char *iv, EVP_CIPHER_CTX *ectx,
50 HMAC_CTX *hctx, int enc); 50 HMAC_CTX *hctx, int enc);
51 #endif 51 #endif
52 52
53 #if OPENSSL_VERSION_NUMBER < 0x10002002L 53 #if (OPENSSL_VERSION_NUMBER < 0x10002002L || defined LIBRESSL_VERSION_NUMBER)
54 static ngx_int_t ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *str); 54 static ngx_int_t ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *str);
55 #endif 55 #endif
56 56
57 static void *ngx_openssl_create_conf(ngx_cycle_t *cycle); 57 static void *ngx_openssl_create_conf(ngx_cycle_t *cycle);
58 static char *ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf); 58 static char *ngx_openssl_engine(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
2741 cert = SSL_get_peer_certificate(c->ssl->connection); 2741 cert = SSL_get_peer_certificate(c->ssl->connection);
2742 if (cert == NULL) { 2742 if (cert == NULL) {
2743 return NGX_ERROR; 2743 return NGX_ERROR;
2744 } 2744 }
2745 2745
2746 #if OPENSSL_VERSION_NUMBER >= 0x10002002L 2746 #if (OPENSSL_VERSION_NUMBER >= 0x10002002L && !defined LIBRESSL_VERSION_NUMBER)
2747 2747
2748 /* X509_check_host() is only available in OpenSSL 1.0.2+ */ 2748 /* X509_check_host() is only available in OpenSSL 1.0.2+ */
2749 2749
2750 if (name->len == 0) { 2750 if (name->len == 0) {
2751 goto failed; 2751 goto failed;
2858 X509_free(cert); 2858 X509_free(cert);
2859 return NGX_OK; 2859 return NGX_OK;
2860 } 2860 }
2861 2861
2862 2862
2863 #if OPENSSL_VERSION_NUMBER < 0x10002002L 2863 #if (OPENSSL_VERSION_NUMBER < 0x10002002L || defined LIBRESSL_VERSION_NUMBER)
2864 2864
2865 static ngx_int_t 2865 static ngx_int_t
2866 ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *pattern) 2866 ngx_ssl_check_name(ngx_str_t *name, ASN1_STRING *pattern)
2867 { 2867 {
2868 u_char *s, *p, *end; 2868 u_char *s, *p, *end;