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

randombit / botan / 5123321399

30 May 2023 04:06PM UTC coverage: 92.213% (+0.004%) from 92.209%
5123321399

Pull #3558

github

web-flow
Merge dd72f7389 into 057bcbc35
Pull Request #3558: Add braces around all if/else statements

75602 of 81986 relevant lines covered (92.21%)

11859779.3 hits per line

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

80.0
/src/lib/prov/pkcs11/p11_module.cpp
1
/*
2
* PKCS#11 Module
3
* (C) 2016 Daniel Neus, Sirrix AG
4
* (C) 2016 Philipp Weber, Sirrix AG
5
*
6
* Botan is released under the Simplified BSD License (see license.txt)
7
*/
8

9
#include <botan/p11_types.h>
10

11
#include <botan/internal/dyn_load.h>
12

13
namespace Botan::PKCS11 {
14

15
Module::Module(std::string_view file_path, C_InitializeArgs init_args) : m_file_path(file_path) {
54✔
16
   if(file_path.empty()) {
52✔
17
      throw Invalid_Argument("PKCS11 no module path specified");
×
18
   }
19
   reload(init_args);
52✔
20
}
53✔
21

22
Module::Module(Module&& other) noexcept = default;
×
23

24
Module::~Module() noexcept {
50✔
25
   try {
50✔
26
      m_low_level->C_Finalize(nullptr, nullptr);
50✔
27
   } catch(...) {
×
28
      // we are noexcept and must swallow any exception here
29
   }
×
30
}
150✔
31

32
void Module::reload(C_InitializeArgs init_args) {
53✔
33
   if(m_low_level) {
53✔
34
      m_low_level->C_Finalize(nullptr);
1✔
35
   }
36

37
   m_library = std::make_unique<Dynamically_Loaded_Library>(m_file_path);
53✔
38
   LowLevel::C_GetFunctionList(*m_library, &m_func_list);
52✔
39
   m_low_level = std::make_unique<LowLevel>(m_func_list);
53✔
40

41
   m_low_level->C_Initialize(&init_args);
52✔
42
}
51✔
43

44
}  // namespace Botan::PKCS11
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

© 2026 Coveralls, Inc