openssl/demos
Quin-Darcy c79e1b212a Fix RSA key size validation in EVP_PKEY_RSA_keygen demo
The validation was checking the default 'bits' value (4096) instead of
the parsed 'bits_i' from the command line arguments, allowing invalid
key sizes to bypass the 512-bit minimum.

CLA: trivial

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/28139)
2025-08-11 16:46:11 +02:00
..
bio demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
certs demos: fix cert scripts 2023-12-29 10:22:05 +01:00
cipher demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
cms demos/cms/cms_denc.c: Add check for BIO_new_file() 2025-07-01 19:35:28 +02:00
digest demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
encode Convert demos to primary build system 2024-04-12 08:02:19 -04:00
encrypt demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
guide Introduce SSL_OP_SERVER_PREFERENCE to replace SSL_OP_CIPHER_SERVER_PREFERENCE misnomer 2025-07-09 12:10:57 +02:00
http3 Copyright year updates 2025-03-12 13:35:59 +00:00
kdf demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
keyexch demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
mac demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
pkcs12 Copyright year updates 2023-09-07 09:59:15 +01:00
pkey Fix RSA key size validation in EVP_PKEY_RSA_keygen demo 2025-08-11 16:46:11 +02:00
quic demos: use array memory (re)allocation routines 2025-08-08 12:22:10 -04:00
signature demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
smime Convert demos to primary build system 2024-04-12 08:02:19 -04:00
sslecho demos: Silence warnings on Win64 builds 2025-07-02 17:26:26 +02:00
Makefile demos: tidy up makefiles, fix warnings 2023-11-15 08:43:23 +01:00
README.txt Augment README.md in top level to indicate Makefile presence 2024-04-12 08:02:20 -04:00
build.info Add build.info for QUIC server demo 2025-02-17 11:27:33 -05:00

README.txt

OpenSSL Demonstration Applications

This folder contains source code that demonstrates the proper use of the OpenSSL
library API.

Note: Makefiles are provided in the demo subfolders to demonstrate how to build
them, but are not frequently used.  Configure openssl with enable-demos to build
them automatically through the perl based build system

bio:                   Demonstration of a simple TLS client and server

certs:                 Demonstration of creating certs, using OCSP

cipher:
aesgcm.c               Demonstration of symmetric cipher GCM mode encrypt/decrypt
aesccm.c               Demonstration of symmetric cipher CCM mode encrypt/decrypt
ariacbc.c              Demonstration of symmetric cipher CBC mode encrypt/decrypt

cms:                   Demonstrations related to the Cryptographic Message
                       Syntax (CMS) standard

digest:
EVP_MD_demo.c          Compute a digest from multiple buffers
EVP_MD_stdin.c         Compute a digest with data read from stdin
EVP_MD_xof.c           Compute a digest using the SHAKE256 XOF
EVP_f_md.c             Compute a digest using BIO and EVP_f_md

encode:
rsa_encode.c           Encode and decode PEM-encoded RSA keys

encrypt:
rsa_encrypt.c          Encrypt and decrypt data using an RSA keypair.

guide:                   Sample code from the OpenSSL Guide tutorials. See
                         the oss-guide-quic-introduction(7) man page.
quic-client-block.c:     A simple blocking QUIC client
quic-client-non-block.c: A simple non-blocking QUIC client
quic-multi-stream.c:     A simple QUIC client using multiple streams
tls-client-block.c:      A simple blocking SSL/TLS client
tls-client-non-block.c:  A simple non-blocking SSL/TLS client

http3:                 Demonstration of how to use OpenSSL's QUIC capabilities
                       for HTTP/3.

kdf:
hkdf.c                 Demonstration of HMAC based key derivation
pbkdf2.c               Demonstration of PBKDF2 password based key derivation
scrypt.c               Demonstration of SCRYPT password based key derivation

keyexch:
x25519.c               Demonstration of X25519 based key exchange
ecdh.c                 Demonstration of ECDH key exchange

mac:
gmac.c                 Demonstration of GMAC message authentication
poly1305.c             Demonstration of Poly1305-AES message authentication
siphash.c              Demonstration of SIPHASH message authentication

pkcs12:
pkread.c               Print out a description of a PKCS12 file.
pkwrite.c              Add a password to an existing PKCS12 file.

pkey:
EVP_PKEY_EC_keygen.c           Generate an EC key.
EVP_PKEY_RSA_keygen.c          Generate an RSA key.
EVP_PKEY_DSA_keygen.c          Generate a DSA key.
EVP_PKEY_DSA_paramgen.c        Generate a DSA param key.
EVP_PKEY_DSA_paramvalidate.c   Validate a DSA param key.
EVP_PKEY_DSA_paramfromdata.c   Load a DSA param key using raw data.

signature:
EVP_EC_Signature_demo.c   Compute and verify an EC signature.
EVP_DSA_Signature_demo.c  Compute and verify a DSA signature.
EVP_ED_Signature_demo.c   Compute and verify an ED25519 signature.
rsa_pss_direct.c          Compute and verify an RSA-PSS signature from a hash
rsa_pss_hash.c            Compute and verify an RSA-PSS signature over a buffer

smime:                 Demonstrations related to S/MIME

sslecho:
main.c                 Simple SSL/TLS echo client/server.