• 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

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
   reload(init_args);
52✔
19
}
53✔
20

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

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

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

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

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

43
}
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