Botan
3.7.1
Crypto and TLS for C&
Toggle main menu visibility
Main Page
Related Pages
Topics
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Variables
Typedefs
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
Enumerations
a
c
d
e
f
g
h
k
l
m
n
o
p
r
s
t
u
v
w
Enumerator
c
d
f
i
m
n
r
s
t
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
f
h
i
m
n
o
p
r
s
t
u
v
w
Enumerations
b
c
d
e
k
m
n
o
p
s
t
x
Enumerator
_
a
b
c
d
e
f
h
k
l
m
n
p
q
r
s
t
u
w
x
Related Symbols
b
c
d
e
f
k
o
p
s
t
x
Files
File List
File Members
All
_
a
b
c
d
e
f
i
k
m
n
o
p
q
s
t
u
w
x
y
z
Functions
b
c
Variables
Typedefs
b
c
e
p
t
Enumerations
Enumerator
b
c
d
e
k
n
Macros
_
a
b
c
f
m
n
q
s
t
w
src
lib
utils
dyn_load
dyn_load.h
Go to the documentation of this file.
1
/*
2
* Dynamically Loaded Object
3
* (C) 2010 Jack Lloyd
4
*
5
* Botan is released under the Simplified BSD License (see license.txt)
6
*/
7
8
#ifndef BOTAN_DYNAMIC_LOADER_H_
9
#define BOTAN_DYNAMIC_LOADER_H_
10
11
#include <botan/types.h>
12
#include <string>
13
14
namespace
Botan
{
15
16
/**
17
* Represents a DLL or shared object
18
*/
19
class
BOTAN_TEST_API
Dynamically_Loaded_Library
final
{
20
public
:
21
/**
22
* Load a DLL (or fail with an exception)
23
* @param lib_name name or path to a library
24
*
25
* If you don't use a full path, the search order will be defined
26
* by whatever the system linker does by default. Always using fully
27
* qualified pathnames can help prevent code injection attacks (eg
28
* via manipulation of LD_LIBRARY_PATH on Linux)
29
*/
30
Dynamically_Loaded_Library
(std::string_view lib_name);
31
32
/**
33
* Unload the DLL
34
* @warning Any pointers returned by resolve()/resolve_symbol()
35
* should not be used after this destructor runs.
36
*/
37
~Dynamically_Loaded_Library
();
38
39
/**
40
* Load a symbol (or fail with an exception)
41
* @param symbol names the symbol to load
42
* @return address of the loaded symbol
43
*/
44
void
* resolve_symbol(
const
std::string& symbol);
45
46
/**
47
* Convenience function for casting symbol to the right type
48
* @param symbol names the symbol to load
49
* @return address of the loaded symbol
50
*/
51
template
<
typename
T>
52
T
resolve
(
const
std::string& symbol) {
53
return
reinterpret_cast<
T
>
(resolve_symbol(symbol));
54
}
52
T
resolve
(
const
std::string& symbol) {
…
}
55
56
private
:
57
Dynamically_Loaded_Library
(
const
Dynamically_Loaded_Library
&);
58
Dynamically_Loaded_Library
& operator=(
const
Dynamically_Loaded_Library
&);
59
60
std::string m_lib_name;
61
void
* m_lib;
62
};
19
class
BOTAN_TEST_API
Dynamically_Loaded_Library
final
{
…
};
63
64
}
// namespace Botan
65
66
#endif
BOTAN_TEST_API
#define BOTAN_TEST_API
Definition
api.h:39
Botan::Dynamically_Loaded_Library
Definition
dyn_load.h:19
Botan::Dynamically_Loaded_Library::resolve
T resolve(const std::string &symbol)
Definition
dyn_load.h:52
final
int(* final)(unsigned char *, CTX *)
Definition
commoncrypto_hash.cpp:29
T
FE_25519 T
Definition
ge.cpp:34
Botan
Definition
alg_id.cpp:13
Generated by
1.12.0