diff options
Diffstat (limited to 'src/lib/libcrypto/man/BN_set_flags.3')
| -rw-r--r-- | src/lib/libcrypto/man/BN_set_flags.3 | 160 |
1 files changed, 0 insertions, 160 deletions
diff --git a/src/lib/libcrypto/man/BN_set_flags.3 b/src/lib/libcrypto/man/BN_set_flags.3 deleted file mode 100644 index 1285ae2b28..0000000000 --- a/src/lib/libcrypto/man/BN_set_flags.3 +++ /dev/null | |||
| @@ -1,160 +0,0 @@ | |||
| 1 | .\" $OpenBSD: BN_set_flags.3,v 1.6 2023/04/27 07:22:22 tb Exp $ | ||
| 2 | .\" | ||
| 3 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | ||
| 4 | .\" | ||
| 5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 7 | .\" copyright notice and this permission notice appear in all copies. | ||
| 8 | .\" | ||
| 9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 16 | .\" | ||
| 17 | .Dd $Mdocdate: April 27 2023 $ | ||
| 18 | .Dt BN_SET_FLAGS 3 | ||
| 19 | .Os | ||
| 20 | .Sh NAME | ||
| 21 | .Nm BN_set_flags , | ||
| 22 | .Nm BN_get_flags | ||
| 23 | .Nd enable and inspect flags on BIGNUM objects | ||
| 24 | .Sh SYNOPSIS | ||
| 25 | .In openssl/bn.h | ||
| 26 | .Ft void | ||
| 27 | .Fo BN_set_flags | ||
| 28 | .Fa "BIGNUM *b" | ||
| 29 | .Fa "int flags" | ||
| 30 | .Fc | ||
| 31 | .Ft int | ||
| 32 | .Fo BN_get_flags | ||
| 33 | .Fa "const BIGNUM *b" | ||
| 34 | .Fa "int flags" | ||
| 35 | .Fc | ||
| 36 | .Sh DESCRIPTION | ||
| 37 | .Fn BN_set_flags | ||
| 38 | enables the given | ||
| 39 | .Fa flags | ||
| 40 | on | ||
| 41 | .Fa b . | ||
| 42 | The | ||
| 43 | .Fa flags | ||
| 44 | argument can contain zero or more of the following constants OR'ed | ||
| 45 | together: | ||
| 46 | .Bl -tag -width Ds | ||
| 47 | .It Dv BN_FLG_CONSTTIME | ||
| 48 | If this flag is set on the divident | ||
| 49 | .Fa a | ||
| 50 | or the divisor | ||
| 51 | .Fa d | ||
| 52 | in | ||
| 53 | .Xr BN_div 3 , | ||
| 54 | on the exponent | ||
| 55 | .Fa p | ||
| 56 | in | ||
| 57 | .Xr BN_mod_exp 3 , | ||
| 58 | or on the divisor | ||
| 59 | .Fa a | ||
| 60 | or the modulus | ||
| 61 | .Fa n | ||
| 62 | in | ||
| 63 | .Xr BN_mod_inverse 3 , | ||
| 64 | these functions select algorithms with an execution time independent | ||
| 65 | of the respective numbers, to avoid exposing sensitive information | ||
| 66 | to timing side-channel attacks. | ||
| 67 | .Pp | ||
| 68 | This flag is off by default for | ||
| 69 | .Vt BIGNUM | ||
| 70 | objects created with | ||
| 71 | .Xr BN_new 3 . | ||
| 72 | .It Dv BN_FLG_MALLOCED | ||
| 73 | If this flag is set, | ||
| 74 | .Xr BN_free 3 | ||
| 75 | and | ||
| 76 | .Xr BN_clear_free 3 | ||
| 77 | will not only clear and free the components of | ||
| 78 | .Fa b , | ||
| 79 | but also | ||
| 80 | .Fa b | ||
| 81 | itself. | ||
| 82 | This flag is set internally by | ||
| 83 | .Xr BN_new 3 . | ||
| 84 | Setting it manually on an existing | ||
| 85 | .Vt BIGNUM | ||
| 86 | object is usually a bad idea and can cause calls to | ||
| 87 | .Xr free 3 | ||
| 88 | with bogus arguments. | ||
| 89 | .It Dv BN_FLG_STATIC_DATA | ||
| 90 | If this flag is set, | ||
| 91 | .Xr BN_clear_free 3 | ||
| 92 | will neither clear nor free the memory used for storing the number. | ||
| 93 | Consequently, setting it manually on an existing | ||
| 94 | .Vt BIGNUM | ||
| 95 | object is usually a terrible idea that can cause both disclosure | ||
| 96 | of secret data and memory leaks. | ||
| 97 | This flag is automatically set on the constant | ||
| 98 | .Vt BIGNUM | ||
| 99 | object returned by | ||
| 100 | .Xr BN_value_one 3 . | ||
| 101 | .El | ||
| 102 | .Pp | ||
| 103 | .Fn BN_get_flags | ||
| 104 | interprets | ||
| 105 | .Fa flags | ||
| 106 | as a bitmask and returns those of the given flags that are set in | ||
| 107 | .Fa b , | ||
| 108 | OR'ed together, or 0 if none of the given | ||
| 109 | .Fa flags | ||
| 110 | is set. | ||
| 111 | The | ||
| 112 | .Fa flags | ||
| 113 | argument has the same syntax as for | ||
| 114 | .Fn BN_set_flags . | ||
| 115 | .Sh RETURN VALUES | ||
| 116 | .Fn BN_get_flags | ||
| 117 | returns zero or more of the above constants, OR'ed together. | ||
| 118 | .Sh SEE ALSO | ||
| 119 | .Xr BN_mod_exp 3 , | ||
| 120 | .Xr BN_mod_inverse 3 , | ||
| 121 | .Xr BN_new 3 , | ||
| 122 | .Xr BN_with_flags 3 | ||
| 123 | .Sh HISTORY | ||
| 124 | .Fn BN_set_flags | ||
| 125 | and | ||
| 126 | .Fn BN_get_flags | ||
| 127 | first appeared in SSLeay 0.9.1 and have been available since | ||
| 128 | .Ox 2.6 . | ||
| 129 | .Sh CAVEATS | ||
| 130 | No public interface exists to clear a flag once it is set. | ||
| 131 | So think twice before using | ||
| 132 | .Fn BN_set_flags . | ||
| 133 | .Sh BUGS | ||
| 134 | Even if the | ||
| 135 | .Dv BN_FLG_CONSTTIME | ||
| 136 | flag is set on | ||
| 137 | .Fa a | ||
| 138 | or | ||
| 139 | .Fa b , | ||
| 140 | .Fn BN_gcd | ||
| 141 | neither fails nor operates in constant time, potentially allowing | ||
| 142 | timing side-channel attacks. | ||
| 143 | .Pp | ||
| 144 | Even if the | ||
| 145 | .Dv BN_FLG_CONSTTIME | ||
| 146 | flag is set on | ||
| 147 | .Fa p , | ||
| 148 | if the modulus | ||
| 149 | .Fa m | ||
| 150 | is even, | ||
| 151 | .Xr BN_mod_exp 3 | ||
| 152 | does not operate in constant time, potentially allowing | ||
| 153 | timing side-channel attacks. | ||
| 154 | .Pp | ||
| 155 | If | ||
| 156 | .Dv BN_FLG_CONSTTIME | ||
| 157 | is set on | ||
| 158 | .Fa p , | ||
| 159 | .Fn BN_exp | ||
| 160 | fails instead of operating in constant time. | ||
