Branch Coverage

amqp_openssl.c
Criterion Covered Total %
branch 54 190 28.4


line true false branch
91 0 18 if (-1 == self->sockfd) {
97 0 18 if (len > INT_MAX) {
107 0 18 if (0 >= res) {
136 0 30 if (-1 == self->sockfd) {
142 0 30 if (len > INT_MAX) {
150 15 15 if (0 >= received) {
179 0 1 if (-1 != self->sockfd) {
185 0 1 if (!self->ssl) {
192 0 1 if (AMQP_STATUS_OK != status) {
197 0 1 if (0 > self->sockfd) {
205 0 1 if (!bio) {
214 0 1 if (!status) {
222 2 1 if (status != 1) {
234 2 0 if (AMQP_STATUS_OK == status) {
242 1 0 if (self->verify_peer) {
243 0 1 if (!cert) {
250 0 1 if (X509_V_OK != result) {
256 1 0 if (self->verify_hostname) {
257 0 1 if (!cert) {
263 0 1 if (AMQP_HVR_MATCH_FOUND != amqp_ssl_validate_hostname(host, cert)) {
293 0 1 if (-1 == self->sockfd) {
297 1 0 if (AMQP_SC_NONE == force) {
305 0 1 if (amqp_os_socket_close(self->sockfd)) {
321 1 0 if (self) {
342 0 1 if (!self) {
352 0 1 if (status) {
357 0 1 if (!self->ctx) {
377 0 0 if (base->klass != &amqp_ssl_socket_class) {
386 0 1 if (base->klass != &amqp_ssl_socket_class) {
391 0 1 if (1 != status) {
401 0 0 if (base->klass != &amqp_ssl_socket_class) {
406 0 0 if (1 != status) {
410 0 0 if (1 != status) {
421 0 0 if (base->klass != &amqp_ssl_socket_class) {
426 0 0 if (1 != status) {
431 0 0 if (pkey == NULL) {
438 0 0 if (1 != status) {
455 0 0 if (base->klass != &amqp_ssl_socket_class) {
458 0 0 if (n > INT_MAX) {
463 0 0 if (1 != status) {
467 0 0 if (!buf) {
471 0 0 if (!rsa) {
475 0 0 if (1 != status) {
490 0 0 if (base->klass != &amqp_ssl_socket_class) {
495 0 0 if (1 != status) {
503 0 0 if (base->klass != &amqp_ssl_socket_class) {
518 0 0 if (base->klass != &amqp_ssl_socket_class) {
528 0 1 if (base->klass != &amqp_ssl_socket_class) {
539 0 0 if (base->klass != &amqp_ssl_socket_class) {
560 0 0 if (AMQP_TLSvLATEST == max) {
563 0 0 if (AMQP_TLSvLATEST == min) {
567 0 0 if (min > max) {
571 0 0 if (max > max_supported || min > max_supported) {
0 0 if (max > max_supported || min > max_supported) {
575 0 0 if (min > AMQP_TLSv1) {
579 0 0 if (min > AMQP_TLSv1_1 || max < AMQP_TLSv1_1) {
0 0 if (min > AMQP_TLSv1_1 || max < AMQP_TLSv1_1) {
584 0 0 if (max < AMQP_TLSv1_2) {
596 0 1 CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex));
598 1 0 if (openssl_connections == 0 && !openssl_initialized) {
1 0 if (openssl_connections == 0 && !openssl_initialized) {
601 0 1 CHECK_SUCCESS(pthread_mutex_unlock(&openssl_init_mutex));
610 28558 28558 if (mode & CRYPTO_LOCK) {
611 0 28558 CHECK_SUCCESS(pthread_mutex_lock(&amqp_openssl_lockarray[n]));
613 0 28558 CHECK_SUCCESS(pthread_mutex_unlock(&amqp_openssl_lockarray[n]));
622 0 1 if (!amqp_openssl_lockarray) {
626 41 1 for (i = 0; i < CRYPTO_num_locks(); i++) {
627 0 41 if (pthread_mutex_init(&amqp_openssl_lockarray[i], NULL)) {
629 0 0 for (j = 0; j < i; j++) {
658 0 0 CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex));
660 0 0 if (!openssl_initialized) {
662 0 0 if (status) {
670 0 0 CHECK_SUCCESS(pthread_mutex_unlock(&openssl_init_mutex));
676 0 0 CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex));
678 0 0 if (!openssl_initialized) {
683 0 0 if (openssl_engine != NULL) {
688 0 0 if (engine == NULL) {
694 0 0 if (openssl_engine == NULL) {
699 0 0 if (ENGINE_set_default(openssl_engine, ENGINE_METHOD_ALL) == 0) {
707 0 0 CHECK_SUCCESS(pthread_mutex_unlock(&openssl_init_mutex));
713 0 1 CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex));
715 1 0 if (do_initialize_openssl && !openssl_initialized) {
1 0 if (do_initialize_openssl && !openssl_initialized) {
717 0 1 if (status) {
723 1 0 if (!openssl_bio_initialized) {
725 0 1 if (status) {
734 0 1 CHECK_SUCCESS(pthread_mutex_unlock(&openssl_init_mutex));
739 0 1 CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex));
741 1 0 if (openssl_connections > 0) {
745 0 1 CHECK_SUCCESS(pthread_mutex_unlock(&openssl_init_mutex));
751 0 0 CHECK_SUCCESS(pthread_mutex_lock(&openssl_init_mutex));
753 0 0 if (openssl_connections > 0) {
769 0 0 for (i = 0; i < CRYPTO_num_locks(); i++) {
775 0 0 if (openssl_engine != NULL) {
793 0 0 CHECK_SUCCESS(pthread_mutex_unlock(&openssl_init_mutex));