@@ -253,7 +253,7 @@ class OpenSSLCipherConfigurationParser {
253
253
static constexpr auto ALL = " ALL" ;
254
254
255
255
void moveToEnd (const AliasMap &aliases, std::vector<Cipher> &ciphers, std::string_view cipher) {
256
- moveToEnd (ciphers, aliases.at (cipher));
256
+ this -> moveToEnd (ciphers, aliases.at (cipher));
257
257
}
258
258
259
259
void moveToEnd (std::vector<Cipher> &ciphers, const std::vector<Cipher> &ciphersToMoveToEnd) {
@@ -297,17 +297,17 @@ class OpenSSLCipherConfigurationParser {
297
297
std::sort (ciphers.begin (), ciphers.end (), byStrength);
298
298
299
299
auto it =
300
- std::stable_partition (ciphers.begin (), ciphers.end (), byKeyExchange (KeyExchange::EECDH));
300
+ std::stable_partition (ciphers.begin (), ciphers.end (), this -> byKeyExchange (KeyExchange::EECDH));
301
301
302
302
/* AES is our preferred symmetric cipher */
303
303
auto aes = {Encryption::AES128, Encryption::AES128GCM, Encryption::AES256,
304
304
Encryption::AES256GCM};
305
305
306
306
/* Now arrange all ciphers by preference: */
307
- it = std::stable_partition (it, ciphers.end (), byEncryption (aes));
307
+ it = std::stable_partition (it, ciphers.end (), this -> byEncryption (aes));
308
308
309
309
/* Move ciphers without forward secrecy to the end */ ;
310
- std::stable_partition (it, ciphers.end (), [compare = byKeyExchange (KeyExchange::RSA)](auto &c) {
310
+ std::stable_partition (it, ciphers.end (), [compare = this -> byKeyExchange (KeyExchange::RSA)](auto &c) {
311
311
return !compare (c);
312
312
});
313
313
}
@@ -374,11 +374,11 @@ class OpenSSLCipherConfigurationParser {
374
374
std::vector<std::string_view> result;
375
375
376
376
while (!string.empty ()) {
377
- auto [line, rest] = split_on (string, ' :' );
377
+ auto [line, rest] = this -> split_on (string, ' :' );
378
378
string = rest;
379
379
380
380
while (!line.empty ()) {
381
- auto [part, rest] = split_on (line, ' ,' );
381
+ auto [part, rest] = this -> split_on (line, ' ,' );
382
382
line = rest;
383
383
result.push_back (part);
384
384
}
@@ -418,29 +418,29 @@ class OpenSSLCipherConfigurationParser {
418
418
// bits, and some cipher suites with 128-bit keys.
419
419
std::vector<Cipher> high;
420
420
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (high),
421
- byEncryptionLevel (EncryptionLevel::HIGH));
421
+ this -> byEncryptionLevel (EncryptionLevel::HIGH));
422
422
aliases.insert ({HIGH, high});
423
423
// "Medium" encryption cipher suites, currently some of those using 128 bit encryption.
424
424
std::vector<Cipher> medium;
425
425
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (medium),
426
- byEncryptionLevel (EncryptionLevel::MEDIUM));
426
+ this -> byEncryptionLevel (EncryptionLevel::MEDIUM));
427
427
aliases.insert ({MEDIUM, medium});
428
428
429
429
// Cipher suites using RSA key exchange or authentication. RSA is an alias for kRSA.
430
430
std::vector<Cipher> krsa;
431
431
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (krsa),
432
- byKeyExchange (KeyExchange::RSA));
432
+ this -> byKeyExchange (KeyExchange::RSA));
433
433
aliases.insert ({kRSA , krsa});
434
434
std::vector<Cipher> arsa;
435
435
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (arsa),
436
- byAuthentication (Authentication::RSA));
436
+ this -> byAuthentication (Authentication::RSA));
437
437
aliases.insert ({aRSA, arsa});
438
438
aliases.insert ({RSA, krsa});
439
439
440
440
// Cipher suites using ephemeral ECDH key agreement, including anonymous cipher suites.
441
441
std::vector<Cipher> ecdh;
442
442
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (ecdh),
443
- byKeyExchange (KeyExchange::EECDH));
443
+ this -> byKeyExchange (KeyExchange::EECDH));
444
444
aliases.insert ({kEECDH , ecdh});
445
445
aliases.insert ({kECDHE , ecdh});
446
446
aliases.insert ({ECDH, ecdh});
@@ -455,27 +455,27 @@ class OpenSSLCipherConfigurationParser {
455
455
// or TLS, they only affect the list of available cipher suites.
456
456
std::vector<Cipher> tlsv2;
457
457
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (tlsv2),
458
- byProtocol (Protocol::TLSv1_2));
458
+ this -> byProtocol (Protocol::TLSv1_2));
459
459
aliases.insert ({SSL_PROTO_TLSv1_2, tlsv2});
460
460
std::vector<Cipher> tlsv1;
461
461
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (tlsv1),
462
- byProtocol (Protocol::TLSv1));
462
+ this -> byProtocol (Protocol::TLSv1));
463
463
aliases.insert ({SSL_PROTO_TLSv1_0, tlsv1});
464
464
aliases.insert ({SSL_PROTO_TLSv1, tlsv1});
465
465
std::vector<Cipher> sslv3;
466
466
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (sslv3),
467
- byProtocol (Protocol::SSLv3));
467
+ this -> byProtocol (Protocol::SSLv3));
468
468
aliases.insert ({SSL_PROTO_SSLv3, sslv3});
469
469
470
470
// cipher suites using 128 bit AES.
471
471
std::vector<Cipher> aes128;
472
472
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (aes128),
473
- byEncryption ({Encryption::AES128, Encryption::AES128GCM}));
473
+ this -> byEncryption ({Encryption::AES128, Encryption::AES128GCM}));
474
474
aliases.insert ({AES128, aes128});
475
475
// cipher suites using 256 bit AES.
476
476
std::vector<Cipher> aes256;
477
477
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (aes256),
478
- byEncryption ({Encryption::AES256, Encryption::AES256GCM}));
478
+ this -> byEncryption ({Encryption::AES256, Encryption::AES256GCM}));
479
479
aliases.insert ({AES256, aes256});
480
480
// cipher suites using either 128 or 256 bit AES.
481
481
auto aes (aes128);
@@ -485,36 +485,36 @@ class OpenSSLCipherConfigurationParser {
485
485
// AES in Galois Counter Mode (GCM).
486
486
std::vector<Cipher> aesgcm;
487
487
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (aesgcm),
488
- byEncryption ({Encryption::AES128GCM, Encryption::AES256GCM}));
488
+ this -> byEncryption ({Encryption::AES128GCM, Encryption::AES256GCM}));
489
489
aliases.insert ({AESGCM, aesgcm});
490
490
491
491
// Cipher suites using ChaCha20.
492
492
std::vector<Cipher> chacha20;
493
493
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (chacha20),
494
- byEncryption (Encryption::CHACHA20POLY1305));
494
+ this -> byEncryption (Encryption::CHACHA20POLY1305));
495
495
aliases.insert ({CHACHA20, chacha20});
496
496
497
497
// Cipher suites using triple DES.
498
498
std::vector<Cipher> triple_des;
499
499
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (triple_des),
500
- byEncryption (Encryption::TRIPLE_DES));
500
+ this -> byEncryption (Encryption::TRIPLE_DES));
501
501
aliases.insert ({TRIPLE_DES, triple_des});
502
502
503
503
// Cipher suites using SHA1.
504
504
std::vector<Cipher> sha1;
505
505
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (sha1),
506
- byMessageDigest (MessageDigest::SHA1));
506
+ this -> byMessageDigest (MessageDigest::SHA1));
507
507
aliases.insert ({SHA1, sha1});
508
508
aliases.insert ({SHA, sha1});
509
509
// Cipher suites using SHA256.
510
510
std::vector<Cipher> sha256;
511
511
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (sha256),
512
- byMessageDigest (MessageDigest::SHA256));
512
+ this -> byMessageDigest (MessageDigest::SHA256));
513
513
aliases.insert ({SHA256, sha256});
514
514
// Cipher suites using SHA384.
515
515
std::vector<Cipher> sha384;
516
516
std::copy_if (this ->all .begin (), this ->all .end (), std::back_inserter (sha384),
517
- byMessageDigest (MessageDigest::SHA384));
517
+ this -> byMessageDigest (MessageDigest::SHA384));
518
518
aliases.insert ({SHA384, sha384});
519
519
520
520
// COMPLEMENTOFDEFAULT:
@@ -528,22 +528,22 @@ class OpenSSLCipherConfigurationParser {
528
528
529
529
// The content of the default list is determined at compile time and normally corresponds to
530
530
// ALL:!COMPLEMENTOFDEFAULT:!eNULL.
531
- aliases.insert ({DEFAULT, parse (" ALL:!COMPLEMENTOFDEFAULT:!eNULL" )});
531
+ aliases.insert ({DEFAULT, this -> parse (" ALL:!COMPLEMENTOFDEFAULT:!eNULL" )});
532
532
}
533
533
534
534
std::vector<Cipher> parse (std::string_view expression) {
535
535
/* *
536
536
* All ciphers by their openssl alias name.
537
537
*/
538
- auto elements = splitCipherSuiteString (expression);
538
+ auto elements = this -> splitCipherSuiteString (expression);
539
539
std::vector<Cipher> ciphers;
540
540
std::vector<Cipher> removedCiphers;
541
541
for (auto &element : elements) {
542
542
543
543
if (element.rfind (DELETE, 0 ) == 0 ) {
544
544
auto alias = element.substr (1 );
545
545
if (aliases.find (alias) != aliases.end ()) {
546
- remove (aliases, ciphers, alias);
546
+ this -> remove (aliases, ciphers, alias);
547
547
}
548
548
} else if (element.rfind (EXCLUDE, 0 ) == 0 ) {
549
549
auto alias = element.substr (1 );
@@ -554,15 +554,15 @@ class OpenSSLCipherConfigurationParser {
554
554
} else if (element.rfind (TO_END, 0 ) == 0 ) {
555
555
auto alias = element.substr (1 );
556
556
if (aliases.find (alias) != aliases.end ()) {
557
- moveToEnd (aliases, ciphers, alias);
557
+ this -> moveToEnd (aliases, ciphers, alias);
558
558
}
559
559
} else if (" @STRENGTH" == element) {
560
- strengthSort (ciphers);
560
+ this -> strengthSort (ciphers);
561
561
break ;
562
562
} else if (aliases.find (element) != aliases.end ()) {
563
- add (aliases, ciphers, element);
563
+ this -> add (aliases, ciphers, element);
564
564
} else if (element.find (AND) != std::string::npos) {
565
- auto intersections = split (element, " +\\ " );
565
+ auto intersections = this -> split (element, " +\\ " );
566
566
if (intersections.size () > 0 && aliases.find (intersections[0 ]) != aliases.end ()) {
567
567
auto result{aliases[intersections[0 ]]};
568
568
for (int i = 1 ; i < intersections.size (); i++) {
0 commit comments