• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

randombit / botan / 5079590438

25 May 2023 12:28PM UTC coverage: 92.228% (+0.5%) from 91.723%
5079590438

Pull #3502

github

Pull Request #3502: Apply clang-format to the codebase

75589 of 81959 relevant lines covered (92.23%)

12139530.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

50.0
/src/fuzzer/x509_dn.cpp
1
/*
2
* (C) 2019 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6

7
#include "fuzzers.h"
8

9
#include <botan/ber_dec.h>
10
#include <botan/hex.h>
11
#include <botan/pkix_types.h>
12

13
void fuzz(const uint8_t in[], size_t len) {
140✔
14
   Botan::X509_DN dn1;
140✔
15
   Botan::X509_DN dn2;
140✔
16

17
   try {
140✔
18
      Botan::BER_Decoder ber(in, len);
140✔
19
      dn1.decode_from(ber);
140✔
20
      dn2.decode_from(ber);
×
21
   } catch(...) { return; }
280✔
22

23
   const bool eq = dn1 == dn2;
×
24
   const bool lt1 = dn1 < dn2;
×
25
   const bool lt2 = dn2 < dn1;
×
26

27
   if(lt1 == false && lt2 == false) {
×
28
      FUZZER_ASSERT_TRUE(eq);
×
29
   } else {
30
      // one is less than the other
31
      FUZZER_ASSERT_TRUE(lt1 || lt2);
×
32

33
      // it is not the case that both are less than the other
34
      FUZZER_ASSERT_TRUE(!lt1 || !lt2);
×
35
   }
36
}
140✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc