Skip to content

Commit

Permalink
Add PKCS12 support and KeyStore container. (#16)
Browse files Browse the repository at this point in the history
* Add PKCS12 parser and KeyStore.

* Switch JKS to use KeyStore.

* Shuffle includes.

* Add Doxygen comments in new headers.

* Update documentation.

* Version bump.
  • Loading branch information
madf authored Nov 25, 2021
1 parent 2af763d commit 8c65e84
Show file tree
Hide file tree
Showing 69 changed files with 1,931 additions and 1,845 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
project(dstu-engine LANGUAGES C VERSION 1.2.2)
project(dstu-engine LANGUAGES C VERSION 1.3.0)

option(BUILD_TESTS "Build tests." OFF)
option(ENABLE_CODECOV "Enable code coverage analysis." OFF)
Expand All @@ -25,6 +25,7 @@ bugprone-*,\
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,\
-bugprone-easily-swappable-parameters,\
-modernize-avoid-bind,\
-misc-no-recursion,\
-modernize-use-trailing-return-type,\
-readability-braces-around-statements, \
-readability-function-cognitive-complexity,\
Expand Down
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = README.md keylib/key6.h keylib/jks.h
INPUT = README.md keylib/key6.h keylib/jks.h keylib/pkcs12.h keylib/keystore.h

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down
12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,10 @@ ENGINE_set_default(engine, ENGINE_METHOD_ALL);
auto* fp = fopen(file.c_str(), "r");
// Key-6.dat may contain 1 or 2 keys
EVP_PKEY** keys = nullptr;
size_t numKeys = 0;
readKey6(fp, password.c_str(), password.length(), &keys, &numKeys);
// Delete all keys after use
for (size_t i = 0; i < numKeys; ++i)
EVP_PKEY_free(keys[i]);
KeyStore* ks = NULL;
readKey6(fp, password.c_str(), password.length(), &ks);
KeyStoreFree(ks);
OPENSSL_free(keys);
fclose(fp);
Expand Down
19 changes: 11 additions & 8 deletions docs/dir_5e57c488afef9ef24045388a5764f023.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Keylib: keylib Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
Expand All @@ -30,21 +30,18 @@
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
Expand Down Expand Up @@ -79,13 +76,19 @@
<tr class="memitem:key6_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="key6_8h.html">key6.h</a> <a href="key6_8h_source.html">[code]</a></td></tr>
<tr class="memdesc:key6_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Functions for reading keys from IIT Key-6.dat container. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:keystore_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="keystore_8h.html">keystore.h</a> <a href="keystore_8h_source.html">[code]</a></td></tr>
<tr class="memdesc:keystore_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">KeyStore is a container for keys and certificates. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:pkcs12_8h"><td class="memItemLeft" align="right" valign="top">file &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="pkcs12_8h.html">pkcs12.h</a> <a href="pkcs12_8h_source.html">[code]</a></td></tr>
<tr class="memdesc:pkcs12_8h"><td class="mdescLeft">&#160;</td><td class="mdescRight">Functions for reading keys from PKCS#12 container. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</a> 1.8.13
</small></address>
</body>
</html>
Loading

0 comments on commit 8c65e84

Please sign in to comment.