diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/BUF_MEM_new.3 | 90 |
1 files changed, 88 insertions, 2 deletions
diff --git a/src/lib/libcrypto/man/BUF_MEM_new.3 b/src/lib/libcrypto/man/BUF_MEM_new.3 index f658048a93..70e7189545 100644 --- a/src/lib/libcrypto/man/BUF_MEM_new.3 +++ b/src/lib/libcrypto/man/BUF_MEM_new.3 | |||
| @@ -1,12 +1,62 @@ | |||
| 1 | .\" $OpenBSD: BUF_MEM_new.3,v 1.5 2016/11/10 14:34:18 jmc Exp $ | 1 | .\" $OpenBSD: BUF_MEM_new.3,v 1.6 2016/11/20 19:08:51 schwarze Exp $ |
| 2 | .\" OpenSSL 18edda0f Sep 20 03:28:54 2000 +0000 | ||
| 2 | .\" | 3 | .\" |
| 3 | .Dd $Mdocdate: November 10 2016 $ | 4 | .\" This file was written by Ralf S. Engelschall <rse@openssl.org>. |
| 5 | .\" Copyright (c) 1999, 2000, 2016 The OpenSSL Project. All rights reserved. | ||
| 6 | .\" | ||
| 7 | .\" Redistribution and use in source and binary forms, with or without | ||
| 8 | .\" modification, are permitted provided that the following conditions | ||
| 9 | .\" are met: | ||
| 10 | .\" | ||
| 11 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 12 | .\" notice, this list of conditions and the following disclaimer. | ||
| 13 | .\" | ||
| 14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 15 | .\" notice, this list of conditions and the following disclaimer in | ||
| 16 | .\" the documentation and/or other materials provided with the | ||
| 17 | .\" distribution. | ||
| 18 | .\" | ||
| 19 | .\" 3. All advertising materials mentioning features or use of this | ||
| 20 | .\" software must display the following acknowledgment: | ||
| 21 | .\" "This product includes software developed by the OpenSSL Project | ||
| 22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 23 | .\" | ||
| 24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 25 | .\" endorse or promote products derived from this software without | ||
| 26 | .\" prior written permission. For written permission, please contact | ||
| 27 | .\" openssl-core@openssl.org. | ||
| 28 | .\" | ||
| 29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 31 | .\" permission of the OpenSSL Project. | ||
| 32 | .\" | ||
| 33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 34 | .\" acknowledgment: | ||
| 35 | .\" "This product includes software developed by the OpenSSL Project | ||
| 36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 37 | .\" | ||
| 38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 50 | .\" | ||
| 51 | .Dd $Mdocdate: November 20 2016 $ | ||
| 4 | .Dt BUF_MEM_NEW 3 | 52 | .Dt BUF_MEM_NEW 3 |
| 5 | .Os | 53 | .Os |
| 6 | .Sh NAME | 54 | .Sh NAME |
| 7 | .Nm BUF_MEM_new , | 55 | .Nm BUF_MEM_new , |
| 8 | .Nm BUF_MEM_free , | 56 | .Nm BUF_MEM_free , |
| 9 | .Nm BUF_MEM_grow , | 57 | .Nm BUF_MEM_grow , |
| 58 | .Nm BUF_MEM_grow_clean , | ||
| 59 | .Nm BUF_reverse , | ||
| 10 | .Nm BUF_strdup | 60 | .Nm BUF_strdup |
| 11 | .Nd simple character arrays structure | 61 | .Nd simple character arrays structure |
| 12 | .Sh SYNOPSIS | 62 | .Sh SYNOPSIS |
| @@ -24,6 +74,17 @@ | |||
| 24 | .Fa "BUF_MEM *str" | 74 | .Fa "BUF_MEM *str" |
| 25 | .Fa "size_t len" | 75 | .Fa "size_t len" |
| 26 | .Fc | 76 | .Fc |
| 77 | .Ft size_t | ||
| 78 | .Fo BUF_MEM_grow_clean | ||
| 79 | .Fa "BUF_MEM *str" | ||
| 80 | .Fa "size_t len" | ||
| 81 | .Fc | ||
| 82 | .Ft void | ||
| 83 | .Fo BUF_reverse | ||
| 84 | .Fa "unsigned char *out" | ||
| 85 | .Fa "const unsigned char *in" | ||
| 86 | .Fa "size_t len" | ||
| 87 | .Fc | ||
| 27 | .Ft char * | 88 | .Ft char * |
| 28 | .Fo BUF_strdup | 89 | .Fo BUF_strdup |
| 29 | .Fa "const char *str" | 90 | .Fa "const char *str" |
| @@ -58,12 +119,35 @@ allocates a new buffer of zero size. | |||
| 58 | frees up an already existing buffer. | 119 | frees up an already existing buffer. |
| 59 | The data is zeroed before freeing up in case the buffer contains | 120 | The data is zeroed before freeing up in case the buffer contains |
| 60 | sensitive data. | 121 | sensitive data. |
| 122 | If | ||
| 123 | .Fa a | ||
| 124 | is a | ||
| 125 | .Dv NULL | ||
| 126 | pointer, no action occurs. | ||
| 61 | .Pp | 127 | .Pp |
| 62 | .Fn BUF_MEM_grow | 128 | .Fn BUF_MEM_grow |
| 63 | changes the size of an already existing buffer to | 129 | changes the size of an already existing buffer to |
| 64 | .Fa len . | 130 | .Fa len . |
| 65 | Any data already in the buffer is preserved if it increases in size. | 131 | Any data already in the buffer is preserved if it increases in size. |
| 66 | .Pp | 132 | .Pp |
| 133 | .Fn BUF_MEM_grow_clean | ||
| 134 | is similar to | ||
| 135 | .Fn BUF_MEM_grow , | ||
| 136 | but it sets any freed or additionally allocated memory to zero. | ||
| 137 | .Pp | ||
| 138 | .Fn BUF_reverse | ||
| 139 | reverses | ||
| 140 | .Fa len | ||
| 141 | bytes at | ||
| 142 | .Fa in | ||
| 143 | into | ||
| 144 | .Fa out . | ||
| 145 | If | ||
| 146 | .Fa out | ||
| 147 | is | ||
| 148 | .Dv NULL , | ||
| 149 | the array is reversed in place. | ||
| 150 | .Pp | ||
| 67 | .Fn BUF_strdup | 151 | .Fn BUF_strdup |
| 68 | copies a NUL terminated string into a block of allocated memory and | 152 | copies a NUL terminated string into a block of allocated memory and |
| 69 | returns a pointer to the allocated block. | 153 | returns a pointer to the allocated block. |
| @@ -90,6 +174,8 @@ returns the buffer or | |||
| 90 | on error. | 174 | on error. |
| 91 | .Pp | 175 | .Pp |
| 92 | .Fn BUF_MEM_grow | 176 | .Fn BUF_MEM_grow |
| 177 | and | ||
| 178 | .Fn BUF_MEM_grow_clean | ||
| 93 | returns zero on error or the new size (i.e.\& | 179 | returns zero on error or the new size (i.e.\& |
| 94 | .Fa len ) . | 180 | .Fa len ) . |
| 95 | .Sh SEE ALSO | 181 | .Sh SEE ALSO |
