@@ -3,7 +3,7 @@ import semmle.code.cpp.dataflow.DataFlow
33
44module BoostorgAsio {
55 /**
6- * Represents boost::asio::ssl::context enum
6+ * Represents the ` boost::asio::ssl::context` enum.
77 */
88 class SslContextMethod extends Enum {
99 SslContextMethod ( ) {
@@ -12,7 +12,7 @@ module BoostorgAsio {
1212 }
1313
1414 /**
15- * returns the value for a banned protocol
15+ * Gets an enumeration constant for a banned protocol.
1616 */
1717 EnumConstant getABannedProtocolConstant ( ) {
1818 result = this .getAnEnumConstant ( ) and
@@ -56,14 +56,15 @@ module BoostorgAsio {
5656 }
5757
5858 /**
59- * returns the value for a approved protocols, but that are hard-coded (i.e. no protocol negotiation)
59+ * Gets an enumeration constant for an approved protocol, that is hard-coded
60+ * (no protocol negotiation).
6061 */
6162 EnumConstant getAnApprovedButHardcodedProtocolConstant ( ) {
6263 result = this .getATls12ProtocolConstant ( )
6364 }
6465
6566 /**
66- * returns the value for a TLS v1.2 protocol
67+ * Gets an enumeration constant for a TLS v1.2 protocol.
6768 */
6869 EnumConstant getATls12ProtocolConstant ( ) {
6970 result = this .getAnEnumConstant ( ) and
@@ -80,7 +81,7 @@ module BoostorgAsio {
8081 }
8182
8283 /**
83- * returns the value for a TLS v1.3 protocol
84+ * Gets an enumeration constant for a TLS v1.3 protocol.
8485 */
8586 EnumConstant getATls13ProtocolConstant ( ) {
8687 result = this .getAnEnumConstant ( ) and
@@ -97,7 +98,7 @@ module BoostorgAsio {
9798 }
9899
99100 /**
100- * returns the value of a generic TLS or SSL/TLS protocol
101+ * Gets an enumeration constant for a generic TLS or SSL/TLS protocol.
101102 */
102103 EnumConstant getAGenericTlsProtocolConstant ( ) {
103104 result = this .getAnEnumConstant ( ) and
@@ -116,7 +117,7 @@ module BoostorgAsio {
116117 }
117118
118119 /**
119- * returns the value of a generic SSL/TLS protocol
120+ * Gets an enumeration constant for a generic SSL/TLS protocol.
120121 */
121122 EnumConstant getASslv23ProtocolConstant ( ) {
122123 result = this .getAnEnumConstant ( ) and
@@ -135,55 +136,57 @@ module BoostorgAsio {
135136 }
136137
137138 /**
138- * NOTE: ignore - Modern versions of OpenSSL do not support SSL v2 anymore, so this option is for backwards compatibility only
139+ * Gets the value for the no_sslv2 constant, right shifted by 16 bits.
140+ *
141+ * Note that modern versions of OpelSSL do not support SSL v2, so this option is for backwards compatibility only.
139142 */
140143 int getShiftedSslOptionsNoSsl2 ( ) {
141144 // SSL_OP_NO_SSLv2 was removed from modern OpenSSL versions
142145 result = 0
143146 }
144147
145148 /**
146- * RightShift(16) value for no_sslv3 constant
149+ * Gets the value for the no_sslv3 constant, right shifted by 16 bits.
147150 */
148151 int getShiftedSslOptionsNoSsl3 ( ) {
149152 // SSL_OP_NO_SSLv3 == 0x02000000U
150153 result = 512
151154 }
152155
153156 /**
154- * RightShift(16) value for no_tlsv1 constant
157+ * Gets the value for the no_tlsv1 constant, right shifted by 16 bits.
155158 */
156159 int getShiftedSslOptionsNoTls1 ( ) {
157160 // SSL_OP_NO_TLSv1 == 0x04000000U
158161 result = 1024
159162 }
160163
161164 /**
162- * RightShift(16) value for no_tlsv1_1 constant
165+ * Gets the value for the no_tlsv1_1 constant, right shifted by 16 bits.
163166 */
164167 int getShiftedSslOptionsNoTls1_1 ( ) {
165168 // SSL_OP_NO_TLSv1_1 == 0x10000000U
166169 result = 4096
167170 }
168171
169172 /**
170- * RightShift(16) value for no_tlsv1_2 constant
173+ * Gets the value for the no_tlsv1_2 constant, right shifted by 16 bits.
171174 */
172175 int getShiftedSslOptionsNoTls1_2 ( ) {
173176 // SSL_OP_NO_TLSv1_2 == 0x08000000U
174177 result = 2048
175178 }
176179
177180 /**
178- * RightShift(16) value for no_tlsv1_3 constant
181+ * Gets the value for the no_tlsv1_3 constant, right shifted by 16 bits.
179182 */
180183 int getShiftedSslOptionsNoTls1_3 ( ) {
181184 // SSL_OP_NO_TLSv1_2 == 0x20000000U
182185 result = 8192
183186 }
184187
185188 /**
186- * Represents boost::asio::ssl::context class
189+ * Represents the ` boost::asio::ssl::context` class.
187190 */
188191 class SslContextClass extends Class {
189192 SslContextClass ( ) { this .getQualifiedName ( ) = "boost::asio::ssl::context" }
@@ -196,7 +199,7 @@ module BoostorgAsio {
196199 }
197200
198201 /**
199- * Represents boost::asio::ssl::context::set_options member function
202+ * Represents ` boost::asio::ssl::context::set_options` member function.
200203 */
201204 class SslSetOptionsFunction extends Function {
202205 SslSetOptionsFunction ( ) {
@@ -205,7 +208,7 @@ module BoostorgAsio {
205208 }
206209
207210 /**
208- * holds if the expression represents a banned protocol
211+ * Holds if the expression represents a banned protocol.
209212 */
210213 predicate isExprBannedBoostProtocol ( Expr e ) {
211214 exists ( Literal va | va = e |
@@ -244,7 +247,7 @@ module BoostorgAsio {
244247 }
245248
246249 /**
247- * holds if the expression represents a TLS v1.2 protocol
250+ * Holds if the expression represents a TLS v1.2 protocol.
248251 */
249252 predicate isExprTls12BoostProtocol ( Expr e ) {
250253 exists ( Literal va | va = e |
@@ -269,7 +272,7 @@ module BoostorgAsio {
269272 }
270273
271274 /**
272- * holds if the expression represents a protocol that requires Crypto Board approval
275+ * Holds if the expression represents a protocol that requires Crypto Board approval.
273276 */
274277 predicate isExprTls13BoostProtocol ( Expr e ) {
275278 exists ( Literal va | va = e |
@@ -294,7 +297,7 @@ module BoostorgAsio {
294297 }
295298
296299 /**
297- * holds if the expression represents a generic TLS or SSL/TLS protocol
300+ * Holds if the expression represents a generic TLS or SSL/TLS protocol.
298301 */
299302 predicate isExprTlsBoostProtocol ( Expr e ) {
300303 exists ( Literal va | va = e |
@@ -325,7 +328,7 @@ module BoostorgAsio {
325328 }
326329
327330 /**
328- * holds if the expression represents a generic SSl/TLS protocol
331+ * Holds if the expression represents a generic SSl/TLS protocol.
329332 */
330333 predicate isExprSslV23BoostProtocol ( Expr e ) {
331334 exists ( Literal va | va = e |
@@ -351,7 +354,8 @@ module BoostorgAsio {
351354
352355 //////////////////////// Dataflow /////////////////////
353356 /**
354- * Abstract - Protocol value Flows to the first argument of the context constructor
357+ * Abstract class for flows of protocol values to the first argument of a context
358+ * constructor.
355359 */
356360 abstract class SslContextCallAbstractConfig extends DataFlow:: Configuration {
357361 bindingset [ this ]
@@ -366,7 +370,7 @@ module BoostorgAsio {
366370 }
367371
368372 /**
369- * any Protocol value Flows to the first argument of the context constructor
373+ * Any protocol value that flows to the first argument of a context constructor.
370374 */
371375 class SslContextCallConfig extends SslContextCallAbstractConfig {
372376 SslContextCallConfig ( ) { this = "SslContextCallConfig" }
@@ -380,7 +384,7 @@ module BoostorgAsio {
380384 }
381385
382386 /**
383- * a banned protocol value Flows to the first argument of the context constructor
387+ * A banned protocol value that flows to the first argument of a context constructor.
384388 */
385389 class SslContextCallBannedProtocolConfig extends SslContextCallAbstractConfig {
386390 SslContextCallBannedProtocolConfig ( ) { this = "SslContextCallBannedProtocolConfig" }
@@ -395,7 +399,7 @@ module BoostorgAsio {
395399 }
396400
397401 /**
398- * a TLS 1.2 protocol value Flows to the first argument of the context constructor
402+ * A TLS 1.2 protocol value that flows to the first argument of a context constructor.
399403 */
400404 class SslContextCallTls12ProtocolConfig extends SslContextCallAbstractConfig {
401405 SslContextCallTls12ProtocolConfig ( ) { this = "SslContextCallTls12ProtocolConfig" }
@@ -410,7 +414,7 @@ module BoostorgAsio {
410414 }
411415
412416 /**
413- * a TLS 1.3 protocol value Flows to the first argument of the context constructor
417+ * A TLS 1.3 protocol value that flows to the first argument of a context constructor.
414418 */
415419 class SslContextCallTls13ProtocolConfig extends SslContextCallAbstractConfig {
416420 SslContextCallTls13ProtocolConfig ( ) { this = "SslContextCallTls12ProtocolConfig" }
@@ -425,7 +429,7 @@ module BoostorgAsio {
425429 }
426430
427431 /**
428- * a generic TLS protocol value Flows to the first argument of the context constructor
432+ * A generic TLS protocol value that flows to the first argument of a context constructor.
429433 */
430434 class SslContextCallTlsProtocolConfig extends SslContextCallAbstractConfig {
431435 SslContextCallTlsProtocolConfig ( ) { this = "SslContextCallTlsProtocolConfig" }
@@ -440,7 +444,7 @@ module BoostorgAsio {
440444 }
441445
442446 /**
443- * a context constructor call flows to a call calling SetOptions()
447+ * A context constructor call that flows to a call to ` SetOptions()`.
444448 */
445449 class SslContextFlowsToSetOptionConfig extends DataFlow:: Configuration {
446450 SslContextFlowsToSetOptionConfig ( ) { this = "SslContextFlowsToSetOptionConfig" }
@@ -464,7 +468,7 @@ module BoostorgAsio {
464468 }
465469
466470 /**
467- * an option value flows to the 1st parameter of SetOptions()
471+ * An option value that flows to the first parameter of a call to ` SetOptions()`.
468472 */
469473 class SslOptionConfig extends DataFlow:: Configuration {
470474 SslOptionConfig ( ) { this = "SslOptionConfig" }
0 commit comments