property.7ossl 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. .\" -*- mode: troff; coding: utf-8 -*-
  2. .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43)
  3. .\"
  4. .\" Standard preamble:
  5. .\" ========================================================================
  6. .de Sp \" Vertical space (when we can't use .PP)
  7. .if t .sp .5v
  8. .if n .sp
  9. ..
  10. .de Vb \" Begin verbatim text
  11. .ft CW
  12. .nf
  13. .ne \\$1
  14. ..
  15. .de Ve \" End verbatim text
  16. .ft R
  17. .fi
  18. ..
  19. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
  20. .ie n \{\
  21. . ds C` ""
  22. . ds C' ""
  23. 'br\}
  24. .el\{\
  25. . ds C`
  26. . ds C'
  27. 'br\}
  28. .\"
  29. .\" Escape single quotes in literal strings from groff's Unicode transform.
  30. .ie \n(.g .ds Aq \(aq
  31. .el .ds Aq '
  32. .\"
  33. .\" If the F register is >0, we'll generate index entries on stderr for
  34. .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
  35. .\" entries marked with X<> in POD. Of course, you'll have to process the
  36. .\" output yourself in some meaningful fashion.
  37. .\"
  38. .\" Avoid warning from groff about undefined register 'F'.
  39. .de IX
  40. ..
  41. .nr rF 0
  42. .if \n(.g .if rF .nr rF 1
  43. .if (\n(rF:(\n(.g==0)) \{\
  44. . if \nF \{\
  45. . de IX
  46. . tm Index:\\$1\t\\n%\t"\\$2"
  47. ..
  48. . if !\nF==2 \{\
  49. . nr % 0
  50. . nr F 2
  51. . \}
  52. . \}
  53. .\}
  54. .rr rF
  55. .\" ========================================================================
  56. .\"
  57. .IX Title "PROPERTY 7ossl"
  58. .TH PROPERTY 7ossl 2025-01-17 3.4.0 OpenSSL
  59. .\" For nroff, turn off justification. Always turn off hyphenation; it makes
  60. .\" way too many mistakes in technical documents.
  61. .if n .ad l
  62. .nh
  63. .SH NAME
  64. property \- Properties, a selection mechanism for algorithm implementations
  65. .SH DESCRIPTION
  66. .IX Header "DESCRIPTION"
  67. As of OpenSSL 3.0, a new method has been introduced to decide which of
  68. multiple implementations of an algorithm will be used.
  69. The method is centered around the concept of properties.
  70. Each implementation defines a number of properties and when an algorithm
  71. is being selected, filters based on these properties can be used to
  72. choose the most appropriate implementation of the algorithm.
  73. .PP
  74. Properties are like variables, they are referenced by name and have a value
  75. assigned.
  76. .SS "Property Names"
  77. .IX Subsection "Property Names"
  78. Property names fall into two categories: those reserved by the OpenSSL
  79. project and user defined names.
  80. A \fIreserved\fR property name consists of a single C\-style identifier
  81. (except for leading underscores not being permitted), which begins
  82. with a letter and can be followed by any number of letters, numbers
  83. and underscores.
  84. Property names are case-insensitive, but OpenSSL will only use lowercase
  85. letters.
  86. .PP
  87. A \fIuser defined\fR property name is similar, but it \fBmust\fR consist of
  88. two or more C\-style identifiers, separated by periods.
  89. The last identifier in the name can be considered the 'true' property
  90. name, which is prefixed by some sort of 'namespace'.
  91. Providers for example could include their name in the prefix and use
  92. property names like
  93. .PP
  94. .Vb 2
  95. \& <provider_name>.<property_name>
  96. \& <provider_name>.<algorithm_name>.<property_name>
  97. .Ve
  98. .SS Properties
  99. .IX Subsection "Properties"
  100. A \fIproperty\fR is a \fIname=value\fR pair.
  101. A \fIproperty definition\fR is a sequence of comma separated properties.
  102. There can be any number of properties in a definition, however each name must
  103. be unique.
  104. For example: "" defines an empty property definition (i.e., no restriction);
  105. "my.foo=bar" defines a property named \fImy.foo\fR which has a string value \fIbar\fR
  106. and "iteration.count=3" defines a property named \fIiteration.count\fR which
  107. has a numeric value of \fI3\fR.
  108. The full syntax for property definitions appears below.
  109. .SS Implementations
  110. .IX Subsection "Implementations"
  111. Each implementation of an algorithm can define any number of
  112. properties.
  113. For example, the default provider defines the property \fIprovider=default\fR
  114. for all of its algorithms.
  115. Likewise, OpenSSL's FIPS provider defines \fIprovider=fips\fR and the legacy
  116. provider defines \fIprovider=legacy\fR for all of their algorithms.
  117. .SS Queries
  118. .IX Subsection "Queries"
  119. A \fIproperty query clause\fR is a single conditional test.
  120. For example, "fips=yes", "provider!=default" or "?iteration.count=3".
  121. The first two represent mandatory clauses, such clauses \fBmust\fR match
  122. for any algorithm to even be under consideration.
  123. The third clause represents an optional clause.
  124. Matching such clauses is not a requirement, but any additional optional
  125. match counts in favor of the algorithm.
  126. More details about that in the \fBLookups\fR section.
  127. A \fIproperty query\fR is a sequence of comma separated property query clauses.
  128. It is an error if a property name appears in more than one query clause.
  129. The full syntax for property queries appears below, but the available syntactic
  130. features are:
  131. .IP \(bu 4
  132. \&\fB=\fR is an infix operator providing an equality test.
  133. .IP \(bu 4
  134. \&\fB!=\fR is an infix operator providing an inequality test.
  135. .IP \(bu 4
  136. \&\fB?\fR is a prefix operator that means that the following clause is optional
  137. but preferred.
  138. .IP \(bu 4
  139. \&\fB\-\fR is a prefix operator that means any global query clause involving the
  140. following property name should be ignored.
  141. .IP \(bu 4
  142. \&\fB"..."\fR is a quoted string.
  143. The quotes are not included in the body of the string.
  144. .IP \(bu 4
  145. \&\fB'...'\fR is a quoted string.
  146. The quotes are not included in the body of the string.
  147. .SS Lookups
  148. .IX Subsection "Lookups"
  149. When an algorithm is looked up, a property query is used to determine
  150. the best matching algorithm.
  151. All mandatory query clauses \fBmust\fR be present and the implementation
  152. that additionally has the largest number of matching optional query
  153. clauses will be used.
  154. If there is more than one such optimal candidate, the result will be
  155. chosen from amongst those in an indeterminate way.
  156. Ordering of optional clauses is not significant.
  157. .SS Shortcut
  158. .IX Subsection "Shortcut"
  159. In order to permit a more concise expression of boolean properties, there
  160. is one short cut: a property name alone (e.g. "my.property") is
  161. exactly equivalent to "my.property=yes" in both definitions and queries.
  162. .SS "Global and Local"
  163. .IX Subsection "Global and Local"
  164. Two levels of property query are supported.
  165. A context based property query that applies to all fetch operations and a local
  166. property query.
  167. Where both the context and local queries include a clause with the same name,
  168. the local clause overrides the context clause.
  169. .PP
  170. It is possible for a local property query to remove a clause in the context
  171. property query by preceding the property name with a '\-'.
  172. For example, a context property query that contains "fips=yes" would normally
  173. result in implementations that have "fips=yes".
  174. .PP
  175. However, if the setting of the "fips" property is irrelevant to the
  176. operations being performed, the local property query can include the
  177. clause "\-fips".
  178. Note that the local property query could not use "fips=no" because that would
  179. disallow any implementations with "fips=yes" rather than not caring about the
  180. setting.
  181. .SH SYNTAX
  182. .IX Header "SYNTAX"
  183. The lexical syntax in EBNF is given by:
  184. .PP
  185. .Vb 11
  186. \& Definition ::= PropertyName ( \*(Aq=\*(Aq Value )?
  187. \& ( \*(Aq,\*(Aq PropertyName ( \*(Aq=\*(Aq Value )? )*
  188. \& Query ::= PropertyQuery ( \*(Aq,\*(Aq PropertyQuery )*
  189. \& PropertyQuery ::= \*(Aq\-\*(Aq PropertyName
  190. \& | \*(Aq?\*(Aq? ( PropertyName (( \*(Aq=\*(Aq | \*(Aq!=\*(Aq ) Value)?)
  191. \& Value ::= NumberLiteral | StringLiteral
  192. \& StringLiteral ::= QuotedString | UnquotedString
  193. \& QuotedString ::= \*(Aq"\*(Aq [^"]* \*(Aq"\*(Aq | "\*(Aq" [^\*(Aq]* "\*(Aq"
  194. \& UnquotedString ::= [A\-Za\-z] [^{space},]+
  195. \& NumberLiteral ::= \*(Aq0\*(Aq ( [0\-7]* | \*(Aqx\*(Aq [0\-9A\-Fa\-f]+ ) | \*(Aq\-\*(Aq? [1\-9] [0\-9]+
  196. \& PropertyName ::= [A\-Za\-z] [A\-Za\-z0\-9_]* ( \*(Aq.\*(Aq [A\-Za\-z] [A\-Za\-z0\-9_]* )*
  197. .Ve
  198. .PP
  199. The flavour of EBNF being used is defined by:
  200. <https://www.w3.org/TR/2010/REC\-xquery\-20101214/#EBNFNotation>.
  201. .SH HISTORY
  202. .IX Header "HISTORY"
  203. Properties were added in OpenSSL 3.0
  204. .SH COPYRIGHT
  205. .IX Header "COPYRIGHT"
  206. Copyright 2019\-2023 The OpenSSL Project Authors. All Rights Reserved.
  207. .PP
  208. Licensed under the Apache License 2.0 (the "License"). You may not use
  209. this file except in compliance with the License. You can obtain a copy
  210. in the file LICENSE in the source distribution or at
  211. <https://www.openssl.org/source/license.html>.