Skip to content

Commit fe6faab

Browse files
authored
Merge pull request #2 from dgarske/changelog
Added ChangeLog in prep for v1.0 tag
2 parents 12d604b + 0a7fbf6 commit fe6faab

File tree

13 files changed

+171
-34
lines changed

13 files changed

+171
-34
lines changed

ChangeLog.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# wolfKeyMgr v1.0 (Sep 1, 2021)
2+
* Support for Curve25519 and Curve448 in key manager.
3+
* Support for Curve25519 in middle-box decryption.
4+
* Support for loading all supported ephemeral keys.
5+
* Refactor common ETSI client test code.
6+
* Improved middle-box decryption to better handle concurrent keys of different formats.
7+
* Improved handling for not compiled in cases.
8+
* Fix for ./configure config summary.
9+
10+
# wolfKeyMgr v0.11 (Aug 4, 2021)
11+
* Fix to use fingerprint to find keys.
12+
* Improved the fingerprint calculation code and added hash.
13+
* Added multiple server support using `contextStr`.
14+
* Add unit test to `make check`.
15+
* Improve `src/wolfkeymgr` exit documentation.
16+
* Added example output for demo to `README.md`.
17+
18+
# wolfKeyMgr v0.10 (Jul 30, 2021)
19+
* Added secure vault for key storage using RSA and AES GCM.
20+
* Added support for multiple active key types.
21+
* Added key find support.
22+
* Added middlebox decrypt PCAP replay support.
23+
* Added key max use count to limit uses of an ephemeral key.
24+
* Added computed "name" based on public key for ETSI key.
25+
* Added API unit test framework.
26+
* Added `--enable-vault=clear` option to optionally disable vault encryption.
27+
* Fix to not start listeners until key/cert/vault setup.
28+
* Fixed issue with worker threads generating new keys and not using existing ones.
29+
* Fix for https example server listen error handling.
30+
* Fixed gets with newline.
31+
* Fix for middlebox/decrypt default loopback interface selection. Default to first interface (1).
32+
* Fix for request / response collision. Centralize the max buffer sizes.
33+
* Moved key gen into ETSI module.
34+
* Rename `wolfEtsiKeyGet` to `wolfEtsiKeyGetPtr`.
35+
* Refactor to support multiple active key types.
36+
* Improved printing of public key name in logs.
37+
* Improved error for key generation failure.
38+
* Improve libevent and browser issue documentation.
39+
* Improve middle-box decryption error handling for permissions issue.
40+
* Cleanups to remove `WOLFKM_ETSI_SERVICE` and `disableMutalAuth`.
41+
* Move the ETSI documentation into `docs/README.md`. Remove copies of specs and use links.
42+
* Cleanup ETSI service configuration and defaults.
43+
44+
# wolfKeyMgr v0.9 (Jun 15, 2021)
45+
* Added HTTPS server / client for local testing.
46+
* Added middle-box decryption example (uses the wolfSSL sniffer module).
47+
* Fixes for HTTP engine parsing.
48+
* Improve socket select error reporting for timeout vs. error.
49+
* Added ETSI client push support.
50+
* Added ability to specify default key type for Key Manager.
51+
* Added better debug printing for key used.
52+
53+
# wolfKeyMgr v0.8 (May 24, 2021)
54+
* Added DH key support.
55+
* Added HTTP support for fingerprints, groups and contextstr.
56+
* Added ETSI client key argument (`-K`).
57+
* Fixes for URI encoding.
58+
* Refactor of service to support more key types.
59+
* Refactor of internal structure names to leading upper case.
60+
* Removed the "noTLS" build option.
61+
62+
# wolfKeyMgr v0.7 (May 17, 2021)
63+
* Fix for HTTP header encode/decode conflict with variable `i`.
64+
* Fix for HTTP server response parsing with no null termination issue.
65+
* Added expires data to HTTP response.
66+
* Added ETSI client GET caching.
67+
* Added etsi_client `-r` support for GET (test caching).
68+
69+
# wolfKeyMgr v0.6 (May 12, 2021)
70+
* Fix for ETSI client to properly detect socket error with non-blocking connect.
71+
* Added EtsiKey struct and modified the wolfEtsiClientGet() API.
72+
* Implemented some ETSI key helpers.
73+
* Added stub API's for future push/find with callbacks.
74+
* Progress with handling key expiration data and other key types.
75+
76+
# wolfKeyMgr v0.5 (May 10, 2021)
77+
* Fix for missing "make dist" files.
78+
* Fix possible seg fault if pid creation failed.
79+
* Fixed issue with forcful close of listen socket causing loop.
80+
* Added missing files for cert generation.
81+
* Added fingerprint to push syntax.
82+
* Added TODO item for key expires.
83+
* Remove certservice requirement.
84+
* Cleanup unused `KeyManager_t`.
85+
* Do not track and ignore options.h.
86+
* Spelling fixes.
87+
88+
# wolfKeyMgr v0.4 (Mar 1, 2021)
89+
* Fix for stray `wolfSSL_CTX_free`.
90+
* Added mutex protection on ETSI client.
91+
* Added URL decoding to HTTP module.
92+
* Added SIGPIPE ignore to ETSI client.
93+
* Added test key/certificate for Apache HTTPD.
94+
* Added "-r" argument for key manager for the key update interval.
95+
96+
# wolfKeyMgr v0.3 (Feb 24, 2021)
97+
* Added TLS mutual authentication.
98+
* Improved logging and flushing of logging on SIGINT/SIGTERM.
99+
* Added SIGTERM support.
100+
* Improved README.md example steps.
101+
* Fixes for libwolfkeymgr headers for shared use.
102+
* Fix for missing shared library header files. Stop tracking options.h.
103+
104+
# wolfKeyMgr v0.2 (Feb 19, 2021)
105+
* Fixes for threading.
106+
* Added libwolfkeymgr for general use API's.
107+
* Added ETSI client API's.
108+
* Added full HTTP server/client support.
109+
* Abstraction of all modules to library for generic socket, TLS, HTTP and ETSI functions.
110+
* Added non-blocking support for client.
111+
* Added version header.
112+
* Improvement to performance.
113+
114+
# wolfKeyMgr v0.1 - Initial version (Feb 15, 2021)
115+
* Supports ETSI (Enterprise Transport Security) key manager for Get and Push of TLS static ephemeral keys.
116+
* Supports Certificate Signing (enabled with `--enable-certsvc`) disabled by default.

Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ DISTCLEANFILES+= aminclude.am
2424

