summaryrefslogtreecommitdiff
path: root/src/lib/libssl
diff options
context:
space:
mode:
authorschwarze <>2015-02-14 14:09:01 +0000
committerschwarze <>2015-02-14 14:09:01 +0000
commit88853a20be023939d14cfde9e86a81bfcc75ef7b (patch)
tree14e96de4625e6c5d8612c27a513ebf5ed519b352 /src/lib/libssl
parent948b14a55ded39aea589e34e23c19085fd99cac5 (diff)
downloadopenbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.tar.gz
openbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.tar.bz2
openbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.zip
second batch of perlpod(1) to mdoc(7) conversion
Diffstat (limited to 'src/lib/libssl')
-rw-r--r--src/lib/libssl/src/doc/crypto/BF_set_key.pod107
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO.pod54
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_ctrl.pod128
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_base64.pod80
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod77
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_cipher.pod71
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_md.pod146
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_f_null.pod30
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_find_type.pod97
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_new.pod64
-rw-r--r--src/lib/libssl/src/doc/crypto/BIO_new_CMS.pod66
11 files changed, 0 insertions, 920 deletions
diff --git a/src/lib/libssl/src/doc/crypto/BF_set_key.pod b/src/lib/libssl/src/doc/crypto/BF_set_key.pod
deleted file mode 100644
index 7d2d96fc45..0000000000
--- a/src/lib/libssl/src/doc/crypto/BF_set_key.pod
+++ /dev/null
@@ -1,107 +0,0 @@
1=pod
2
3=head1 NAME
4
5BF_set_key, BF_encrypt, BF_decrypt, BF_ecb_encrypt, BF_cbc_encrypt,
6BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption
7
8=head1 SYNOPSIS
9
10 #include <openssl/blowfish.h>
11
12 void BF_set_key(BF_KEY *key, int len, const unsigned char *data);
13
14 void BF_ecb_encrypt(const unsigned char *in, unsigned char *out,
15 BF_KEY *key, int enc);
16 void BF_cbc_encrypt(const unsigned char *in, unsigned char *out,
17 long length, BF_KEY *schedule, unsigned char *ivec, int enc);
18 void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out,
19 long length, BF_KEY *schedule, unsigned char *ivec, int *num,
20 int enc);
21 void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out,
22 long length, BF_KEY *schedule, unsigned char *ivec, int *num);
23 const char *BF_options(void);
24
25 void BF_encrypt(BF_LONG *data,const BF_KEY *key);
26 void BF_decrypt(BF_LONG *data,const BF_KEY *key);
27
28=head1 DESCRIPTION
29
30This library implements the Blowfish cipher, which was invented and described
31by Counterpane (see http://www.counterpane.com/blowfish.html ).
32
33Blowfish is a block cipher that operates on 64 bit (8 byte) blocks of data.
34It uses a variable size key, but typically, 128 bit (16 byte) keys are
35considered good for strong encryption. Blowfish can be used in the same
36modes as DES (see L<des_modes(7)|des_modes(7)>). Blowfish is currently one
37of the faster block ciphers. It is quite a bit faster than DES, and much
38faster than IDEA or RC2.
39
40Blowfish consists of a key setup phase and the actual encryption or decryption
41phase.
42
43BF_set_key() sets up the B<BF_KEY> B<key> using the B<len> bytes long key
44at B<data>.
45
46BF_ecb_encrypt() is the basic Blowfish encryption and decryption function.
47It encrypts or decrypts the first 64 bits of B<in> using the key B<key>,
48putting the result in B<out>. B<enc> decides if encryption (B<BF_ENCRYPT>)
49or decryption (B<BF_DECRYPT>) shall be performed. The vector pointed at by
50B<in> and B<out> must be 64 bits in length, no less. If they are larger,
51everything after the first 64 bits is ignored.
52
53The mode functions BF_cbc_encrypt(), BF_cfb64_encrypt() and BF_ofb64_encrypt()
54all operate on variable length data. They all take an initialization vector
55B<ivec> which needs to be passed along into the next call of the same function
56for the same message. B<ivec> may be initialized with anything, but the
57recipient needs to know what it was initialized with, or it won't be able
58to decrypt. Some programs and protocols simplify this, like SSH, where
59B<ivec> is simply initialized to zero.
60BF_cbc_encrypt() operates on data that is a multiple of 8 bytes long, while
61BF_cfb64_encrypt() and BF_ofb64_encrypt() are used to encrypt an variable
62number of bytes (the amount does not have to be an exact multiple of 8). The
63purpose of the latter two is to simulate stream ciphers, and therefore, they
64need the parameter B<num>, which is a pointer to an integer where the current
65offset in B<ivec> is stored between calls. This integer must be initialized
66to zero when B<ivec> is initialized.
67
68BF_cbc_encrypt() is the Cipher Block Chaining function for Blowfish. It
69encrypts or decrypts the 64 bits chunks of B<in> using the key B<schedule>,
70putting the result in B<out>. B<enc> decides if encryption (BF_ENCRYPT) or
71decryption (BF_DECRYPT) shall be performed. B<ivec> must point at an 8 byte
72long initialization vector.
73
74BF_cfb64_encrypt() is the CFB mode for Blowfish with 64 bit feedback.
75It encrypts or decrypts the bytes in B<in> using the key B<schedule>,
76putting the result in B<out>. B<enc> decides if encryption (B<BF_ENCRYPT>)
77or decryption (B<BF_DECRYPT>) shall be performed. B<ivec> must point at an
788 byte long initialization vector. B<num> must point at an integer which must
79be initially zero.
80
81BF_ofb64_encrypt() is the OFB mode for Blowfish with 64 bit feedback.
82It uses the same parameters as BF_cfb64_encrypt(), which must be initialized
83the same way.
84
85BF_encrypt() and BF_decrypt() are the lowest level functions for Blowfish
86encryption. They encrypt/decrypt the first 64 bits of the vector pointed by
87B<data>, using the key B<key>. These functions should not be used unless you
88implement 'modes' of Blowfish. The alternative is to use BF_ecb_encrypt().
89If you still want to use these functions, you should be aware that they take
90each 32-bit chunk in host-byte order, which is little-endian on little-endian
91platforms and big-endian on big-endian ones.
92
93=head1 RETURN VALUES
94
95None of the functions presented here return any value.
96
97=head1 NOTE
98
99Applications should use the higher level functions
100L<EVP_EncryptInit(3)|EVP_EncryptInit(3)> etc. instead of calling the
101blowfish functions directly.
102
103=head1 HISTORY
104
105The Blowfish functions are available in all versions of SSLeay and OpenSSL.
106
107=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO.pod b/src/lib/libssl/src/doc/crypto/BIO.pod
deleted file mode 100644
index f01ced7d8e..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO.pod
+++ /dev/null
@@ -1,54 +0,0 @@
1=pod
2
3=head1 NAME
4
5bio - I/O abstraction
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11
12=head1 DESCRIPTION
13
14A BIO is an I/O abstraction, it hides many of the underlying I/O
15details from an application. If an application uses a BIO for its
16I/O it can transparently handle SSL connections, unencrypted network
17connections and file I/O.
18
19There are two type of BIO, a source/sink BIO and a filter BIO.
20
21As its name implies a source/sink BIO is a source and/or sink of data,
22examples include a socket BIO and a file BIO.
23
24A filter BIO takes data from one BIO and passes it through to
25another, or the application. The data may be left unmodified (for
26example a message digest BIO) or translated (for example an
27encryption BIO). The effect of a filter BIO may change according
28to the I/O operation it is performing: for example an encryption
29BIO will encrypt data if it is being written to and decrypt data
30if it is being read from.
31
32BIOs can be joined together to form a chain (a single BIO is a chain
33with one component). A chain normally consist of one source/sink
34BIO and one or more filter BIOs. Data read from or written to the
35first BIO then traverses the chain to the end (normally a source/sink
36BIO).
37
38=head1 SEE ALSO
39
40L<BIO_ctrl(3)|BIO_ctrl(3)>,
41L<BIO_f_base64(3)|BIO_f_base64(3)>, L<BIO_f_buffer(3)|BIO_f_buffer(3)>,
42L<BIO_f_cipher(3)|BIO_f_cipher(3)>, L<BIO_f_md(3)|BIO_f_md(3)>,
43L<BIO_f_null(3)|BIO_f_null(3)>, L<BIO_f_ssl(3)|BIO_f_ssl(3)>,
44L<BIO_find_type(3)|BIO_find_type(3)>, L<BIO_new(3)|BIO_new(3)>,
45L<BIO_new_bio_pair(3)|BIO_new_bio_pair(3)>,
46L<BIO_push(3)|BIO_push(3)>, L<BIO_read(3)|BIO_read(3)>,
47L<BIO_s_accept(3)|BIO_s_accept(3)>, L<BIO_s_bio(3)|BIO_s_bio(3)>,
48L<BIO_s_connect(3)|BIO_s_connect(3)>, L<BIO_s_fd(3)|BIO_s_fd(3)>,
49L<BIO_s_file(3)|BIO_s_file(3)>, L<BIO_s_mem(3)|BIO_s_mem(3)>,
50L<BIO_s_null(3)|BIO_s_null(3)>, L<BIO_s_socket(3)|BIO_s_socket(3)>,
51L<BIO_set_callback(3)|BIO_set_callback(3)>,
52L<BIO_should_retry(3)|BIO_should_retry(3)>
53
54=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_ctrl.pod b/src/lib/libssl/src/doc/crypto/BIO_ctrl.pod
deleted file mode 100644
index 2271e52c9e..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_ctrl.pod
+++ /dev/null
@@ -1,128 +0,0 @@
1=pod
2
3=head1 NAME
4
5BIO_ctrl, BIO_callback_ctrl, BIO_ptr_ctrl, BIO_int_ctrl, BIO_reset,
6BIO_seek, BIO_tell, BIO_flush, BIO_eof, BIO_set_close, BIO_get_close,
7BIO_pending, BIO_wpending, BIO_ctrl_pending, BIO_ctrl_wpending,
8BIO_get_info_callback, BIO_set_info_callback - BIO control operations
9
10=head1 SYNOPSIS
11
12 #include <openssl/bio.h>
13
14 long BIO_ctrl(BIO *bp,int cmd,long larg,void *parg);
15 long BIO_callback_ctrl(BIO *b, int cmd, void (*fp)(struct bio_st *, int,
16 const char *, int, long, long));
17 char * BIO_ptr_ctrl(BIO *bp,int cmd,long larg);
18 long BIO_int_ctrl(BIO *bp,int cmd,long larg,int iarg);
19
20 int BIO_reset(BIO *b);
21 int BIO_seek(BIO *b, int ofs);
22 int BIO_tell(BIO *b);
23 int BIO_flush(BIO *b);
24 int BIO_eof(BIO *b);
25 int BIO_set_close(BIO *b,long flag);
26 int BIO_get_close(BIO *b);
27 int BIO_pending(BIO *b);
28 int BIO_wpending(BIO *b);
29 size_t BIO_ctrl_pending(BIO *b);
30 size_t BIO_ctrl_wpending(BIO *b);
31
32 int BIO_get_info_callback(BIO *b,bio_info_cb **cbp);
33 int BIO_set_info_callback(BIO *b,bio_info_cb *cb);
34
35 typedef void bio_info_cb(BIO *b, int oper, const char *ptr, int arg1,
36 long arg2, long arg3);
37
38=head1 DESCRIPTION
39
40BIO_ctrl(), BIO_callback_ctrl(), BIO_ptr_ctrl() and BIO_int_ctrl()
41are BIO "control" operations taking arguments of various types.
42These functions are not normally called directly, various macros
43are used instead. The standard macros are described below, macros
44specific to a particular type of BIO are described in the specific
45BIOs manual page as well as any special features of the standard
46calls.
47
48BIO_reset() typically resets a BIO to some initial state, in the case
49of file related BIOs for example it rewinds the file pointer to the
50start of the file.
51
52BIO_seek() resets a file related BIO's (that is file descriptor and
53FILE BIOs) file position pointer to B<ofs> bytes from start of file.
54
55BIO_tell() returns the current file position of a file related BIO.
56
57BIO_flush() normally writes out any internally buffered data, in some
58cases it is used to signal EOF and that no more data will be written.
59
60BIO_eof() returns 1 if the BIO has read EOF, the precise meaning of
61"EOF" varies according to the BIO type.
62
63BIO_set_close() sets the BIO B<b> close flag to B<flag>. B<flag> can
64take the value BIO_CLOSE or BIO_NOCLOSE. Typically BIO_CLOSE is used
65in a source/sink BIO to indicate that the underlying I/O stream should
66be closed when the BIO is freed.
67
68BIO_get_close() returns the BIOs close flag.
69
70BIO_pending(), BIO_ctrl_pending(), BIO_wpending() and BIO_ctrl_wpending()
71return the number of pending characters in the BIOs read and write buffers.
72Not all BIOs support these calls. BIO_ctrl_pending() and BIO_ctrl_wpending()
73return a size_t type and are functions, BIO_pending() and BIO_wpending() are
74macros which call BIO_ctrl().
75
76=head1 RETURN VALUES
77
78BIO_reset() normally returns 1 for success and 0 or -1 for failure. File
79BIOs are an exception, they return 0 for success and -1 for failure.
80
81BIO_seek() and BIO_tell() both return the current file position on success
82and -1 for failure, except file BIOs which for BIO_seek() always return 0
83for success and -1 for failure.
84
85BIO_flush() returns 1 for success and 0 or -1 for failure.
86
87BIO_eof() returns 1 if EOF has been reached 0 otherwise.
88
89BIO_set_close() always returns 1.
90
91BIO_get_close() returns the close flag value: BIO_CLOSE or BIO_NOCLOSE.
92
93BIO_pending(), BIO_ctrl_pending(), BIO_wpending() and BIO_ctrl_wpending()
94return the amount of pending data.
95
96=head1 NOTES
97
98BIO_flush(), because it can write data may return 0 or -1 indicating
99that the call should be retried later in a similar manner to BIO_write().
100The BIO_should_retry() call should be used and appropriate action taken
101is the call fails.
102
103The return values of BIO_pending() and BIO_wpending() may not reliably
104determine the amount of pending data in all cases. For example in the
105case of a file BIO some data may be available in the FILE structures
106internal buffers but it is not possible to determine this in a
107portably way. For other types of BIO they may not be supported.
108
109Filter BIOs if they do not internally handle a particular BIO_ctrl()
110operation usually pass the operation to the next BIO in the chain.
111This often means there is no need to locate the required BIO for
112a particular operation, it can be called on a chain and it will
113be automatically passed to the relevant BIO. However this can cause
114unexpected results: for example no current filter BIOs implement
115BIO_seek(), but this may still succeed if the chain ends in a FILE
116or file descriptor BIO.
117
118Source/sink BIOs return an 0 if they do not recognize the BIO_ctrl()
119operation.
120
121=head1 BUGS
122
123Some of the return values are ambiguous and care should be taken. In
124particular a return value of 0 can be returned if an operation is not
125supported, if an error occurred, if EOF has not been reached and in
126the case of BIO_seek() on a file BIO for a successful operation.
127
128=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod b/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod
deleted file mode 100644
index c1c3137d5e..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_f_base64.pod
+++ /dev/null
@@ -1,80 +0,0 @@
1=pod
2
3=head1 NAME
4
5BIO_f_base64 - base64 BIO filter
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10 #include <openssl/evp.h>
11
12 BIO_METHOD * BIO_f_base64(void);
13
14=head1 DESCRIPTION
15
16BIO_f_base64() returns the base64 BIO method. This is a filter
17BIO that base64 encodes any data written through it and decodes
18any data read through it.
19
20Base64 BIOs do not support BIO_gets() or BIO_puts().
21
22BIO_flush() on a base64 BIO that is being written through is
23used to signal that no more data is to be encoded: this is used
24to flush the final block through the BIO.
25
26The flag BIO_FLAGS_BASE64_NO_NL can be set with BIO_set_flags()
27to encode the data all on one line or expect the data to be all
28on one line.
29
30=head1 NOTES
31
32Because of the format of base64 encoding the end of the encoded
33block cannot always be reliably determined.
34
35=head1 RETURN VALUES
36
37BIO_f_base64() returns the base64 BIO method.
38
39=head1 EXAMPLES
40
41Base64 encode the string "Hello World\n" and write the result
42to standard output:
43
44 BIO *bio, *b64;
45 char message[] = "Hello World \n";
46
47 b64 = BIO_new(BIO_f_base64());
48 bio = BIO_new_fp(stdout, BIO_NOCLOSE);
49 BIO_push(b64, bio);
50 BIO_write(b64, message, strlen(message));
51 BIO_flush(b64);
52
53 BIO_free_all(b64);
54
55Read Base64 encoded data from standard input and write the decoded
56data to standard output:
57
58 BIO *bio, *b64, *bio_out;
59 char inbuf[512];
60 int inlen;
61
62 b64 = BIO_new(BIO_f_base64());
63 bio = BIO_new_fp(stdin, BIO_NOCLOSE);
64 bio_out = BIO_new_fp(stdout, BIO_NOCLOSE);
65 BIO_push(b64, bio);
66 while((inlen = BIO_read(b64, inbuf, 512)) > 0)
67 BIO_write(bio_out, inbuf, inlen);
68
69 BIO_flush(bio_out);
70 BIO_free_all(b64);
71
72=head1 BUGS
73
74The ambiguity of EOF in base64 encoded data can cause additional
75data following the base64 encoded block to be misinterpreted.
76
77There should be some way of specifying a test that the BIO can perform
78to reliably determine EOF (for example a MIME boundary).
79
80=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod b/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod
deleted file mode 100644
index f4ddd3a2cf..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_f_buffer.pod
+++ /dev/null
@@ -1,77 +0,0 @@
1=pod
2
3=head1 NAME
4
5BIO_f_buffer - buffering BIO
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO_METHOD * BIO_f_buffer(void);
12
13 #define BIO_get_buffer_num_lines(b) BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL)
14 #define BIO_set_read_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0)
15 #define BIO_set_write_buffer_size(b,size) BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1)
16 #define BIO_set_buffer_size(b,size) BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL)
17 #define BIO_set_buffer_read_data(b,buf,num) BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
18
19=head1 DESCRIPTION
20
21BIO_f_buffer() returns the buffering BIO method.
22
23Data written to a buffering BIO is buffered and periodically written
24to the next BIO in the chain. Data read from a buffering BIO comes from
25an internal buffer which is filled from the next BIO in the chain.
26Both BIO_gets() and BIO_puts() are supported.
27
28Calling BIO_reset() on a buffering BIO clears any buffered data.
29
30BIO_get_buffer_num_lines() returns the number of lines currently buffered.
31
32BIO_set_read_buffer_size(), BIO_set_write_buffer_size() and
33BIO_set_buffer_size() set the read, write or both read and write buffer sizes
34to B<size>. The initial buffer size is DEFAULT_BUFFER_SIZE, currently 4096. Any
35attempt to reduce the buffer size below DEFAULT_BUFFER_SIZE is ignored. Any
36buffered data is cleared when the buffer is resized.
37
38BIO_set_buffer_read_data() clears the read buffer and fills it with B<num>
39bytes of B<buf>. If B<num> is larger than the current buffer size the buffer
40is expanded.
41
42=head1 NOTES
43
44Buffering BIOs implement BIO_gets() by using BIO_read() operations on the
45next BIO in the chain. By prepending a buffering BIO to a chain it is therefore
46possible to provide BIO_gets() functionality if the following BIOs do not
47support it (for example SSL BIOs).
48
49Data is only written to the next BIO in the chain when the write buffer fills
50or when BIO_flush() is called. It is therefore important to call BIO_flush()
51whenever any pending data should be written such as when removing a buffering
52BIO using BIO_pop(). BIO_flush() may need to be retried if the ultimate
53source/sink BIO is non blocking.
54
55=head1 RETURN VALUES
56
57BIO_f_buffer() returns the buffering BIO method.
58
59BIO_get_buffer_num_lines() returns the number of lines buffered (may be 0).
60
61BIO_set_read_buffer_size(), BIO_set_write_buffer_size() and
62BIO_set_buffer_size() return 1 if the buffer was successfully resized or 0 for
63failure.
64
65BIO_set_buffer_read_data() returns 1 if the data was set correctly or 0 if
66there was an error.
67
68=head1 SEE ALSO
69
70L<BIO(3)|BIO(3)>,
71L<BIO_reset(3)|BIO_reset(3)>,
72L<BIO_flush(3)|BIO_flush(3)>,
73L<BIO_pop(3)|BIO_pop(3)>,
74L<BIO_ctrl(3)|BIO_ctrl(3)>,
75L<BIO_int_ctrl(3)|BIO_ctrl(3)>
76
77=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_cipher.pod b/src/lib/libssl/src/doc/crypto/BIO_f_cipher.pod
deleted file mode 100644
index 0afd30fb2a..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_f_cipher.pod
+++ /dev/null
@@ -1,71 +0,0 @@
1=pod
2
3=head1 NAME
4
5BIO_f_cipher, BIO_set_cipher, BIO_get_cipher_status, BIO_get_cipher_ctx -
6cipher BIO filter
7
8=head1 SYNOPSIS
9
10 #include <openssl/bio.h>
11 #include <openssl/evp.h>
12
13 BIO_METHOD * BIO_f_cipher(void);
14 void BIO_set_cipher(BIO *b,const EVP_CIPHER *cipher,
15 unsigned char *key, unsigned char *iv, int enc);
16 int BIO_get_cipher_status(BIO *b)
17 int BIO_get_cipher_ctx(BIO *b, EVP_CIPHER_CTX **pctx)
18
19=head1 DESCRIPTION
20
21BIO_f_cipher() returns the cipher BIO method. This is a filter
22BIO that encrypts any data written through it, and decrypts any data
23read from it. It is a BIO wrapper for the cipher routines
24EVP_CipherInit(), EVP_CipherUpdate() and EVP_CipherFinal().
25
26Cipher BIOs do not support BIO_gets() or BIO_puts().
27
28BIO_flush() on an encryption BIO that is being written through is
29used to signal that no more data is to be encrypted: this is used
30to flush and possibly pad the final block through the BIO.
31
32BIO_set_cipher() sets the cipher of BIO B<b> to B<cipher> using key B<key>
33and IV B<iv>. B<enc> should be set to 1 for encryption and zero for
34decryption.
35
36When reading from an encryption BIO the final block is automatically
37decrypted and checked when EOF is detected. BIO_get_cipher_status()
38is a BIO_ctrl() macro which can be called to determine whether the
39decryption operation was successful.
40
41BIO_get_cipher_ctx() is a BIO_ctrl() macro which retrieves the internal
42BIO cipher context. The retrieved context can be used in conjunction
43with the standard cipher routines to set it up. This is useful when
44BIO_set_cipher() is not flexible enough for the applications needs.
45
46=head1 NOTES
47
48When encrypting BIO_flush() B<must> be called to flush the final block
49through the BIO. If it is not then the final block will fail a subsequent
50decrypt.
51
52When decrypting an error on the final block is signalled by a zero
53return value from the read operation. A successful decrypt followed
54by EOF will also return zero for the final read. BIO_get_cipher_status()
55should be called to determine if the decrypt was successful.
56
57As always, if BIO_gets() or BIO_puts() support is needed then it can
58be achieved by preceding the cipher BIO with a buffering BIO.
59
60=head1 RETURN VALUES
61
62BIO_f_cipher() returns the cipher BIO method.
63
64BIO_set_cipher() does not return a value.
65
66BIO_get_cipher_status() returns 1 for a successful decrypt and 0
67for failure.
68
69BIO_get_cipher_ctx() currently always returns 1.
70
71=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_md.pod b/src/lib/libssl/src/doc/crypto/BIO_f_md.pod
deleted file mode 100644
index 37041d9206..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_f_md.pod
+++ /dev/null
@@ -1,146 +0,0 @@
1=pod
2
3=head1 NAME
4
5BIO_f_md, BIO_set_md, BIO_get_md, BIO_get_md_ctx - message digest BIO filter
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10 #include <openssl/evp.h>
11
12 BIO_METHOD * BIO_f_md(void);
13 int BIO_set_md(BIO *b,EVP_MD *md);
14 int BIO_get_md(BIO *b,EVP_MD **mdp);
15 int BIO_get_md_ctx(BIO *b,EVP_MD_CTX **mdcp);
16
17=head1 DESCRIPTION
18
19BIO_f_md() returns the message digest BIO method. This is a filter
20BIO that digests any data passed through it, it is a BIO wrapper
21for the digest routines EVP_DigestInit(), EVP_DigestUpdate()
22and EVP_DigestFinal().
23
24Any data written or read through a digest BIO using BIO_read() and
25BIO_write() is digested.
26
27BIO_gets(), if its B<size> parameter is large enough finishes the
28digest calculation and returns the digest value. BIO_puts() is
29not supported.
30
31BIO_reset() reinitialises a digest BIO.
32
33BIO_set_md() sets the message digest of BIO B<b> to B<md>: this
34must be called to initialize a digest BIO before any data is
35passed through it. It is a BIO_ctrl() macro.
36
37BIO_get_md() places the a pointer to the digest BIOs digest method
38in B<mdp>, it is a BIO_ctrl() macro.
39
40BIO_get_md_ctx() returns the digest BIOs context into B<mdcp>.
41
42=head1 NOTES
43
44The context returned by BIO_get_md_ctx() can be used in calls
45to EVP_DigestFinal() and also the signature routines EVP_SignFinal()
46and EVP_VerifyFinal().
47
48The context returned by BIO_get_md_ctx() is an internal context
49structure. Changes made to this context will affect the digest
50BIO itself and the context pointer will become invalid when the digest
51BIO is freed.
52
53After the digest has been retrieved from a digest BIO it must be
54reinitialized by calling BIO_reset(), or BIO_set_md() before any more
55data is passed through it.
56
57If an application needs to call BIO_gets() or BIO_puts() through
58a chain containing digest BIOs then this can be done by prepending
59a buffering BIO.
60
61Before OpenSSL 1.0.0 the call to BIO_get_md_ctx() would only work if the BIO
62had been initialized for example by calling BIO_set_md() ). In OpenSSL
631.0.0 and later the context is always returned and the BIO is state is set
64to initialized. This allows applications to initialize the context externally
65if the standard calls such as BIO_set_md() are not sufficiently flexible.
66
67=head1 RETURN VALUES
68
69BIO_f_md() returns the digest BIO method.
70
71BIO_set_md(), BIO_get_md() and BIO_md_ctx() return 1 for success and
720 for failure.
73
74=head1 EXAMPLES
75
76The following example creates a BIO chain containing an SHA1 and MD5
77digest BIO and passes the string "Hello World" through it. Error
78checking has been omitted for clarity.
79
80 BIO *bio, *mdtmp;
81 const char message[] = "Hello World";
82 bio = BIO_new(BIO_s_null());
83 mdtmp = BIO_new(BIO_f_md());
84 BIO_set_md(mdtmp, EVP_sha1());
85 /*
86 * For BIO_push() we want to append the sink BIO and keep a note of
87 * the start of the chain.
88 */
89 bio = BIO_push(mdtmp, bio);
90 mdtmp = BIO_new(BIO_f_md());
91 BIO_set_md(mdtmp, EVP_md5());
92 bio = BIO_push(mdtmp, bio);
93 /* Note: mdtmp can now be discarded */
94 BIO_write(bio, message, strlen(message));
95
96The next example digests data by reading through a chain instead:
97
98 BIO *bio, *mdtmp;
99 char buf[1024];
100 int rdlen;
101
102 bio = BIO_new_file(file, "rb");
103 mdtmp = BIO_new(BIO_f_md());
104 BIO_set_md(mdtmp, EVP_sha1());
105 bio = BIO_push(mdtmp, bio);
106 mdtmp = BIO_new(BIO_f_md());
107 BIO_set_md(mdtmp, EVP_md5());
108 bio = BIO_push(mdtmp, bio);
109 do {
110 rdlen = BIO_read(bio, buf, sizeof(buf));
111 /* Might want to do something with the data here */
112 } while (rdlen > 0);
113
114This next example retrieves the message digests from a BIO chain and
115outputs them. This could be used with the examples above.
116
117 BIO *mdtmp;
118 unsigned char mdbuf[EVP_MAX_MD_SIZE];
119 int mdlen;
120 int i;
121
122 mdtmp = bio; /* Assume bio has previously been set up */
123 do {
124 EVP_MD *md;
125 mdtmp = BIO_find_type(mdtmp, BIO_TYPE_MD);
126 if (!mdtmp)
127 break;
128 BIO_get_md(mdtmp, &md);
129 printf("%s digest", OBJ_nid2sn(EVP_MD_type(md)));
130 mdlen = BIO_gets(mdtmp, mdbuf, EVP_MAX_MD_SIZE);
131 for(i = 0; i < mdlen; i++)
132 printf(":%02X", mdbuf[i]);
133 printf("\n");
134 mdtmp = BIO_next(mdtmp);
135 } while(mdtmp);
136 BIO_free_all(bio);
137
138=head1 BUGS
139
140The lack of support for BIO_puts() and the non standard behaviour of
141BIO_gets() could be regarded as anomalous. It could be argued that BIO_gets()
142and BIO_puts() should be passed to the next BIO in the chain and digest
143the data passed through and that digests should be retrieved using a
144separate BIO_ctrl() call.
145
146=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_f_null.pod b/src/lib/libssl/src/doc/crypto/BIO_f_null.pod
deleted file mode 100644
index 5ef19968f6..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_f_null.pod
+++ /dev/null
@@ -1,30 +0,0 @@
1=pod
2
3=head1 NAME
4
5BIO_f_null - null filter
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO_METHOD * BIO_f_null(void);
12
13=head1 DESCRIPTION
14
15BIO_f_null() returns the null filter BIO method. This is a filter BIO
16that does nothing.
17
18All requests to a null filter BIO are passed through to the next BIO in
19the chain: this means that a BIO chain containing a null filter BIO
20behaves just as though the BIO was not there.
21
22=head1 NOTES
23
24As may be apparent a null filter BIO is not particularly useful.
25
26=head1 RETURN VALUES
27
28BIO_f_null() returns the null filter BIO method.
29
30=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_find_type.pod b/src/lib/libssl/src/doc/crypto/BIO_find_type.pod
deleted file mode 100644
index a57d42f526..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_find_type.pod
+++ /dev/null
@@ -1,97 +0,0 @@
1=pod
2
3=head1 NAME
4
5BIO_find_type, BIO_next, BIO_method_type - BIO chain traversal
6
7=head1 SYNOPSIS
8
9 #include <openssl/bio.h>
10
11 BIO * BIO_find_type(BIO *b,int bio_type);
12 BIO * BIO_next(BIO *b);
13
14 #define BIO_method_type(b) ((b)->method->type)
15
16 #define BIO_TYPE_NONE 0
17 #define BIO_TYPE_MEM (1|0x0400)
18 #define BIO_TYPE_FILE (2|0x0400)
19
20 #define BIO_TYPE_FD (4|0x0400|0x0100)
21 #define BIO_TYPE_SOCKET (5|0x0400|0x0100)
22 #define BIO_TYPE_NULL (6|0x0400)
23 #define BIO_TYPE_SSL (7|0x0200)
24 #define BIO_TYPE_MD (8|0x0200)
25 #define BIO_TYPE_BUFFER (9|0x0200)
26 #define BIO_TYPE_CIPHER (10|0x0200)
27 #define BIO_TYPE_BASE64 (11|0x0200)
28 #define BIO_TYPE_CONNECT (12|0x0400|0x0100)
29 #define BIO_TYPE_ACCEPT (13|0x0400|0x0100)
30 #define BIO_TYPE_PROXY_CLIENT (14|0x0200)
31 #define BIO_TYPE_PROXY_SERVER (15|0x0200)
32 #define BIO_TYPE_NBIO_TEST (16|0x0200)
33 #define BIO_TYPE_NULL_FILTER (17|0x0200)
34 #define BIO_TYPE_BER (18|0x0200)
35 #define BIO_TYPE_BIO (19|0x0400)
36
37 #define BIO_TYPE_DESCRIPTOR 0x0100
38 #define BIO_TYPE_FILTER 0x0200
39 #define BIO_TYPE_SOURCE_SINK 0x0400
40
41=head1 DESCRIPTION
42
43The BIO_find_type() searches for a BIO of a given type in a chain, starting
44at BIO B<b>. If B<type> is a specific type (such as BIO_TYPE_MEM) then a search
45is made for a BIO of that type. If B<type> is a general type (such as
46B<BIO_TYPE_SOURCE_SINK>) then the next matching BIO of the given general type is
47searched for. BIO_find_type() returns the next matching BIO or NULL if none is
48found.
49
50Note: not all the B<BIO_TYPE_*> types above have corresponding BIO
51implementations.
52
53BIO_next() returns the next BIO in a chain. It can be used to traverse all BIOs
54in a chain or used in conjunction with BIO_find_type() to find all BIOs of a
55certain type.
56
57BIO_method_type() returns the type of a BIO.
58
59=head1 RETURN VALUES
60
61BIO_find_type() returns a matching BIO or NULL for no match.
62
63BIO_next() returns the next BIO in a chain.
64
65BIO_method_type() returns the type of the BIO B<b>.
66
67=head1 NOTES
68
69BIO_next() was added to OpenSSL 0.9.6 to provide a 'clean' way to traverse a BIO
70chain or find multiple matches using BIO_find_type(). Previous versions had to
71use:
72
73 next = bio->next_bio;
74
75=head1 BUGS
76
77BIO_find_type() in OpenSSL 0.9.5a and earlier could not be safely passed a
78NULL pointer for the B<b> argument.
79
80=head1 EXAMPLE
81
82Traverse a chain looking for digest BIOs:
83
84 BIO *btmp;
85 btmp = in_bio; /* in_bio is chain to search through */
86
87 do {
88 btmp = BIO_find_type(btmp, BIO_TYPE_MD);
89 if (btmp == NULL)
90 break; /* Not found */
91 /* btmp is a digest BIO, do something with it ...*/
92 ...
93
94 btmp = BIO_next(btmp);
95 } while(btmp);
96
97=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_new.pod b/src/lib/libssl/src/doc/crypto/BIO_new.pod
deleted file mode 100644
index bd7b7381f3..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_new.pod
+++ /dev/null
@@ -1,64 +0,0 @@
1=pod
2
3=head1 NAME
4
5BIO_new, BIO_set, BIO_free, BIO_vfree, BIO_free_all - BIO allocation and
6freeing functions
7
8=head1 SYNOPSIS
9
10 #include <openssl/bio.h>
11
12 BIO * BIO_new(BIO_METHOD *type);
13 int BIO_set(BIO *a,BIO_METHOD *type);
14 int BIO_free(BIO *a);
15 void BIO_vfree(BIO *a);
16 void BIO_free_all(BIO *a);
17
18=head1 DESCRIPTION
19
20The BIO_new() function returns a new BIO using method B<type>.
21
22BIO_set() sets the method of an already existing BIO.
23
24BIO_free() frees up a single BIO, BIO_vfree() also frees up a single BIO
25but it does not return a value. Calling BIO_free() may also have some effect
26on the underlying I/O structure, for example it may close the file being
27referred to under certain circumstances. For more details see the individual
28BIO_METHOD descriptions.
29
30BIO_free_all() frees up an entire BIO chain, it does not halt if an error
31occurs freeing up an individual BIO in the chain.
32
33=head1 RETURN VALUES
34
35BIO_new() returns a newly created BIO or NULL if the call fails.
36
37BIO_set(), BIO_free() return 1 for success and 0 for failure.
38
39BIO_free_all() and BIO_vfree() do not return values.
40
41=head1 NOTES
42
43Some BIOs (such as memory BIOs) can be used immediately after calling
44BIO_new(). Others (such as file BIOs) need some additional initialization,
45and frequently a utility function exists to create and initialize such BIOs.
46
47If BIO_free() is called on a BIO chain it will only free one BIO resulting
48in a memory leak.
49
50Calling BIO_free_all() a single BIO has the same effect as calling BIO_free()
51on it other than the discarded return value.
52
53Normally the B<type> argument is supplied by a function which returns a
54pointer to a BIO_METHOD. There is a naming convention for such functions:
55a source/sink BIO is normally called BIO_s_*() and a filter BIO
56BIO_f_*();
57
58=head1 EXAMPLE
59
60Create a memory BIO:
61
62 BIO *mem = BIO_new(BIO_s_mem());
63
64=cut
diff --git a/src/lib/libssl/src/doc/crypto/BIO_new_CMS.pod b/src/lib/libssl/src/doc/crypto/BIO_new_CMS.pod
deleted file mode 100644
index 9e3a4b7f89..0000000000
--- a/src/lib/libssl/src/doc/crypto/BIO_new_CMS.pod
+++ /dev/null
@@ -1,66 +0,0 @@
1=pod
2
3=head1 NAME
4
5 BIO_new_CMS - CMS streaming filter BIO
6
7=head1 SYNOPSIS
8
9 #include <openssl/cms.h>
10
11 BIO *BIO_new_CMS(BIO *out, CMS_ContentInfo *cms);
12
13=head1 DESCRIPTION
14
15BIO_new_CMS() returns a streaming filter BIO chain based on B<cms>. The output
16of the filter is written to B<out>. Any data written to the chain is
17automatically translated to a BER format CMS structure of the appropriate type.
18
19=head1 NOTES
20
21The chain returned by this function behaves like a standard filter BIO. It
22supports non blocking I/O. Content is processed and streamed on the fly and not
23all held in memory at once: so it is possible to encode very large structures.
24After all content has been written through the chain BIO_flush() must be called
25to finalise the structure.
26
27The B<CMS_STREAM> flag must be included in the corresponding B<flags>
28parameter of the B<cms> creation function.
29
30If an application wishes to write additional data to B<out> BIOs should be
31removed from the chain using BIO_pop() and freed with BIO_free() until B<out>
32is reached. If no additional data needs to be written BIO_free_all() can be
33called to free up the whole chain.
34
35Any content written through the filter is used verbatim: no canonical
36translation is performed.
37
38It is possible to chain multiple BIOs to, for example, create a triple wrapped
39signed, enveloped, signed structure. In this case it is the applications
40responsibility to set the inner content type of any outer CMS_ContentInfo
41structures.
42
43Large numbers of small writes through the chain should be avoided as this will
44produce an output consisting of lots of OCTET STRING structures. Prepending
45a BIO_f_buffer() buffering BIO will prevent this.
46
47=head1 BUGS
48
49There is currently no corresponding inverse BIO: i.e. one which can decode
50a CMS structure on the fly.
51
52=head1 RETURN VALUES
53
54BIO_new_CMS() returns a BIO chain when successful or NULL if an error
55occurred. The error can be obtained from ERR_get_error(3).
56
57=head1 SEE ALSO
58
59L<ERR_get_error(3)|ERR_get_error(3)>, L<CMS_sign(3)|CMS_sign(3)>,
60L<CMS_encrypt(3)|CMS_encrypt(3)>
61
62=head1 HISTORY
63
64BIO_new_CMS() was added to OpenSSL 1.0.0
65
66=cut