summaryrefslogtreecommitdiffstats
path: root/demos
AgeCommit message (Collapse)Author
2023-11-21augment quic demos to support ipv4/6 connectionsNeil Horman
Because the quicserver utility supports expressly listening in ipv4/6 mode, its possible/likely that the server will listen on an ipv4 address, while the clients will connect via ipv6, leading to connection failures. Augment quic demo clients to afford them the same -6 option that the server has so that connection family can be co-ordinated Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22577) (cherry picked from commit 5091aadc223315ce115ee12f62df2af173bf5efb)
2023-11-14cms demos: print signingTime attributesJames Muir
Add a makefile for the cms demos, and add a routine to cms_ver.c to print any signingTime attributes from the CMS_ContentInfo object. This provides an example that could be extended if an application wants to examine the purported signing times. Part of #8026 Testing: $ cd demos/cms $ make test Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22618) (cherry picked from commit 9257a89b6f25dfa5aeee7114baec8ea992fcf5e5)
2023-11-08quic http3 demo: minor updatesJames Muir
-update run command to include LD_LIBRARY_PATH -suggest installing libnghttp3-dev on Ubuntu -drop "-f" from clean recipe (it is already included in $(RM)) Part of https://github.com/openssl/project/issues/253 Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22623) (cherry picked from commit 22fa1602da91af2194997e0576582bb4f0cdd7e0)
2023-11-02Update the README with information about how to run the QUIC demosMatt Caswell
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit cb8107b632661d2ae538961424768f0ed074fcf6)
2023-11-02Update the QUIC demos to accept hostname/port on the command lineMatt Caswell
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit 420037c82c4b2bfea952cbe00730930844969438)
2023-11-02Extend the README to describe how to run the TLS demosMatt Caswell
We also supply some test certificates for use with the demos. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit a2b824730ef12cda4e018f5f7cde2ab52a4d255c)
2023-11-02Amend the TLS demos to accept hostname/port as an argumentMatt Caswell
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22552) (cherry picked from commit 2ec4e73c0188425890329ae7f0372c66fb0c1234)
2023-10-30Add a separate README for the guide demosMatt Caswell
Point users at the actual guide, and also explain about LD_LIBRARY_PATH Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22505) (cherry picked from commit ada33e98f53ab02dc4d6e8259c9e9edb6cd5c90c)
2023-10-30Update to the demos README fileMatt Caswell
Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22505) (cherry picked from commit aefb529422dc029efecd5d9a192b9ffa600fc5db)
2023-10-25quic: documentation and demo nitsJames Muir
The code for the quic demos (from the openssl guide) is presented as modifications of tls-client-block.c. Make it so that the quic code better matches the tls code (drop unneeded assignments to "ret", use the same comment on SSL_connect(), add the same printf() statement). Also fix some minor typos. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22483)
2023-10-25Create hierarchical demo Makefile.slontis
Adds a Makefile with all, clean, and test targets. This has only been added for demos that already contain Makefiles. For problematic tests that require inputs, the test target does nothing. (Note: Demos should be self contained and not require unknown external inputs. This PR does not attempt to fix this.) Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20546)
2023-10-19Fix markdownHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22369)
2023-10-19Add SNIHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22369)
2023-10-19RenameHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22369)
2023-10-19Add link to nghttp3Hugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22369)
2023-10-19Add copyright headersHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22369)
2023-10-19QUIC: Add comments to HTTP/3 demoHugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22369)
2023-10-19QUIC: Add HTTP/3 demo using nghttp3Hugo Landau
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tim Hudson <tjh@openssl.org> (Merged from https://github.com/openssl/openssl/pull/22369)
2023-09-11Bad function definitionDimitri Papadopoulos
void f() should probably be void f(void) Found by running the checkpatch.pl Linux script to enforce coding style. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21468)
2023-09-11"foo * bar" should be "foo *bar"Dimitri Papadopoulos
Found by running the checkpatch.pl Linux script to enforce coding style. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21468)
2023-09-08Return NULL if we fail to create a BIO in the demos/quicserverMatt Caswell
Strictly speaking the previous code was still correct since BIO_set_fd is tolerant of a NULL BIO. But this way is more clear. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21950)
2023-09-08Add a missing call to BIO_closesocket()Matt Caswell
A couple of the demos missed a call to this function in an error case. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21950)
2023-09-08Expand the explanation of how to go and do useful work in non-blockingMatt Caswell
Add additional commentary to the non-blocking examples explaining where to add code to go and do other useful work. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21950)
2023-09-08Add a new guide page on writing a non-blocking QUIC clientMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21950)
2023-09-08Add a QUIC non-blocking demoMatt Caswell
Show how to write a QUIC client using a non-blocking socket Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21950)
2023-09-08Add a TLS non-blocking demoMatt Caswell
Show how to write a TLS client using a non-blocking socket Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21950)
2023-09-07Copyright year updatesMatt Caswell
Reviewed-by: Richard Levitte <levitte@openssl.org> Release: yes
2023-09-01Add ED25519 Signature demo.slontis
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21883)
2023-08-28Fix a bad merge in quic-multi-stream.c demoMatt Caswell
The function SSL_set_initial_peer_addr() got renamed to SSL_set1_initial_peer_addr(). The demo missed out on the rename when it got rebased on top of it. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21842)
2023-08-25Update demos/tutorial to distinguish between stream and connection errorsMatt Caswell
We can use SSL_get_stream_read_state() to distinguish these cases. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21765)
2023-08-25Add some additional comments to the demosMatt Caswell
Add some additional explanation for some code lines in the demos that did not have a comment. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21765)
2023-08-25Add a QUIC multi-stream client demoMatt Caswell
Demonstrate how to use the QUIC multi-stream APIs with a simple blocking client. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21765)
2023-08-25Update the desciption of shutdown in the QUIC client blocking tutorialMatt Caswell
Give a better description of the shutdown process in QUIC. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21765)
2023-08-24QUIC: Rename SSL_set_initial_peer_addr to SSL_set1_initial_peer_addrHugo Landau
Fixes #21701 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21814)
2023-07-01Fix new typo found by codespell in demoDimitri Papadopoulos
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21322)
2023-06-28Add a non-blocking QUIC client demoMatt Caswell
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21204)
2023-06-18Fix new typos found by codespellDimitri Papadopoulos
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21210)
2023-06-14Fix minor issues in the demo/man pages for TLS client/blockingMatt Caswell
Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21133)
2023-06-14Add a very simple blocking TLS client demoMatt Caswell
This blocking client is intended to be used to explain how to implement a simple client in the documentation. Reviewed-by: Viktor Dukhovni <viktor@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21133)
2023-04-24Fixup demo exit status magic numbersslontis
The demo code is quite often block copied for new demos, so this PR changes demos to use EXIT_SUCCESS & EXIT_FAILURE instead of using 0 and 1. Internal functions use the normal notation of 0 = error, 1 = success, but the value returned by main() must use EXIT_SUCCESS and EXIT_FAILURE. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20545)
2023-04-06Ignore SIGPIPE if client closes connection abruptlyVishwa Pravin
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20678)
2023-03-21Add Argon2 KDF demo.Milan Broz
Signed-off-by: Milan Broz <gmazyland@gmail.com> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20531)
2023-03-15demo: Fix makefile targetPauli
The makefile target was incorrect and wouldn't build the rsa_encrypt demo. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/20503)
2022-12-22Add Demos for DSA params/DSA keygen.slontis
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19853)
2022-12-07Replace "a RSA" with "an RSA"Daniel Fiala
Fixes openssl#19771 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19787)
2022-11-22Add an EVP signature demo using DSADaniel Fiala
Fixes openssl#14114 Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19492)
2022-11-11demos/mac/cmac-aes256: Clarify the cipher algorithm usedTomas Mraz
The currently used cipher is aes256 which is an alias to AES-256-CBC, so the demo is correct. However it might be misleading so make it clear the CBC mode cipher is used. Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19401)
2022-10-12apps & al : Fix various typos, repeated words, align some spelling to LDP.FdaSilvaYY
Mostly revamped from #16712 - fall thru -> fall through - time stamp -> timestamp - host name -> hostname - ipv6 -> IPv6 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19059)
2022-09-19Add an EVP demo for AES key wrapDaniel Fiala
Fixes openssl#14119 Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19141)
2022-09-09Add an EVP demo for key encoding using ECDaniel Fiala
Fixes openssl#14117 Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19143)