Branch Coverage

deps/libgit2/src/streams/openssl.c
Criterion Covered Total %
branch 7 140 5.0


line true false branch
61 0 86 if (!meth) {
188 0 0 if (git_stream_bio_method) {
193 0 0 if (git__ssl_ctx) {
270 0 86 if (!(git__ssl_ctx = SSL_CTX_new(SSLv23_method())))
276 0 86 if (!SSL_CTX_set_default_verify_paths(git__ssl_ctx))
279 86 0 if (!ciphers)
282 0 86 if(!SSL_CTX_set_cipher_list(git__ssl_ctx, ciphers))
285 0 86 if (init_bio_method() < 0)
348 0 0 if (!b)
375 0 0 if (cmd == BIO_CTRL_FLUSH)
398 0 86 GIT_ERROR_CHECK_ALLOC(git_stream_bio_method);
418 0 0 assert(err != SSL_ERROR_WANT_READ);
419 0 0 assert(err != SSL_ERROR_WANT_WRITE);
431 0 0 if (e > 0) {
436 0 0 } else if (error < 0) {
465 0 0 if (ret < 0)
475 0 0 if (!strcasecmp(name, host))
478 0 0 if (gitno__match_host(name, host) < 0)
497 0 0 if (SSL_get_verify_result(ssl) != X509_V_OK) {
503 0 0 if (p_inet_pton(AF_INET, host, &addr4)) {
507 0 0 if (p_inet_pton(AF_INET6, host, &addr6)) {
515 0 0 if (!cert) {
523 0 0 if (alts) {
527 0 0 for (i = 0; i < num && matched != 1; i++) {
0 0 for (i = 0; i < num && matched != 1; i++) {
533 0 0 if (gn->type != type)
536 0 0 if (type == GEN_DNS) {
538 0 0 if (memchr(name, '\0', namelen))
541 0 0 if (check_host_name(name, host) < 0)
545 0 0 } else if (type == GEN_IPADD) {
547 0 0 matched = addr && !!memcmp(name, addr, namelen);
0 0 matched = addr && !!memcmp(name, addr, namelen);
553 0 0 if (matched == 0)
556 0 0 if (matched == 1) {
562 0 0 if (peer_name == NULL)
565 0 0 if (peer_name) {
567 0 0 while ((j = X509_NAME_get_index_by_NID(peer_name, NID_commonName, i)) >= 0)
571 0 0 if (i < 0)
575 0 0 if (str == NULL)
579 0 0 if (ASN1_STRING_type(str) == V_ASN1_UTF8STRING) {
582 0 0 if (size > 0) {
584 0 0 GIT_ERROR_CHECK_ALLOC(peer_cn);
592 0 0 GIT_ERROR_CHECK_ALLOC(peer_cn);
593 0 0 if (memchr(peer_cn, '\0', size))
597 0 0 if (check_host_name((char *)peer_cn, host) < 0)
633 0 0 if (st->owned && (ret = git_stream_connect(st->io)) < 0)
0 0 if (st->owned && (ret = git_stream_connect(st->io)) < 0)
637 0 0 GIT_ERROR_CHECK_ALLOC(bio);
647 0 0 if ((ret = SSL_connect(st->ssl)) <= 0)
664 0 0 if (len < 0) {
671 0 0 GIT_ERROR_CHECK_ALLOC(encoded_cert);
676 0 0 if (len < 0) {
710 0 0 if ((ret = SSL_write(st->ssl, data, len)) <= 0)
721 0 0 if ((ret = SSL_read(st->ssl, data, len)) <= 0)
732 0 0 if (st->connected && (ret = ssl_teardown(st->ssl)) < 0)
0 0 if (st->connected && (ret = ssl_teardown(st->ssl)) < 0)
737 0 0 return st->owned ? git_stream_close(st->io) : 0;
744 0 0 if (st->owned)
761 0 0 assert(out && in && host);
0 0 assert(out && in && host);
0 0 assert(out && in && host);
764 0 0 GIT_ERROR_CHECK_ALLOC(st);
770 0 0 if (st->ssl == NULL) {
777 0 0 GIT_ERROR_CHECK_ALLOC(st->host);
804 0 0 assert(out && host && port);
0 0 assert(out && host && port);
0 0 assert(out && host && port);
806 0 0 if ((error = git_socket_stream_new(&stream, host, port)) < 0)
809 0 0 if ((error = openssl_stream_wrap(out, stream, host, 1)) < 0) {
819 0 0 if (SSL_CTX_load_verify_locations(git__ssl_ctx, file, path) == 0) {