summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/bss_null.c
diff options
context:
space:
mode:
authorjsing <>2014-04-15 16:37:22 +0000
committerjsing <>2014-04-15 16:37:22 +0000
commit405f0a76509e0e96df735b5b902a28b8ab6c9c55 (patch)
tree41dd30d546977ed0c409d7de59564fa1a2e3b100 /src/lib/libcrypto/bio/bss_null.c
parent4e5cf8d1c0be703d2956348c807ab6ac39172547 (diff)
downloadopenbsd-405f0a76509e0e96df735b5b902a28b8ab6c9c55.tar.gz
openbsd-405f0a76509e0e96df735b5b902a28b8ab6c9c55.tar.bz2
openbsd-405f0a76509e0e96df735b5b902a28b8ab6c9c55.zip
First pass at applying KNF to the OpenSSL code, which almost makes it
readable. This pass is whitespace only and can readily be verified using tr and md5.
Diffstat (limited to 'src/lib/libcrypto/bio/bss_null.c')
-rw-r--r--src/lib/libcrypto/bio/bss_null.c102
1 files changed, 55 insertions, 47 deletions
diff --git a/src/lib/libcrypto/bio/bss_null.c b/src/lib/libcrypto/bio/bss_null.c
index 46b73339df..51aed2ac4b 100644
--- a/src/lib/libcrypto/bio/bss_null.c
+++ b/src/lib/libcrypto/bio/bss_null.c
@@ -68,8 +68,8 @@ static int null_gets(BIO *h, char *str, int size);
68static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2); 68static long null_ctrl(BIO *h, int cmd, long arg1, void *arg2);
69static int null_new(BIO *h); 69static int null_new(BIO *h);
70static int null_free(BIO *data); 70static int null_free(BIO *data);
71static BIO_METHOD null_method= 71
72 { 72static BIO_METHOD null_method = {
73 BIO_TYPE_NULL, 73 BIO_TYPE_NULL,
74 "NULL", 74 "NULL",
75 null_write, 75 null_write,
@@ -80,50 +80,56 @@ static BIO_METHOD null_method=
80 null_new, 80 null_new,
81 null_free, 81 null_free,
82 NULL, 82 NULL,
83 }; 83};
84 84
85BIO_METHOD *BIO_s_null(void) 85BIO_METHOD
86 { 86*BIO_s_null(void)
87 return(&null_method); 87{
88 } 88 return (&null_method);
89}
89 90
90static int null_new(BIO *bi) 91static int
91 { 92null_new(BIO *bi)
92 bi->init=1; 93{
93 bi->num=0; 94 bi->init = 1;
94 bi->ptr=(NULL); 95 bi->num = 0;
95 return(1); 96 bi->ptr = (NULL);
96 } 97 return (1);
98}
97 99
98static int null_free(BIO *a) 100static int
99 { 101null_free(BIO *a)
100 if (a == NULL) return(0); 102{
101 return(1); 103 if (a == NULL)
102 } 104 return (0);
103 105 return (1);
104static int null_read(BIO *b, char *out, int outl) 106}
105 {
106 return(0);
107 }
108 107
109static int null_write(BIO *b, const char *in, int inl) 108static int
110 { 109null_read(BIO *b, char *out, int outl)
111 return(inl); 110{
112 } 111 return (0);
112}
113
114static int
115null_write(BIO *b, const char *in, int inl)
116{
117 return (inl);
118}
113 119
114static long null_ctrl(BIO *b, int cmd, long num, void *ptr) 120static long
115 { 121null_ctrl(BIO *b, int cmd, long num, void *ptr)
116 long ret=1; 122{
123 long ret = 1;
117 124
118 switch (cmd) 125 switch (cmd) {
119 {
120 case BIO_CTRL_RESET: 126 case BIO_CTRL_RESET:
121 case BIO_CTRL_EOF: 127 case BIO_CTRL_EOF:
122 case BIO_CTRL_SET: 128 case BIO_CTRL_SET:
123 case BIO_CTRL_SET_CLOSE: 129 case BIO_CTRL_SET_CLOSE:
124 case BIO_CTRL_FLUSH: 130 case BIO_CTRL_FLUSH:
125 case BIO_CTRL_DUP: 131 case BIO_CTRL_DUP:
126 ret=1; 132 ret = 1;
127 break; 133 break;
128 case BIO_CTRL_GET_CLOSE: 134 case BIO_CTRL_GET_CLOSE:
129 case BIO_CTRL_INFO: 135 case BIO_CTRL_INFO:
@@ -131,20 +137,22 @@ static long null_ctrl(BIO *b, int cmd, long num, void *ptr)
131 case BIO_CTRL_PENDING: 137 case BIO_CTRL_PENDING:
132 case BIO_CTRL_WPENDING: 138 case BIO_CTRL_WPENDING:
133 default: 139 default:
134 ret=0; 140 ret = 0;
135 break; 141 break;
136 }
137 return(ret);
138 } 142 }
143 return (ret);
144}
139 145
140static int null_gets(BIO *bp, char *buf, int size) 146static int
141 { 147null_gets(BIO *bp, char *buf, int size)
142 return(0); 148{
143 } 149 return (0);
144 150}
145static int null_puts(BIO *bp, const char *str)
146 {
147 if (str == NULL) return(0);
148 return(strlen(str));
149 }
150 151
152static int
153null_puts(BIO *bp, const char *str)
154{
155 if (str == NULL)
156 return (0);
157 return (strlen(str));
158}