| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/bio/bss_null.c |
| Source code | Switch to Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | /* | - | ||||||
| 2 | * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. | - | ||||||
| 3 | * | - | ||||||
| 4 | * Licensed under the OpenSSL license (the "License"). You may not use | - | ||||||
| 5 | * this file except in compliance with the License. You can obtain a copy | - | ||||||
| 6 | * in the file LICENSE in the source distribution or at | - | ||||||
| 7 | * https://www.openssl.org/source/license.html | - | ||||||
| 8 | */ | - | ||||||
| 9 | - | |||||||
| 10 | #include <stdio.h> | - | ||||||
| 11 | #include <errno.h> | - | ||||||
| 12 | #include "bio_lcl.h" | - | ||||||
| 13 | #include "internal/cryptlib.h" | - | ||||||
| 14 | - | |||||||
| 15 | static int null_write(BIO *h, const char *buf, int num); | - | ||||||
| 16 | static int null_read(BIO *h, char *buf, int size); | - | ||||||
| 17 | static int null_puts(BIO *h, const char *str); | - | ||||||
| 18 | static int null_gets(BIO *h, char *str, int size); | - | ||||||
| 19 | static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2); | - | ||||||
| 20 | static const BIO_METHOD null_method = { | - | ||||||
| 21 | BIO_TYPE_NULL, | - | ||||||
| 22 | "NULL", | - | ||||||
| 23 | /* TODO: Convert to new style write function */ | - | ||||||
| 24 | bwrite_conv, | - | ||||||
| 25 | null_write, | - | ||||||
| 26 | /* TODO: Convert to new style read function */ | - | ||||||
| 27 | bread_conv, | - | ||||||
| 28 | null_read, | - | ||||||
| 29 | null_puts, | - | ||||||
| 30 | null_gets, | - | ||||||
| 31 | null_ctrl, | - | ||||||
| 32 | NULL, | - | ||||||
| 33 | NULL, | - | ||||||
| 34 | NULL, /* null_callback_ctrl */ | - | ||||||
| 35 | }; | - | ||||||
| 36 | - | |||||||
| 37 | const BIO_METHOD *BIO_s_null(void) | - | ||||||
| 38 | { | - | ||||||
| 39 | return &null_method; executed 15602 times by 1 test: return &null_method;Executed by:
| 15602 | ||||||
| 40 | } | - | ||||||
| 41 | - | |||||||
| 42 | static int null_read(BIO *b, char *out, int outl) | - | ||||||
| 43 | { | - | ||||||
| 44 | return 0; never executed: return 0; | 0 | ||||||
| 45 | } | - | ||||||
| 46 | - | |||||||
| 47 | static int null_write(BIO *b, const char *in, int inl) | - | ||||||
| 48 | { | - | ||||||
| 49 | return inl; executed 12692627 times by 1 test: return inl;Executed by:
| 12692627 | ||||||
| 50 | } | - | ||||||
| 51 | - | |||||||
| 52 | static long null_ctrl(BIO *b, int cmd, long num, void *ptr) | - | ||||||
| 53 | { | - | ||||||
| 54 | long ret = 1; | - | ||||||
| 55 | - | |||||||
| 56 | switch (cmd) { | - | ||||||
| 57 | case BIO_CTRL_RESET: never executed: case 1: | 0 | ||||||
| 58 | case BIO_CTRL_EOF: never executed: case 2: | 0 | ||||||
| 59 | case BIO_CTRL_SET: never executed: case 4: | 0 | ||||||
| 60 | case BIO_CTRL_SET_CLOSE: never executed: case 9: | 0 | ||||||
| 61 | case BIO_CTRL_FLUSH: executed 14 times by 1 test: case 11:Executed by:
| 14 | ||||||
| 62 | case BIO_CTRL_DUP: never executed: case 12: | 0 | ||||||
| 63 | ret = 1; | - | ||||||
| 64 | break; executed 14 times by 1 test: break;Executed by:
| 14 | ||||||
| 65 | case BIO_CTRL_GET_CLOSE: never executed: case 8: | 0 | ||||||
| 66 | case BIO_CTRL_INFO: never executed: case 3: | 0 | ||||||
| 67 | case BIO_CTRL_GET: never executed: case 5: | 0 | ||||||
| 68 | case BIO_CTRL_PENDING: never executed: case 10: | 0 | ||||||
| 69 | case BIO_CTRL_WPENDING: never executed: case 13: | 0 | ||||||
| 70 | default: executed 21 times by 1 test: default:Executed by:
| 21 | ||||||
| 71 | ret = 0; | - | ||||||
| 72 | break; executed 21 times by 1 test: break;Executed by:
| 21 | ||||||
| 73 | } | - | ||||||
| 74 | return ret; executed 35 times by 1 test: return ret;Executed by:
| 35 | ||||||
| 75 | } | - | ||||||
| 76 | - | |||||||
| 77 | static int null_gets(BIO *bp, char *buf, int size) | - | ||||||
| 78 | { | - | ||||||
| 79 | return 0; never executed: return 0; | 0 | ||||||
| 80 | } | - | ||||||
| 81 | - | |||||||
| 82 | static int null_puts(BIO *bp, const char *str) | - | ||||||
| 83 | { | - | ||||||
| 84 | if (str == NULL)
| 0-5878878 | ||||||
| 85 | return 0; never executed: return 0; | 0 | ||||||
| 86 | return strlen(str); executed 5878878 times by 1 test: return strlen(str);Executed by:
| 5878878 | ||||||
| 87 | } | - | ||||||
| Source code | Switch to Preprocessed file |