You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wolfSSL/src/chapter02.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2443,6 +2443,8 @@ Enabling this option will turn on User Atomic Record Layer Processing callbacks.
2443
2443
2444
2444
Enable Public Key Callbacks
2445
2445
2446
+
Eabling this option will turn on Public Key callbacks, allowing the application to register its own ECC sign/verify and RSA sign/verify and encrypt/decrypt callbacks.
2447
+
2446
2448
### `--enable-sniffer`
2447
2449
2448
2450
Enable wolfSSL sniffer support.
@@ -2465,14 +2467,12 @@ Stream ciphers:
2465
2467
2466
2468
Enable AES-GCM support.
2467
2469
2468
-
Eabling this option will turn on Public Key callbacks, allowing the application to register its own ECC sign/verify and RSA sign/verify and encrypt/decrypt callbacks.
2470
+
Enabling AES-GCM will add these cipher suites to wolfSSL. wolfSSL offers four different implementations of AES-GCM balancing speed versus memory consumption. If available, wolfSSL will use 64-bit or 32-bit math. For embedded applications, there is a speedy 8-bit version that uses RAM-based lookup tables (8KB per session) which is speed comparable to the 64-bit version and a slower 8-bit version that doesn't take up any additional RAM. The --enable-aesgcm configure option may be modified with the options `=word32`, `=table`, or `=small`, i.e. `--enable-aesgcm=table`.
2469
2471
2470
2472
### `--enable-aesccm`
2471
2473
2472
2474
Enable AES-CCM support
2473
2475
2474
-
Enabling AES-GCM will add these cipher suites to wolfSSL. wolfSSL offers four different implementations of AES-GCM balancing speed versus memory consumption. If available, wolfSSL will use 64-bit or 32-bit math. For embedded applications, there is a speedy 8-bit version that uses RAM-based lookup tables (8KB per session) which is speed comparable to the 64-bit version and a slower 8-bit version that doesn't take up any additional RAM. The --enable-aesgcm configure option may be modified with the options `=word32`, `=table`, or `=small`, i.e. `--enable-aesgcm=table`.
2475
-
2476
2476
### `--disable-aescbc`
2477
2477
2478
2478
Used to with [`--disable-aescbc`](#--disable-aescbc) to compile out AES-CBC
Copy file name to clipboardExpand all lines: wolfSSL/src/chapter03.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -496,7 +496,7 @@ This section will explain the basic steps needed to add wolfSSL to a client appl
496
496
497
497
```c
498
498
/*after connecting to socket fd*/
499
-
WOLF SSL* ssl;
499
+
WOLFSSL* ssl;
500
500
if ((ssl = wolfSSL_new(ctx)) == NULL) {
501
501
fprintf(stderr, "wolfSSL_new error.\n");
502
502
exit(EXIT_FAILURE);
@@ -558,7 +558,7 @@ calling:
558
558
559
559
This section will explain the basic steps needed to add wolfSSL to a server application using the wolfSSL native API. For a client explanation, please see [Changing a Client Application to Use wolfSSL](#changing-a-client-application-to-use-wolfssl). A more complete walk-through, with example code, is located in the [SSL Tutorial](chapter11.md#ssl-tutorial) chapter.
560
560
561
-
1. Follow the instructions above for a client, except change the client method call in step 5 to a server one, so:
561
+
1. Follow the instructions above for a client, except change the client method call in step 2 to a server one, so:
Copy file name to clipboardExpand all lines: wolfSSL/src/chapter06.md
+19-1Lines changed: 19 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,7 @@ Additionally, each callback type requires its specific feature to be enabled (e.
120
120
wolfSSL provides DH (Diffie-Hellman) callbacks for users who wish to have more control over DH key generation and key agreement operations during the SSL/TLS connection.
The user needs to write and register these functions per wolfSSL context (`WOLFSSL_CTX`) with:
142
+
141
143
* `wolfSSL_CTX_SetDhGenerateKeyPair()`
142
144
* `wolfSSL_CTX_SetDhAgreeCb()`
143
145
@@ -152,6 +154,7 @@ To use DH callbacks, wolfSSL needs to be compiled with `HAVE_DH` defined.
152
154
wolfSSL provides Ed25519 callbacks for users who wish to have more control over Ed25519 sign/verify operations during the SSL/TLS connection.
153
155
154
156
The user can optionally define 2 functions:
157
+
155
158
1. Ed25519 sign callback
156
159
2. Ed25519 verify callback
157
160
@@ -172,10 +175,12 @@ typedef int (*CallbackEd25519Verify)(WOLFSSL* ssl,
172
175
```
173
176
174
177
The user needs to write and register these functions per wolfSSL context (`WOLFSSL_CTX`) with:
178
+
175
179
*`wolfSSL_CTX_SetEd25519SignCb()`
176
180
*`wolfSSL_CTX_SetEd25519VerifyCb()`
177
181
178
182
The user can set a context per WOLFSSL object (session) with:
183
+
179
184
*`wolfSSL_SetEd25519SignCtx()`
180
185
*`wolfSSL_SetEd25519VerifyCtx()`
181
186
@@ -188,6 +193,7 @@ To use Ed25519 callbacks, wolfSSL needs to be compiled with `HAVE_PK_CALLBACKS`
188
193
wolfSSL provides X25519 callbacks for users who wish to have more control over X25519 key generation and shared secret computation during the SSL/TLS connection.
189
194
190
195
The user can optionally define 2 functions:
196
+
191
197
1. X25519 key generation callback
192
198
2. X25519 shared secret callback
193
199
@@ -205,10 +211,12 @@ typedef int (*CallbackX25519SharedSecret)(WOLFSSL* ssl,
205
211
```
206
212
207
213
The user needs to write and register these functions per wolfSSL context (`WOLFSSL_CTX`) with:
214
+
208
215
* `wolfSSL_CTX_SetX25519KeyGenCb()`
209
216
* `wolfSSL_CTX_SetX25519SharedSecretCb()`
210
217
211
218
The user can set a context per WOLFSSL object (session) with:
219
+
212
220
* `wolfSSL_SetX25519KeyGenCtx()`
213
221
* `wolfSSL_SetX25519SharedSecretCtx()`
214
222
@@ -221,6 +229,7 @@ To use X25519 callbacks, wolfSSL needs to be compiled with `HAVE_PK_CALLBACKS` a
221
229
wolfSSL provides Ed448 callbacks for users who wish to have more control over Ed448 sign/verify operations during the SSL/TLS connection.
222
230
223
231
The user can optionally define 2 functions:
232
+
224
233
1. Ed448 sign callback
225
234
2. Ed448 verify callback
226
235
@@ -241,10 +250,12 @@ typedef int (*CallbackEd448Verify)(WOLFSSL* ssl,
241
250
```
242
251
243
252
The user needs to write and register these functions per wolfSSL context (`WOLFSSL_CTX`) with:
253
+
244
254
*`wolfSSL_CTX_SetEd448SignCb()`
245
255
*`wolfSSL_CTX_SetEd448VerifyCb()`
246
256
247
257
The user can set a context per WOLFSSL object (session) with:
258
+
248
259
*`wolfSSL_SetEd448SignCtx()`
249
260
*`wolfSSL_SetEd448VerifyCtx()`
250
261
@@ -257,6 +268,7 @@ To use Ed448 callbacks, wolfSSL needs to be compiled with `HAVE_PK_CALLBACKS` an
257
268
wolfSSL provides X448 callbacks for users who wish to have more control over X448 key generation and shared secret operations during the SSL/TLS connection.
258
269
259
270
The user can optionally define 2 functions:
271
+
260
272
1. X448 key generation callback
261
273
2. X448 shared secret callback
262
274
@@ -274,10 +286,12 @@ typedef int (*CallbackX448SharedSecret)(WOLFSSL* ssl,
274
286
```
275
287
276
288
The user needs to write and register these functions per wolfSSL context (`WOLFSSL_CTX`) with:
289
+
277
290
* `wolfSSL_CTX_SetX448KeyGenCb()`
278
291
* `wolfSSL_CTX_SetX448SharedSecretCb()`
279
292
280
293
The user can set a context per WOLFSSL object (session) with:
294
+
281
295
* `wolfSSL_SetX448KeyGenCtx()`
282
296
* `wolfSSL_SetX448SharedSecretCtx()`
283
297
@@ -290,6 +304,7 @@ To use X448 callbacks, wolfSSL needs to be compiled with `HAVE_PK_CALLBACKS` and
290
304
wolfSSL provides RSA PSS callbacks for users who wish to have more control over RSA PSS sign/verify operations during the SSL/TLS connection.
291
305
292
306
The user can optionally define 4 functions:
307
+
293
308
1. RSA PSS sign callback
294
309
2. RSA PSS verify callback
295
310
3. RSA PSS sign check callback
@@ -320,12 +335,14 @@ typedef int (*CallbackRsaPssSignCheck)(WOLFSSL* ssl,
320
335
```
321
336
322
337
The user needs to write and register these functions per wolfSSL context (`WOLFSSL_CTX`) with:
338
+
323
339
*`wolfSSL_CTX_SetRsaPssSignCb()`
324
340
*`wolfSSL_CTX_SetRsaPssVerifyCb()`
325
341
*`wolfSSL_CTX_SetRsaSignCheckCb()`
326
342
*`wolfSSL_CTX_SetRsaPssSignCheckCb()`
327
343
328
344
The user can set a context per WOLFSSL object (session) with:
345
+
329
346
*`wolfSSL_SetRsaPssSignCtx()`
330
347
*`wolfSSL_SetRsaPssVerifyCtx()`
331
348
*`wolfSSL_SetRsaSignCheckCtx()`
@@ -432,7 +449,7 @@ The high level steps use crypto callbacks are:
432
449
433
450
434
451
#### 1. Compile wolfSSL with crypto callback support
435
-
Support for crypto callbacks is enabled in wolfSSL via the `–enable-cryptocb` configure option, or `#define WOLF_CRYPTO_CB`.
452
+
Support for crypto callbacks is enabled in wolfSSL via the `–-enable-cryptocb` configure option, or `#define WOLF_CRYPTO_CB`.
436
453
437
454
#### 2. Register your callback and unique devID with wolfCrypt
438
455
@@ -467,6 +484,7 @@ wc_InitCmac_ex
467
484
This will cause wolfCrypt to invoke the crypto callback in place of the default implementation. This is not an exhaustive API list. Please refer to the wolfCrypt API documentation to see if a particular algorithm supports crypto callbacks.
468
485
469
486
#### 4. (TLS only): associate the devId with a wolfSSL context
487
+
470
488
To enable use of a crypto callback when using TLS, you must supply the `devId` arguments on initialization of a `WOLFSSL_CTX` or `WOLFSSL` struct.
Copy file name to clipboardExpand all lines: wolfSSL/src/chapter07.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -174,7 +174,7 @@ int wolfSSL_CTX_trust_peer_cert(WOLFSSL_CTX *ctx,
174
174
175
175
## Certificate Chain Verification
176
176
177
-
wolfSSL requires that only the top or “root” certificate in a chain to be loaded as a trusted certificate in order to verify a certificate chain. This means that if you have a certificate chain (A -\> B -\> C), where C is signed by B, and B is signed by A, wolfSSL only requires that certificate A be loaded as a trusted certificate in order to verify the entire chain (A-\>B-\>C).
177
+
wolfSSL requires only the top or “root” certificate in a chain to be loaded as a trusted certificate in order to verify a certificate chain. This means that if you have a certificate chain (A -\> B -\> C), where C is signed by B, and B is signed by A, wolfSSL only requires that certificate A be loaded as a trusted certificate in order to verify the entire chain (A-\>B-\>C).
178
178
179
179
For example, if a server certificate chain looks like:
180
180
@@ -192,7 +192,7 @@ Checking the domain name of the certificate is an important step that verifies t
192
192
193
193
## No File System and using Certificates
194
194
195
-
Normally a file system is used to load private keys, certificates, and CAs. Since wolfSSL is sometimes used in environments without a full file system an extension to use memory buffers instead is provided. To use the extension define the constant `NO_FILESYSTEM` and the following functions will be made available:
195
+
Normally a file system is used to load private keys, certificates, and CAs. Since wolfSSL is sometimes used in environments without a full file system, an extension to use memory buffers instead is provided. To use the extension define the constant `NO_FILESYSTEM` and the following functions will be made available:
* [`int wolfSSL_CTX_use_certificate_buffer(WOLFSSL_CTX* ctx, const unsigned char* in, long sz, int format);`](group__CertsKeys.md#function-wolfssl_ctx_use_certificate_buffer)
@@ -204,7 +204,7 @@ Use these functions exactly like their counterparts that are named `*_file` inst
204
204
205
205
### Test Certificate and Key Buffers
206
206
207
-
wolfSSL has come bundled with test certificate and key files in the past. Now it also comes bundled with test certificate and key buffers for use in environments with no filesystem available. These buffers are available in `certs_test.h` when defining one or more of `USE_CERT_BUFFERS_1024`, `USE_CERT_BUFFERS_2048`, or `USE_CERT_BUFFERS_256`.
207
+
wolfSSL comes bundled with test certificate and key files. Additionally, it also comes bundled with test certificate and key buffers for use in environments with no filesystem available. These buffers are available in `certs_test.h` when defining one or more of `USE_CERT_BUFFERS_1024`, `USE_CERT_BUFFERS_2048`, or `USE_CERT_BUFFERS_256`.
208
208
209
209
## Serial Number Retrieval
210
210
@@ -225,7 +225,7 @@ wolfSSL supports RSA key generation of varying lengths up to 4096 bits. Key gene
225
225
intMakeRsaKey(RsaKey* key, int size, long e, RNG* rng);
226
226
```
227
227
228
-
Where `size` is the length in bits and `e` is the public exponent, using 65537 is usually a good choice for `e`. The following from `wolfcrypt/test/test.c` gives an example creating an RSA key of 1024 bits:
228
+
Where `size` is the length in bits and `e` is the public exponent (using 65537 is usually a good choice for `e`). The following from `wolfcrypt/test/test.c` gives an example creating an RSA key of 1024 bits:
Copy file name to clipboardExpand all lines: wolfSSL/src/chapter09.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ wolfSSL (formerly CyaSSL) is thread safe by design. Multiple threads can enter t
52
52
53
53
## Input and Output Buffers
54
54
55
-
wolfSSL now uses dynamic buffers for input and output. They default to 0 bytes and are controlled by the `RECORD_SIZE` define in `wolfssl/internal.h`. If an input record is received that is greater in size than the static buffer, then a dynamic buffer is temporarily used to handle the request and then freed. You can set the static buffer size up to the `MAX_RECORD_SIZE` which is 2^16 or 16,384.
55
+
wolfSSL now uses dynamic buffers for input and output. They default to 0 bytes and are controlled by the `RECORD_SIZE` define in `wolfssl/internal.h`. If an input record is received that is greater in size than the static buffer, then a dynamic buffer is temporarily used to handle the request and then freed. You can set the static buffer size up to the `MAX_RECORD_SIZE` which is 2^14 or 16,384.
56
56
57
57
If you prefer the previous way that wolfSSL operated, with 16Kb static buffers that will never need dynamic memory, you can still get that option by defining `LARGE_STATIC_BUFFERS`.
Copy file name to clipboardExpand all lines: wolfSSL/src/chapter10.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -263,7 +263,7 @@ For usage examples please see the camellia_test() function in `<wolfssl_root>/wo
263
263
264
264
**NOTE**: ARC4 is outdated and considered insecure. Please consider using a different stream cipher.
265
265
266
-
The most common stream cipher used on the Internet is ARC4. wolfCrypt supports it through the header `wolfssl/wolfcrypt/arc4.h`. Usage is simpler than block ciphers because there is no block size and the key length can be any length. The following is a typical usage of ARC4.
266
+
wolfCrypt supports ARC4 through the header `wolfssl/wolfcrypt/arc4.h`. Usage is simpler than block ciphers because there is no block size and the key length can be any length. The following is a typical usage of ARC4.
We need to load our CA (Certificate Authority) certificate into the `WOLFSSL_CTX` so that the when the echoclient connects to the echoserver, it is able to verify the server’s identity. To load the CA certificates into the `WOLFSSL_CTX`, use [`wolfSSL_CTX_load_verify_locations()`](group__CertsKeys.md#function-wolfssl_ctx_load_verify_locations). This function requires three arguments: a `WOLFSSL_CTX` pointer, a certificate file, and a path value. The path value points to a directory which should contain CA certificates in PEM format. When looking up certificates, wolfSSL will look at the certificate file value before looking in the path location. In this case, we don’t need to specify a certificate path because we will specify one CA file - as such we use the value 0 for the path argument. The [`wolfSSL_CTX_load_verify_locations`](group__CertsKeys.md#function-wolfssl_ctx_load_verify_locations) function returns either `SSL_SUCCESS` or `SSL_FAILURE`:
259
+
We need to load our CA (Certificate Authority) certificate into the `WOLFSSL_CTX` so that the when the echoclient connects to the echoserver, it is able to verify the server’s identity. To load the CA certificates into the `WOLFSSL_CTX`, use [`wolfSSL_CTX_load_verify_locations()`](group__CertsKeys.md#function-wolfssl_ctx_load_verify_locations). This function requires three arguments: a `WOLFSSL_CTX` pointer, a certificate file, and a path value. The path value points to a directory which should contain CA certificates in PEM format. When looking up certificates, wolfSSL will look at the certificate file value before looking in the path location. In this case, we don’t need to specify a certificate path because we will specify one CA file - as such we use NULL for the path argument. The [`wolfSSL_CTX_load_verify_locations`](group__CertsKeys.md#function-wolfssl_ctx_load_verify_locations) function returns either `SSL_SUCCESS` or `SSL_FAILURE`:
A WOLFSSL object needs to be created after each TCP Connect and the socket file descriptor needs to be associated with the session. In the echoclient example, we will do this after the call to `Connect()`, shown below:
344
+
A WOLFSSL object needs to be created after each TCP connect and the socket file descriptor needs to be associated with the session. In the echoclient example, we will do this after the call to `connect()`, shown below:
Directly after connecting, create a new `WOLFSSL` object using the [`wolfSSL_new()`](group__Setup.md#function-wolfssl_new) function. This function returns a pointer to the `WOLFSSL` object if successful or `NULL` in the case of failure. We can then associate the socket file descriptor (`sockfd`) with the new `WOLFSSL` object (`ssl`):
@@ -497,7 +497,7 @@ while(cleanup != 1)
497
497
}
498
498
```
499
499
500
-
For the echoserver we need to disable the operating system from restarting calls which were being executed before the signal was handled after our handler has finished. By disabling these, the operating system will not restart calls to `accept()` after the signal has been handled. If we didn’t do this, we would have to wait for another client to connect and disconnect before the echoserver would clean up resources and exit. To define the signal handler and turn off `SA_RESTART`, first define act and oact structures in the echoserver’s `main()` function:
500
+
For the echoserver we need to disable the operating system from restarting calls which were being executed before the signal was handled after our handler has finished. By disabling these, the operating system will not restart calls to `accept()` after the signal has been handled. If we didn’t do this, we would have to wait for another client to connect and disconnect before the echoserver would clean up resources and exit. To define the signal handler and turn off `SA_RESTART`, first define `act` and `oact` structures in the echoserver’s `main()` function:
0 commit comments