diff options
| author | schwarze <> | 2016-11-20 16:51:02 +0000 |
|---|---|---|
| committer | schwarze <> | 2016-11-20 16:51:02 +0000 |
| commit | 1e2988fe6160b299898431c4dd3f41a2a4c89ff6 (patch) | |
| tree | 5c47e8ff140066dd9032bce7e92c14696842969d /src | |
| parent | 621347c6c3bb1286d97773f3d5d74abfa256c4f2 (diff) | |
| download | openbsd-1e2988fe6160b299898431c4dd3f41a2a4c89ff6.tar.gz openbsd-1e2988fe6160b299898431c4dd3f41a2a4c89ff6.tar.bz2 openbsd-1e2988fe6160b299898431c4dd3f41a2a4c89ff6.zip | |
Add Copyright and license.
Merge documentation of BN_with_flags(3) from OpenSSL.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/BN_copy.3 | 114 |
1 files changed, 109 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/BN_copy.3 b/src/lib/libcrypto/man/BN_copy.3 index 80b3087c62..f6110863a0 100644 --- a/src/lib/libcrypto/man/BN_copy.3 +++ b/src/lib/libcrypto/man/BN_copy.3 | |||
| @@ -1,11 +1,61 @@ | |||
| 1 | .\" $OpenBSD: BN_copy.3,v 1.2 2016/11/06 15:52:50 jmc Exp $ | 1 | .\" $OpenBSD: BN_copy.3,v 1.3 2016/11/20 16:51:02 schwarze Exp $ |
| 2 | .\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100 | ||
| 2 | .\" | 3 | .\" |
| 3 | .Dd $Mdocdate: November 6 2016 $ | 4 | .\" This file was written by Ulf Moeller <ulf@openssl.org> |
| 5 | .\" and Matt Caswell <matt@openssl.org>. | ||
| 6 | .\" Copyright (c) 2000, 2015 The OpenSSL Project. All rights reserved. | ||
| 7 | .\" | ||
| 8 | .\" Redistribution and use in source and binary forms, with or without | ||
| 9 | .\" modification, are permitted provided that the following conditions | ||
| 10 | .\" are met: | ||
| 11 | .\" | ||
| 12 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 13 | .\" notice, this list of conditions and the following disclaimer. | ||
| 14 | .\" | ||
| 15 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 16 | .\" notice, this list of conditions and the following disclaimer in | ||
| 17 | .\" the documentation and/or other materials provided with the | ||
| 18 | .\" distribution. | ||
| 19 | .\" | ||
| 20 | .\" 3. All advertising materials mentioning features or use of this | ||
| 21 | .\" software must display the following acknowledgment: | ||
| 22 | .\" "This product includes software developed by the OpenSSL Project | ||
| 23 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 24 | .\" | ||
| 25 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 26 | .\" endorse or promote products derived from this software without | ||
| 27 | .\" prior written permission. For written permission, please contact | ||
| 28 | .\" openssl-core@openssl.org. | ||
| 29 | .\" | ||
| 30 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 31 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 32 | .\" permission of the OpenSSL Project. | ||
| 33 | .\" | ||
| 34 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 35 | .\" acknowledgment: | ||
| 36 | .\" "This product includes software developed by the OpenSSL Project | ||
| 37 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 38 | .\" | ||
| 39 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 40 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 41 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 42 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 43 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 44 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 45 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 46 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 47 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 48 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 51 | .\" | ||
| 52 | .Dd $Mdocdate: November 20 2016 $ | ||
| 4 | .Dt BN_COPY 3 | 53 | .Dt BN_COPY 3 |
| 5 | .Os | 54 | .Os |
| 6 | .Sh NAME | 55 | .Sh NAME |
| 7 | .Nm BN_copy , | 56 | .Nm BN_copy , |
| 8 | .Nm BN_dup | 57 | .Nm BN_dup , |
| 58 | .Nm BN_with_flags | ||
| 9 | .Nd copy BIGNUMs | 59 | .Nd copy BIGNUMs |
| 10 | .Sh SYNOPSIS | 60 | .Sh SYNOPSIS |
| 11 | .In openssl/bn.h | 61 | .In openssl/bn.h |
| @@ -18,6 +68,12 @@ | |||
| 18 | .Fo BN_dup | 68 | .Fo BN_dup |
| 19 | .Fa "const BIGNUM *from" | 69 | .Fa "const BIGNUM *from" |
| 20 | .Fc | 70 | .Fc |
| 71 | .Ft void | ||
| 72 | .Fo BN_with_flags | ||
| 73 | .Fa "BIGNUM *dest" | ||
| 74 | .Fa "const BIGNUM *b" | ||
| 75 | .Fa "int flags" | ||
| 76 | .Fc | ||
| 21 | .Sh DESCRIPTION | 77 | .Sh DESCRIPTION |
| 22 | .Fn BN_copy | 78 | .Fn BN_copy |
| 23 | copies | 79 | copies |
| @@ -29,16 +85,64 @@ creates a new | |||
| 29 | .Vt BIGNUM | 85 | .Vt BIGNUM |
| 30 | containing the value | 86 | containing the value |
| 31 | .Fa from . | 87 | .Fa from . |
| 88 | .Pp | ||
| 89 | .Fn BN_with_flags | ||
| 90 | creates a | ||
| 91 | .Em temporary | ||
| 92 | shallow copy of | ||
| 93 | .Fa b | ||
| 94 | in | ||
| 95 | .Fa dest . | ||
| 96 | It places significant restrictions on the copied data. | ||
| 97 | Applications that do not adhere to these restrictions | ||
| 98 | may encounter unexpected side effects or crashes. | ||
| 99 | For that reason, use of this function is discouraged. | ||
| 100 | .Pp | ||
| 101 | Any flags provided in | ||
| 102 | .Fa flags | ||
| 103 | will be set in | ||
| 104 | .Fa dest | ||
| 105 | in addition to any flags already set in | ||
| 106 | .Fa b . | ||
| 107 | For example, this can be used to create a temporary copy of a | ||
| 108 | .Vt BIGNUM | ||
| 109 | with the | ||
| 110 | .Dv BN_FLG_CONSTTIME | ||
| 111 | flag set for constant time operations. | ||
| 112 | .Pp | ||
| 113 | The temporary copy in | ||
| 114 | .Fa dest | ||
| 115 | will share some internal state with | ||
| 116 | .Fa b . | ||
| 117 | For this reason, the following restrictions apply to the use of | ||
| 118 | .Fa dest : | ||
| 119 | .Bl -bullet | ||
| 120 | .It | ||
| 121 | .Fa dest | ||
| 122 | should be a newly allocated | ||
| 123 | .Vt BIGNUM | ||
| 124 | obtained via a call to | ||
| 125 | .Xr BN_new 3 . | ||
| 126 | It should not have been used for other purposes or initialised in any way. | ||
| 127 | .It | ||
| 128 | .Fa dest | ||
| 129 | must only be used in "read-only" operations, i.e. typically those | ||
| 130 | functions where the relevant parameter is declared "const". | ||
| 131 | .It | ||
| 132 | .Fa dest | ||
| 133 | must be used and freed before any further subsequent use of | ||
| 134 | .Fa b . | ||
| 135 | .El | ||
| 32 | .Sh RETURN VALUES | 136 | .Sh RETURN VALUES |
| 33 | .Fn BN_copy | 137 | .Fn BN_copy |
| 34 | returns | 138 | returns |
| 35 | .Fa to | 139 | .Fa to |
| 36 | on success, | 140 | on success or |
| 37 | .Dv NULL | 141 | .Dv NULL |
| 38 | on error. | 142 | on error. |
| 39 | .Fn BN_dup | 143 | .Fn BN_dup |
| 40 | returns the new | 144 | returns the new |
| 41 | .Vt BIGNUM , | 145 | .Vt BIGNUM |
| 42 | or | 146 | or |
| 43 | .Dv NULL | 147 | .Dv NULL |
| 44 | on error. | 148 | on error. |
