]>
git.ipfire.org Git - thirdparty/openssl.git/blob - crypto/bio/bss_null.c
2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
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
13 #include "internal/cryptlib.h"
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 int null_new(BIO
*h
);
21 static int null_free(BIO
*data
);
22 static const BIO_METHOD null_method
= {
26 /* TODO: Convert to new style read function */
37 const BIO_METHOD
*BIO_s_null(void)
39 return (&null_method
);
42 static int null_new(BIO
*bi
)
50 static int null_free(BIO
*a
)
57 static int null_read(BIO
*b
, char *out
, int outl
)
62 static int null_write(BIO
*b
, const char *in
, int inl
)
67 static long null_ctrl(BIO
*b
, int cmd
, long num
, void *ptr
)
75 case BIO_CTRL_SET_CLOSE
:
80 case BIO_CTRL_GET_CLOSE
:
83 case BIO_CTRL_PENDING
:
84 case BIO_CTRL_WPENDING
:
92 static int null_gets(BIO
*bp
, char *buf
, int size
)
97 static int null_puts(BIO
*bp
, const char *str
)
101 return (strlen(str
));