2525
ACLOCAL_AMFLAGS = -I m4
2626
EXTRA_DIST += README.md
27+
EXTRA_DIST += ChangeLog.md
2728
EXTRA_DIST += LICENSE
2829

2930
include src/include.am

examples/https/client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int https_client_test(int argc, char** argv)
4040
wolfSSL_Init();
4141

4242
/* log setup */
43-
//wolfSSL_Debugging_ON();
43+
/* wolfSSL_Debugging_ON(); */
4444
wolfKeyMgr_SetLogFile(NULL, 0, WOLFKM_LOG_DEBUG);
4545

4646
ctx = wolfTlsClientNew();

examples/https/server.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ int https_server_test(int argc, char** argv)
7171
wolfSSL_Init();
7272

7373
/* log setup */
74-
//wolfSSL_Debugging_ON();
74+
/* wolfSSL_Debugging_ON(); */
7575
wolfKeyMgr_SetLogFile(NULL, 0, WOLFKM_LOG_DEBUG);
7676

7777
ctx = wolfTlsServerNew();

examples/test_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ int etsi_client_connect(const char* urlStr)
4242
ETSI_TEST_CLIENT_CERT, WOLFSSL_FILETYPE_PEM);
4343

4444
if (urlStr) {
45-
strncpy(urlStrCopy, urlStr, HTTP_MAX_URI);
45+
strncpy(urlStrCopy, urlStr, (HTTP_MAX_URI - 1));
4646
memset(&url, 0, sizeof(url));
4747
wolfHttpUrlDecode(&url, urlStrCopy);
4848
}

examples/test_config.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ extern "C" {
3535
#define ETSI_TEST_TIMEOUT_MS 2
3636
#define ETSI_TEST_KEY_TYPE ETSI_KEY_TYPE_SECP256R1
3737

38-
/* example certificate and key for mutual authentication to key manager */
39-
/* see ./certs/test-cert.sh for generation and signing */
38+
/* Example certificate and key for mutual authentication to key manager.
39+
* See ./certs/test-cert.sh for generation and signing. */
4040
#define ETSI_TEST_CLIENT_CA "certs/ca-cert.pem"
4141
#define ETSI_TEST_CLIENT_KEY "certs/client-key.pem"
4242
#define ETSI_TEST_CLIENT_PASS "wolfssl"
@@ -48,8 +48,8 @@ extern "C" {
4848
#define HTTPS_TEST_TIMEOUT_SEC 30
4949
#define HTTPS_TEST_MAX_DATA 512
5050

51-
/* see ./certs/test-cert.sh for generation and signing */
52-
/* this is a self signed test cert server presents */
51+
/* See ./certs/test-cert.sh for generation and signing.
52+
* This is a self signed test cert the server can present. */
5353
#define HTTPS_TEST_CA "certs/test-cert.pem"
5454
#define HTTPS_TEST_CERT "certs/test-cert.pem"
5555
#define HTTPS_TEST_KEY "certs/test-key.pem"

src/sock_mgr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ static void OurListenerError(struct evconnlistener* listener, void* ptr)
164164
}
165165
/* for invalid argument disable listener */
166166
if (err == EINVAL) {
167-
/* this can happen if ss -kill socket is run */
168-
/* otherwise causes libevent error callback loop */
167+
/* this can happen if ss -kill socket is run,
168+
* otherwise causes libevent error callback loop */
169169
evconnlistener_disable(listener);
170170
}
171171
}
@@ -390,7 +390,7 @@ static void WorkerExit(void* arg)
390390

391391
/* put per thread stats into global stats */
392392
/* do this before closing active connections,
393-
so we can see how many were connected */
393+
* so we can see how many were connected */
394394
pthread_mutex_lock(&svc->globalStats.lock);
395395
svc->globalStats.totalConnections += threadStats.totalConnections;
396396
svc->globalStats.completedRequests += threadStats.completedRequests;

src/svc_etsi.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ typedef struct EtsiSvcCtx {
5151
#ifdef WOLFKM_VAULT
5252
wolfVaultCtx* vault; /* key vault */
5353
#endif
54+
55+
byte shutdown:1; /* signal to shutdown workers */
5456
} EtsiSvcCtx;
5557
static EtsiSvcCtx gSvcCtx;
5658

57-
/* the top level service */
59+
/* The top level service */
5860
static SvcInfo gEtsiService = {
5961
.desc = "ETSI",
6062

@@ -130,6 +132,14 @@ static int EtsiSvcGenNewKey(EtsiSvcCtx* svcCtx, EtsiKeyType keyType, EtsiKey* ke
130132
return ret;
131133
}
132134

135+
static void WakeKeyGenWorker(EtsiSvcCtx* svcCtx)
136+
{
137+
/* signal key generation thread to wake */
138+
pthread_mutex_lock(&svcCtx->kgMutex);
139+
pthread_cond_signal(&svcCtx->kgCond);
140+
pthread_mutex_unlock(&svcCtx->kgMutex);
141+
}
142+
133143
static int SetupKeyPackage(SvcConn* conn, EtsiSvcCtx* svcCtx)
134144
{
135145
int ret = 0, i;
@@ -222,9 +232,7 @@ static int SetupKeyPackage(SvcConn* conn, EtsiSvcCtx* svcCtx)
222232

223233
if (wakeKg) {
224234
/* signal key generation thread to wake */
225-
pthread_mutex_lock(&svcCtx->kgMutex);
226-
pthread_cond_signal(&svcCtx->kgCond);
227-
pthread_mutex_unlock(&svcCtx->kgMutex);
235+
WakeKeyGenWorker(svcCtx);
228236
}
229237

230238
return ret;
@@ -318,7 +326,7 @@ static void* KeyPushWorker(void* arg)
318326
pthread_mutex_unlock(&svcCtx->kgMutex);
319327

320328
XLOG(WOLFKM_LOG_DEBUG, "Key Generation Worker Wake %d sec\n", ret);
321-
} while (1);
329+
} while (!svcCtx->shutdown);
322330

323331
return NULL;
324332
}
@@ -347,7 +355,7 @@ static int wolfEtsiSvc_DoResponse(SvcConn* conn)
347355
return ret;
348356
}
349357

350-
/* the key request handler */
358+
/* The key request handler */
351359
int wolfEtsiSvc_DoRequest(SvcConn* conn)
352360
{
353361
int ret = 0;
@@ -581,6 +589,10 @@ void wolfEtsiSvc_Cleanup(SvcInfo* svc)
581589

582590
wc_FreeRng(&svcCtx->rng);
583591

592+
/* signal shutdown and wake worker */
593+
svcCtx->shutdown = 1;
594+
WakeKeyGenWorker(svcCtx);
595+
584596
pthread_mutex_destroy(&svcCtx->kgMutex);
585597
pthread_cond_destroy(&svcCtx->kgCond);
586598

tests/unit_tests.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* api.c
1+
/* unit_tests.c
22
*
33
* Copyright (C) 2006-2021 wolfSSL Inc.
44
*
@@ -62,7 +62,6 @@ static int vault_test(void)
6262
wolfVaultCtx* ctx = NULL;
6363
wolfVaultItem item;
6464
const char* testFile = "vault.bin";
65-
//const char* testPass = "password";
6665
struct vaultTestItems {
6766
word32 type;
6867
const char* name;

wolfkeymgr/mod_etsi.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,11 @@ typedef struct EtsiKey {
124124
} EtsiKey;
125125

126126
/* Key callback Function */
127-
/* if return code is not zero then socket will be closed */
127+
/* If return code is not zero then socket will be closed */
128128
typedef int (*EtsiKeyCallbackFunc)(EtsiClientCtx* client, EtsiKey* key, void* cbCtx);
129129

130130
/* ETSI Client API's */
131-
/* allocate new ETSI client context */
131+
/* Allocate new ETSI client context */
132132
WOLFKM_API EtsiClientCtx* wolfEtsiClientNew(void);
133133

134134
/* Setup the TLS mutual authentication key/certificate for accessing the ETSI Key Manager */
@@ -160,8 +160,8 @@ WOLFKM_API int wolfEtsiClientGet(EtsiClientCtx* client, EtsiKey* key,
160160
EtsiKeyType keyType, const char* fingerprint, const char* contextStr,
161161
int timeoutSec);
162162

163-
/* this call will be blocking until socket failure or callback non-zero return */
164-
/* when server pushes new keys the callback will trigger with EtsiKey populated */
163+
/* This call will be blocking until socket failure or callback non-zero return
164+
* when server pushes new keys the callback will trigger with EtsiKey populated */
165165
WOLFKM_API int wolfEtsiClientPush(EtsiClientCtx* client, EtsiKeyType keyType,
166166
const char* fingerprint, const char* contextStr,
167167
EtsiKeyCallbackFunc cb, void* cbCtx);
@@ -178,8 +178,8 @@ WOLFKM_API int wolfEtsiClientClose(EtsiClientCtx* client);
178178
WOLFKM_API void wolfEtsiClientFree(EtsiClientCtx* client);
179179

180180
/* ETSI Key API's */
181-
/* allocate ETSI key dynamically from heap */
182-
/* The EtsiKey can come from stack, but must be memset to zero */
181+
/* Allocate ETSI key dynamically from heap.
182+
* The EtsiKey can come from stack, but must be memset to zero. */
183183
WOLFKM_API EtsiKey* wolfEtsiKeyNew(void);
184184
/* Returns the wolf PK type (enum wc_PkType) */
185185
WOLFKM_API int wolfEtsiKeyGetPkType(EtsiKey* key);
@@ -193,9 +193,9 @@ WOLFKM_API int wolfEtsiKeyLoadSSL(EtsiKey* key, WOLFSSL* ssl);
193193
WOLFKM_API int wolfEtsiKeyGetPtr(EtsiKey* key, byte** response, word32* responseSz);
194194
/* Generate a new key */
195195
WOLFKM_API int wolfEtsiKeyGen(EtsiKey* key, EtsiKeyType keyType, WC_RNG* rng);
196-
/* print ETSI key data - for debugging / testing */
196+
/* Print ETSI key data - for debugging / testing */
197197
WOLFKM_API void wolfEtsiKeyPrint(EtsiKey* key);
198-
/* release ETSI key resources */
198+
/* Release ETSI key resources */
199199
WOLFKM_API void wolfEtsiKeyFree(EtsiKey* key);
200200

201201
WOLFKM_API const char* wolfEtsiKeyNamedGroupStr(EtsiKey* key);
@@ -208,7 +208,8 @@ WOLFKM_API int wolfEtsiCalcTlsFingerprint(EtsiKeyType keyType,
208208
/* Build public name for key */
209209
WOLFKM_API int wolfEtsiKeyComputeName(EtsiKey* key);
210210

211-
/* these are required if using multiple threads sharing the wolfSSL library for init mutex protection */
211+
/* These are required if using multiple threads sharing the wolfSSL library
212+
* for init mutex protection */
212213
WOLFKM_API int wolfEtsiClientInit(void);
213214
WOLFKM_API void wolfEtsiClientCleanup(void);
214215

0 commit comments

Comments
 (0)