From e9b77246879071308130cda42336338ddb63cbb4 Mon Sep 17 00:00:00 2001 From: Beat Bolli Date: Fri, 20 Jan 2017 19:58:49 +0100 Subject: [PATCH] doc/man3: reformat the function prototypes in the synopses I tried hard to keep the lines at 80 characters or less, but in a few cases I had to punt and just indented the subsequent lines by 4 spaces. A few well-placed typedefs for callback functions would really help, but these would be part of the API, so that's probably for later. I also took the liberty of inserting empty lines in overlong blocks to provide some visual space. Reviewed-by: Rich Salz Reviewed-by: Matt Caswell (Merged from https://github.com/openssl/openssl/pull/1956) --- doc/man3/ASN1_TIME_set.pod | 3 +- doc/man3/ASYNC_WAIT_CTX_new.pod | 2 +- doc/man3/ASYNC_start_job.pod | 1 + doc/man3/BF_encrypt.pod | 12 +- doc/man3/BIO_ctrl.pod | 3 +- doc/man3/BIO_f_cipher.pod | 2 +- doc/man3/BIO_f_md.pod | 4 + doc/man3/BIO_f_null.pod | 2 +- doc/man3/BIO_find_type.pod | 2 +- doc/man3/BIO_get_ex_new_index.pod | 6 +- doc/man3/BIO_meth_new.pod | 58 ++++---- doc/man3/BIO_new.pod | 12 +- doc/man3/BIO_s_bio.pod | 2 +- doc/man3/BIO_s_file.pod | 6 +- doc/man3/BIO_s_mem.pod | 9 +- doc/man3/BIO_s_null.pod | 2 +- doc/man3/BN_BLINDING_new.pod | 18 ++- doc/man3/BN_add.pod | 10 +- doc/man3/BN_generate_prime.pod | 19 +-- doc/man3/BN_mod_inverse.pod | 2 +- doc/man3/BN_mod_mul_montgomery.pod | 6 +- doc/man3/BN_mod_mul_reciprocal.pod | 4 +- doc/man3/CMS_add0_cert.pod | 1 - doc/man3/CMS_add1_recipient_cert.pod | 12 +- doc/man3/CMS_add1_signer.pod | 5 +- doc/man3/CMS_decrypt.pod | 3 +- doc/man3/CMS_encrypt.pod | 3 +- doc/man3/CMS_get0_RecipientInfos.pod | 17 ++- doc/man3/CMS_get0_SignerInfos.pod | 3 +- doc/man3/CMS_get1_ReceiptRequest.pod | 10 +- doc/man3/CMS_sign.pod | 3 +- doc/man3/CMS_sign_receipt.pod | 4 +- doc/man3/CMS_verify.pod | 3 +- doc/man3/CMS_verify_receipt.pod | 4 +- doc/man3/CONF_modules_load_file.pod | 5 +- doc/man3/CRYPTO_get_ex_new_index.pod | 8 +- doc/man3/CT_POLICY_EVAL_CTX_new.pod | 3 +- doc/man3/DEFINE_STACK_OF.pod | 3 +- doc/man3/DES_random_key.pod | 93 ++++++------ doc/man3/DH_generate_parameters.pod | 2 +- doc/man3/DH_meth_new.pod | 33 +++-- doc/man3/DSA_do_sign.pod | 2 +- doc/man3/DSA_dup_DH.pod | 2 +- doc/man3/DSA_generate_parameters.pod | 11 +- doc/man3/DSA_meth_new.pod | 88 +++++++----- doc/man3/DSA_sign.pod | 9 +- doc/man3/ECDSA_SIG_new.pod | 2 + doc/man3/EC_GROUP_copy.pod | 5 +- doc/man3/EC_GROUP_new.pod | 18 ++- doc/man3/EC_KEY_new.pod | 6 +- doc/man3/EC_POINT_add.pod | 12 +- doc/man3/ENGINE_add.pod | 10 +- doc/man3/ERR_get_error.pod | 6 +- doc/man3/ERR_print_errors.pod | 3 +- doc/man3/ERR_put_error.pod | 3 +- doc/man3/EVP_CIPHER_meth_new.pod | 32 ++--- doc/man3/EVP_DigestInit.pod | 6 +- doc/man3/EVP_DigestVerifyInit.pod | 2 +- doc/man3/EVP_EncodeInit.pod | 3 +- doc/man3/EVP_EncryptInit.pod | 36 ++--- doc/man3/EVP_OpenInit.pod | 7 +- doc/man3/EVP_PKEY_CTX_ctrl.pod | 4 +- doc/man3/EVP_PKEY_CTX_set_tls1_prf_md.pod | 1 + doc/man3/EVP_PKEY_decrypt.pod | 5 +- doc/man3/EVP_PKEY_encrypt.pod | 5 +- doc/man3/EVP_PKEY_keygen.pod | 3 + doc/man3/EVP_PKEY_print_private.pod | 6 +- doc/man3/EVP_PKEY_sign.pod | 4 +- doc/man3/EVP_PKEY_verify.pod | 5 +- doc/man3/EVP_PKEY_verify_recover.pod | 5 +- doc/man3/EVP_SealInit.pod | 5 +- doc/man3/EVP_VerifyInit.pod | 3 +- doc/man3/HMAC.pod | 6 +- doc/man3/MD5.pod | 18 +-- doc/man3/MDC2_Init.pod | 4 +- doc/man3/OBJ_nid2obj.pod | 11 +- doc/man3/OPENSSL_malloc.pod | 3 +- doc/man3/PEM_read_bio_PrivateKey.pod | 3 + doc/man3/PKCS12_newpass.pod | 1 + doc/man3/PKCS5_PBKDF2_HMAC.pod | 6 +- doc/man3/PKCS7_encrypt.pod | 3 +- doc/man3/PKCS7_sign.pod | 4 +- doc/man3/PKCS7_sign_add_signer.pod | 3 +- doc/man3/PKCS7_verify.pod | 3 +- doc/man3/RIPEMD160_Init.pod | 5 +- doc/man3/RSA_generate_key.pod | 2 +- doc/man3/RSA_meth_new.pod | 133 +++++++++--------- doc/man3/RSA_new.pod | 2 +- doc/man3/RSA_padding_add_PKCS1_type_1.pod | 21 +-- doc/man3/RSA_private_encrypt.pod | 8 +- doc/man3/RSA_public_encrypt.pod | 8 +- doc/man3/RSA_sign.pod | 4 +- doc/man3/RSA_sign_ASN1_OCTET_STRING.pod | 8 +- doc/man3/SHA256_Init.pod | 10 +- doc/man3/SSL_CTX_sess_set_get_cb.pod | 24 ++-- doc/man3/SSL_CTX_set_cert_cb.pod | 3 +- doc/man3/SSL_CTX_set_cert_verify_callback.pod | 4 +- doc/man3/SSL_CTX_set_client_cert_cb.pod | 7 +- doc/man3/SSL_CTX_set_generate_session_id.pod | 1 + doc/man3/SSL_CTX_set_min_proto_version.pod | 1 + doc/man3/SSL_CTX_set_msg_callback.pod | 10 +- doc/man3/SSL_CTX_set_psk_client_callback.pod | 12 +- doc/man3/SSL_CTX_set_security_level.pod | 23 +-- doc/man3/SSL_CTX_set_tlsext_status_cb.pod | 6 +- doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod | 6 +- doc/man3/SSL_CTX_set_tmp_dh_callback.pod | 11 +- doc/man3/SSL_CTX_use_psk_identity_hint.pod | 12 +- doc/man3/SSL_get_client_random.pod | 3 +- doc/man3/SSL_get_psk_identity.pod | 1 - doc/man3/UI_new.pod | 18 +-- doc/man3/X509_LOOKUP_hash_dir.pod | 12 +- doc/man3/X509_NAME_ENTRY_get_object.pod | 21 ++- doc/man3/X509_NAME_add_entry_by_txt.pod | 10 +- doc/man3/X509_NAME_print_ex.pod | 2 +- doc/man3/X509_STORE_CTX_set_verify_cb.pod | 1 + doc/man3/X509_VERIFY_PARAM_set_flags.pod | 9 +- doc/man3/X509_check_ca.pod | 4 +- doc/man3/X509_digest.pod | 2 +- doc/man3/X509_get_extension_flags.pod | 20 +-- doc/man3/X509v3_get_ext_by_NID.pod | 2 +- doc/man3/d2i_PKCS8PrivateKey_bio.pod | 16 +-- doc/man3/d2i_SSL_SESSION.pod | 3 +- doc/man3/o2i_SCT_LIST.pod | 3 +- 123 files changed, 681 insertions(+), 541 deletions(-) diff --git a/doc/man3/ASN1_TIME_set.pod b/doc/man3/ASN1_TIME_set.pod index b6acd730b7..e1a5234727 100644 --- a/doc/man3/ASN1_TIME_set.pod +++ b/doc/man3/ASN1_TIME_set.pod @@ -85,9 +85,11 @@ Set a time structure to one hour after the current time and print it out: #include #include + ASN1_TIME *tm; time_t t; BIO *b; + t = time(NULL); tm = ASN1_TIME_adj(NULL, t, 0, 60 * 60); b = BIO_new_fp(stdout, BIO_NOCLOSE); @@ -101,7 +103,6 @@ Determine if one time is later or sooner than the current time: if (!ASN1_TIME_diff(&day, &sec, NULL, to)) /* Invalid time format */ - if (day > 0 || sec > 0) printf("Later\n"); else if (day < 0 || sec < 0) diff --git a/doc/man3/ASYNC_WAIT_CTX_new.pod b/doc/man3/ASYNC_WAIT_CTX_new.pod index 017e328b5e..204280210e 100644 --- a/doc/man3/ASYNC_WAIT_CTX_new.pod +++ b/doc/man3/ASYNC_WAIT_CTX_new.pod @@ -17,7 +17,7 @@ waiting for asynchronous jobs to complete OSSL_ASYNC_FD fd, void *custom_data, void (*cleanup)(ASYNC_WAIT_CTX *, const void *, - OSSL_ASYNC_FD, void *)); + OSSL_ASYNC_FD, void *)); int ASYNC_WAIT_CTX_get_fd(ASYNC_WAIT_CTX *ctx, const void *key, OSSL_ASYNC_FD *fd, void **custom_data); int ASYNC_WAIT_CTX_get_all_fds(ASYNC_WAIT_CTX *ctx, OSSL_ASYNC_FD *fd, diff --git a/doc/man3/ASYNC_start_job.pod b/doc/man3/ASYNC_start_job.pod index e6ccf55c4d..21b77a96b9 100644 --- a/doc/man3/ASYNC_start_job.pod +++ b/doc/man3/ASYNC_start_job.pod @@ -187,6 +187,7 @@ The following example demonstrates how to use most of the core async APIs: void cleanup(ASYNC_WAIT_CTX *ctx, const void *key, OSSL_ASYNC_FD r, void *vw) { OSSL_ASYNC_FD *w = (OSSL_ASYNC_FD *)vw; + close(r); close(*w); OPENSSL_free(w); diff --git a/doc/man3/BF_encrypt.pod b/doc/man3/BF_encrypt.pod index 0401e90a20..b20f634da6 100644 --- a/doc/man3/BF_encrypt.pod +++ b/doc/man3/BF_encrypt.pod @@ -12,14 +12,16 @@ BF_cfb64_encrypt, BF_ofb64_encrypt, BF_options - Blowfish encryption void BF_set_key(BF_KEY *key, int len, const unsigned char *data); void BF_ecb_encrypt(const unsigned char *in, unsigned char *out, - BF_KEY *key, int enc); + BF_KEY *key, int enc); void BF_cbc_encrypt(const unsigned char *in, unsigned char *out, - long length, BF_KEY *schedule, unsigned char *ivec, int enc); + long length, BF_KEY *schedule, + unsigned char *ivec, int enc); void BF_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, BF_KEY *schedule, unsigned char *ivec, int *num, - int enc); + long length, BF_KEY *schedule, + unsigned char *ivec, int *num, int enc); void BF_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, BF_KEY *schedule, unsigned char *ivec, int *num); + long length, BF_KEY *schedule, + unsigned char *ivec, int *num); const char *BF_options(void); void BF_encrypt(BF_LONG *data, const BF_KEY *key); diff --git a/doc/man3/BIO_ctrl.pod b/doc/man3/BIO_ctrl.pod index a098946d53..4e0229485e 100644 --- a/doc/man3/BIO_ctrl.pod +++ b/doc/man3/BIO_ctrl.pod @@ -12,7 +12,8 @@ BIO_get_info_callback, BIO_set_info_callback, bio_info_cb #include - typedef void (*bio_info_cb)(BIO *b, int oper, const char *ptr, int arg1, long arg2, long arg3); + typedef void (*bio_info_cb)(BIO *b, int oper, const char *ptr, + int arg1, long arg2, long arg3); long BIO_ctrl(BIO *bp, int cmd, long larg, void *parg); long BIO_callback_ctrl(BIO *b, int cmd, bio_info_cb cb); diff --git a/doc/man3/BIO_f_cipher.pod b/doc/man3/BIO_f_cipher.pod index a24857e861..65c3d0b1f5 100644 --- a/doc/man3/BIO_f_cipher.pod +++ b/doc/man3/BIO_f_cipher.pod @@ -13,7 +13,7 @@ BIO_f_cipher, BIO_set_cipher, BIO_get_cipher_status, BIO_get_cipher_ctx - cipher const BIO_METHOD *BIO_f_cipher(void); void BIO_set_cipher(BIO *b, const EVP_CIPHER *cipher, - unsigned char *key, unsigned char *iv, int enc); + unsigned char *key, unsigned char *iv, int enc); int BIO_get_cipher_status(BIO *b) int BIO_get_cipher_ctx(BIO *b, EVP_CIPHER_CTX **pctx) diff --git a/doc/man3/BIO_f_md.pod b/doc/man3/BIO_f_md.pod index 3c8d4311ae..7074202a56 100644 --- a/doc/man3/BIO_f_md.pod +++ b/doc/man3/BIO_f_md.pod @@ -79,6 +79,7 @@ checking has been omitted for clarity. BIO *bio, *mdtmp; char message[] = "Hello World"; + bio = BIO_new(BIO_s_null()); mdtmp = BIO_new(BIO_f_md()); BIO_set_md(mdtmp, EVP_sha1()); @@ -98,6 +99,7 @@ The next example digests data by reading through a chain instead: BIO *bio, *mdtmp; char buf[1024]; int rdlen; + bio = BIO_new_file(file, "rb"); mdtmp = BIO_new(BIO_f_md()); BIO_set_md(mdtmp, EVP_sha1()); @@ -117,9 +119,11 @@ outputs them. This could be used with the examples above. unsigned char mdbuf[EVP_MAX_MD_SIZE]; int mdlen; int i; + mdtmp = bio; /* Assume bio has previously been set up */ do { EVP_MD *md; + mdtmp = BIO_find_type(mdtmp, BIO_TYPE_MD); if (!mdtmp) break; diff --git a/doc/man3/BIO_f_null.pod b/doc/man3/BIO_f_null.pod index c4e4c667c1..53069b497a 100644 --- a/doc/man3/BIO_f_null.pod +++ b/doc/man3/BIO_f_null.pod @@ -8,7 +8,7 @@ BIO_f_null - null filter #include - const BIO_METHOD * BIO_f_null(void); + const BIO_METHOD *BIO_f_null(void); =head1 DESCRIPTION diff --git a/doc/man3/BIO_find_type.pod b/doc/man3/BIO_find_type.pod index 08ec161349..b8171942ef 100644 --- a/doc/man3/BIO_find_type.pod +++ b/doc/man3/BIO_find_type.pod @@ -45,8 +45,8 @@ BIO_method_type() returns the type of the BIO B. Traverse a chain looking for digest BIOs: BIO *btmp; - btmp = in_bio; /* in_bio is chain to search through */ + btmp = in_bio; /* in_bio is chain to search through */ do { btmp = BIO_find_type(btmp, BIO_TYPE_MD); if (btmp == NULL) diff --git a/doc/man3/BIO_get_ex_new_index.pod b/doc/man3/BIO_get_ex_new_index.pod index 1a99d09241..c4797b1576 100644 --- a/doc/man3/BIO_get_ex_new_index.pod +++ b/doc/man3/BIO_get_ex_new_index.pod @@ -22,9 +22,9 @@ RSA_get_ex_new_index, RSA_set_ex_data, RSA_get_ex_data #include int TYPE_get_ex_new_index(long argl, void *argp, - CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); + CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, + CRYPTO_EX_free *free_func); int TYPE_set_ex_data(TYPE *d, int idx, void *arg); diff --git a/doc/man3/BIO_meth_new.pod b/doc/man3/BIO_meth_new.pod index cd55c78127..53a68a13e5 100644 --- a/doc/man3/BIO_meth_new.pod +++ b/doc/man3/BIO_meth_new.pod @@ -16,41 +16,45 @@ BIO_meth_set_callback_ctrl - Routines to build up BIO methods #include int BIO_get_new_index(void); + BIO_METHOD *BIO_meth_new(int type, const char *name); + void BIO_meth_free(BIO_METHOD *biom); - int (*BIO_meth_get_write_ex(BIO_METHOD *biom)) (BIO *, const char *, size_t, - size_t *); - int (*BIO_meth_get_write(BIO_METHOD *biom)) (BIO *, const char *, int); + + int (*BIO_meth_get_write_ex(BIO_METHOD *biom))(BIO *, const char *, size_t, + size_t *); + int (*BIO_meth_get_write(BIO_METHOD *biom))(BIO *, const char *, int); int BIO_meth_set_write_ex(BIO_METHOD *biom, - int (*bwrite) (BIO *, const char *, size_t, - size_t *)); + int (*bwrite)(BIO *, const char *, size_t, size_t *)); int BIO_meth_set_write(BIO_METHOD *biom, - int (*write) (BIO *, const char *, int)); - int (*BIO_meth_get_read_ex(BIO_METHOD *biom)) (BIO *, char *, size_t, - size_t *); - int (*BIO_meth_get_read(BIO_METHOD *biom)) (BIO *, char *, int); + int (*write)(BIO *, const char *, int)); + + int (*BIO_meth_get_read_ex(BIO_METHOD *biom))(BIO *, char *, size_t, size_t *); + int (*BIO_meth_get_read(BIO_METHOD *biom))(BIO *, char *, int); int BIO_meth_set_read_ex(BIO_METHOD *biom, - int (*bread) (BIO *, char *, size_t, size_t *)); - int BIO_meth_set_read(BIO_METHOD *biom, - int (*read) (BIO *, char *, int)); - int (*BIO_meth_get_puts(BIO_METHOD *biom)) (BIO *, const char *); - int BIO_meth_set_puts(BIO_METHOD *biom, - int (*puts) (BIO *, const char *)); - int (*BIO_meth_get_gets(BIO_METHOD *biom)) (BIO *, char *, int); + int (*bread)(BIO *, char *, size_t, size_t *)); + int BIO_meth_set_read(BIO_METHOD *biom, int (*read)(BIO *, char *, int)); + + int (*BIO_meth_get_puts(BIO_METHOD *biom))(BIO *, const char *); + int BIO_meth_set_puts(BIO_METHOD *biom, int (*puts)(BIO *, const char *)); + + int (*BIO_meth_get_gets(BIO_METHOD *biom))(BIO *, char *, int); int BIO_meth_set_gets(BIO_METHOD *biom, - int (*gets) (BIO *, char *, int)); - long (*BIO_meth_get_ctrl(BIO_METHOD *biom)) (BIO *, int, long, void *); + int (*gets)(BIO *, char *, int)); + + long (*BIO_meth_get_ctrl(BIO_METHOD *biom))(BIO *, int, long, void *); int BIO_meth_set_ctrl(BIO_METHOD *biom, - long (*ctrl) (BIO *, int, long, void *)); - int (*BIO_meth_get_create(BIO_METHOD *bion)) (BIO *); - int BIO_meth_set_create(BIO_METHOD *biom, int (*create) (BIO *)); - int (*BIO_meth_get_destroy(BIO_METHOD *biom)) (BIO *); - int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy) (BIO *)); - long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom)) - (BIO *, int, bio_info_cb *); + long (*ctrl)(BIO *, int, long, void *)); + + int (*BIO_meth_get_create(BIO_METHOD *bion))(BIO *); + int BIO_meth_set_create(BIO_METHOD *biom, int (*create)(BIO *)); + + int (*BIO_meth_get_destroy(BIO_METHOD *biom))(BIO *); + int BIO_meth_set_destroy(BIO_METHOD *biom, int (*destroy)(BIO *)); + + long (*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))(BIO *, int, bio_info_cb *); int BIO_meth_set_callback_ctrl(BIO_METHOD *biom, - long (*callback_ctrl) (BIO *, int, - bio_info_cb *)); + long (*callback_ctrl)(BIO *, int, bio_info_cb *)); =head1 DESCRIPTION diff --git a/doc/man3/BIO_new.pod b/doc/man3/BIO_new.pod index 006cf5925c..55ed50bb95 100644 --- a/doc/man3/BIO_new.pod +++ b/doc/man3/BIO_new.pod @@ -9,12 +9,12 @@ BIO_set - BIO allocation and freeing functions #include - BIO * BIO_new(const BIO_METHOD *type); - int BIO_set(BIO *a, const BIO_METHOD *type); - int BIO_up_ref(BIO *a); - int BIO_free(BIO *a); - void BIO_vfree(BIO *a); - void BIO_free_all(BIO *a); + BIO *BIO_new(const BIO_METHOD *type); + int BIO_set(BIO *a, const BIO_METHOD *type); + int BIO_up_ref(BIO *a); + int BIO_free(BIO *a); + void BIO_vfree(BIO *a); + void BIO_free_all(BIO *a); =head1 DESCRIPTION diff --git a/doc/man3/BIO_s_bio.pod b/doc/man3/BIO_s_bio.pod index 55567bb8b3..c3ed1397a7 100644 --- a/doc/man3/BIO_s_bio.pod +++ b/doc/man3/BIO_s_bio.pod @@ -17,7 +17,6 @@ BIO_ctrl_get_read_request, BIO_ctrl_reset_read_request - BIO pair BIO int BIO_destroy_bio_pair(BIO *b); int BIO_shutdown_wr(BIO *b); - int BIO_set_write_buf_size(BIO *b, long size); size_t BIO_get_write_buf_size(BIO *b, long size); @@ -141,6 +140,7 @@ application. The application can call select() on the socket as required without having to go through the SSL-interface. BIO *internal_bio, *network_bio; + ... BIO_new_bio_pair(&internal_bio, 0, &network_bio, 0); SSL_set_bio(ssl, internal_bio, internal_bio); diff --git a/doc/man3/BIO_s_file.pod b/doc/man3/BIO_s_file.pod index fa3016f950..14ce952065 100644 --- a/doc/man3/BIO_s_file.pod +++ b/doc/man3/BIO_s_file.pod @@ -10,7 +10,7 @@ BIO_rw_filename - FILE bio #include - const BIO_METHOD * BIO_s_file(void); + const BIO_METHOD *BIO_s_file(void); BIO *BIO_new_file(const char *filename, const char *mode); BIO *BIO_new_fp(FILE *stream, int flags); @@ -85,12 +85,14 @@ lingual environment, encode file names in UTF-8. File BIO "hello world": BIO *bio_out; + bio_out = BIO_new_fp(stdout, BIO_NOCLOSE); BIO_printf(bio_out, "Hello World\n"); Alternative technique: BIO *bio_out; + bio_out = BIO_new(BIO_s_file()); if (bio_out == NULL) /* Error */ @@ -101,6 +103,7 @@ Alternative technique: Write to a file: BIO *out; + out = BIO_new_file("filename.txt", "w"); if (!out) /* Error */ @@ -110,6 +113,7 @@ Write to a file: Alternative technique: BIO *out; + out = BIO_new(BIO_s_file()); if (out == NULL) /* Error */ diff --git a/doc/man3/BIO_s_mem.pod b/doc/man3/BIO_s_mem.pod index b272c410a0..0b559e57a5 100644 --- a/doc/man3/BIO_s_mem.pod +++ b/doc/man3/BIO_s_mem.pod @@ -10,8 +10,8 @@ BIO_get_mem_ptr, BIO_new_mem_buf - memory BIO #include - const BIO_METHOD * BIO_s_mem(void); - const BIO_METHOD * BIO_s_secmem(void); + const BIO_METHOD *BIO_s_mem(void); + const BIO_METHOD *BIO_s_secmem(void); BIO_set_mem_eof_return(BIO *b, int v) long BIO_get_mem_data(BIO *b, char **pp) @@ -97,17 +97,18 @@ There should be an option to set the maximum size of a memory BIO. Create a memory BIO and write some data to it: BIO *mem = BIO_new(BIO_s_mem()); + BIO_puts(mem, "Hello World\n"); Create a read only memory BIO: char data[] = "Hello World"; - BIO *mem; - mem = BIO_new_mem_buf(data, -1); + BIO *mem = BIO_new_mem_buf(data, -1); Extract the BUF_MEM structure from a memory BIO and then free up the BIO: BUF_MEM *bptr; + BIO_get_mem_ptr(mem, &bptr); BIO_set_close(mem, BIO_NOCLOSE); /* So BIO_free() leaves BUF_MEM alone */ BIO_free(mem); diff --git a/doc/man3/BIO_s_null.pod b/doc/man3/BIO_s_null.pod index 5a1d84dd2c..dd39423db1 100644 --- a/doc/man3/BIO_s_null.pod +++ b/doc/man3/BIO_s_null.pod @@ -8,7 +8,7 @@ BIO_s_null - null data sink #include - const BIO_METHOD * BIO_s_null(void); + const BIO_METHOD *BIO_s_null(void); =head1 DESCRIPTION diff --git a/doc/man3/BN_BLINDING_new.pod b/doc/man3/BN_BLINDING_new.pod index 4229e754a1..68b3cbaf81 100644 --- a/doc/man3/BN_BLINDING_new.pod +++ b/doc/man3/BN_BLINDING_new.pod @@ -13,15 +13,15 @@ BN_BLINDING_set_flags, BN_BLINDING_create_param - blinding related BIGNUM functi #include BN_BLINDING *BN_BLINDING_new(const BIGNUM *A, const BIGNUM *Ai, - BIGNUM *mod); + BIGNUM *mod); void BN_BLINDING_free(BN_BLINDING *b); int BN_BLINDING_update(BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_convert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_invert(BIGNUM *n, BN_BLINDING *b, BN_CTX *ctx); int BN_BLINDING_convert_ex(BIGNUM *n, BIGNUM *r, BN_BLINDING *b, - BN_CTX *ctx); + BN_CTX *ctx); int BN_BLINDING_invert_ex(BIGNUM *n, const BIGNUM *r, BN_BLINDING *b, - BN_CTX *ctx); + BN_CTX *ctx); int BN_BLINDING_is_current_thread(BN_BLINDING *b); void BN_BLINDING_set_current_thread(BN_BLINDING *b); int BN_BLINDING_lock(BN_BLINDING *b); @@ -29,10 +29,14 @@ BN_BLINDING_set_flags, BN_BLINDING_create_param - blinding related BIGNUM functi unsigned long BN_BLINDING_get_flags(const BN_BLINDING *); void BN_BLINDING_set_flags(BN_BLINDING *, unsigned long); BN_BLINDING *BN_BLINDING_create_param(BN_BLINDING *b, - const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, - int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx), - BN_MONT_CTX *m_ctx); + const BIGNUM *e, BIGNUM *m, BN_CTX *ctx, + int (*bn_mod_exp)(BIGNUM *r, + const BIGNUM *a, + const BIGNUM *p, + const BIGNUM *m, + BN_CTX *ctx, + BN_MONT_CTX *m_ctx), + BN_MONT_CTX *m_ctx); =head1 DESCRIPTION diff --git a/doc/man3/BN_add.pod b/doc/man3/BN_add.pod index db3b0d45b4..98f2970a97 100644 --- a/doc/man3/BN_add.pod +++ b/doc/man3/BN_add.pod @@ -19,27 +19,27 @@ arithmetic operations on BIGNUMs int BN_sqr(BIGNUM *r, BIGNUM *a, BN_CTX *ctx); int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *a, const BIGNUM *d, - BN_CTX *ctx); + BN_CTX *ctx); int BN_mod(BIGNUM *rem, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); int BN_nnmod(BIGNUM *r, const BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); int BN_mod_add(BIGNUM *r, BIGNUM *a, BIGNUM *b, const BIGNUM *m, - BN_CTX *ctx); + BN_CTX *ctx); int BN_mod_sub(BIGNUM *r, BIGNUM *a, BIGNUM *b, const BIGNUM *m, - BN_CTX *ctx); + BN_CTX *ctx); int BN_mod_mul(BIGNUM *r, BIGNUM *a, BIGNUM *b, const BIGNUM *m, - BN_CTX *ctx); + BN_CTX *ctx); int BN_mod_sqr(BIGNUM *r, BIGNUM *a, const BIGNUM *m, BN_CTX *ctx); int BN_exp(BIGNUM *r, BIGNUM *a, BIGNUM *p, BN_CTX *ctx); int BN_mod_exp(BIGNUM *r, BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx); + const BIGNUM *m, BN_CTX *ctx); int BN_gcd(BIGNUM *r, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); diff --git a/doc/man3/BN_generate_prime.pod b/doc/man3/BN_generate_prime.pod index fb492feb77..1c40a131e2 100644 --- a/doc/man3/BN_generate_prime.pod +++ b/doc/man3/BN_generate_prime.pod @@ -12,12 +12,12 @@ for primality #include int BN_generate_prime_ex(BIGNUM *ret, int bits, int safe, const BIGNUM *add, - const BIGNUM *rem, BN_GENCB *cb); + const BIGNUM *rem, BN_GENCB *cb); int BN_is_prime_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, BN_GENCB *cb); int BN_is_prime_fasttest_ex(const BIGNUM *p, int nchecks, BN_CTX *ctx, - int do_trial_division, BN_GENCB *cb); + int do_trial_division, BN_GENCB *cb); int BN_GENCB_call(BN_GENCB *cb, int a, int b); @@ -26,10 +26,10 @@ for primality void BN_GENCB_free(BN_GENCB *cb); void BN_GENCB_set_old(BN_GENCB *gencb, - void (*callback)(int, int, void *), void *cb_arg); + void (*callback)(int, int, void *), void *cb_arg); void BN_GENCB_set(BN_GENCB *gencb, - int (*callback)(int, int, BN_GENCB *), void *cb_arg); + int (*callback)(int, int, BN_GENCB *), void *cb_arg); void *BN_GENCB_get_arg(BN_GENCB *cb); @@ -37,14 +37,15 @@ Deprecated: #if OPENSSL_API_COMPAT < 0x00908000L BIGNUM *BN_generate_prime(BIGNUM *ret, int num, int safe, BIGNUM *add, - BIGNUM *rem, void (*callback)(int, int, void *), void *cb_arg); + BIGNUM *rem, void (*callback)(int, int, void *), + void *cb_arg); - int BN_is_prime(const BIGNUM *a, int checks, void (*callback)(int, int, - void *), BN_CTX *ctx, void *cb_arg); + int BN_is_prime(const BIGNUM *a, int checks, + void (*callback)(int, int, void *), BN_CTX *ctx, void *cb_arg); int BN_is_prime_fasttest(const BIGNUM *a, int checks, - void (*callback)(int, int, void *), BN_CTX *ctx, void *cb_arg, - int do_trial_division); + void (*callback)(int, int, void *), BN_CTX *ctx, + void *cb_arg, int do_trial_division); #endif =head1 DESCRIPTION diff --git a/doc/man3/BN_mod_inverse.pod b/doc/man3/BN_mod_inverse.pod index cb84a14098..5c09aacbe5 100644 --- a/doc/man3/BN_mod_inverse.pod +++ b/doc/man3/BN_mod_inverse.pod @@ -9,7 +9,7 @@ BN_mod_inverse - compute inverse modulo n #include BIGNUM *BN_mod_inverse(BIGNUM *r, BIGNUM *a, const BIGNUM *n, - BN_CTX *ctx); + BN_CTX *ctx); =head1 DESCRIPTION diff --git a/doc/man3/BN_mod_mul_montgomery.pod b/doc/man3/BN_mod_mul_montgomery.pod index 81056c76ac..4dfcb21d9a 100644 --- a/doc/man3/BN_mod_mul_montgomery.pod +++ b/doc/man3/BN_mod_mul_montgomery.pod @@ -17,13 +17,13 @@ BN_from_montgomery, BN_to_montgomery - Montgomery multiplication BN_MONT_CTX *BN_MONT_CTX_copy(BN_MONT_CTX *to, BN_MONT_CTX *from); int BN_mod_mul_montgomery(BIGNUM *r, BIGNUM *a, BIGNUM *b, - BN_MONT_CTX *mont, BN_CTX *ctx); + BN_MONT_CTX *mont, BN_CTX *ctx); int BN_from_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont, - BN_CTX *ctx); + BN_CTX *ctx); int BN_to_montgomery(BIGNUM *r, BIGNUM *a, BN_MONT_CTX *mont, - BN_CTX *ctx); + BN_CTX *ctx); =head1 DESCRIPTION diff --git a/doc/man3/BN_mod_mul_reciprocal.pod b/doc/man3/BN_mod_mul_reciprocal.pod index d480fed2d0..07f93baf60 100644 --- a/doc/man3/BN_mod_mul_reciprocal.pod +++ b/doc/man3/BN_mod_mul_reciprocal.pod @@ -16,10 +16,10 @@ reciprocal int BN_RECP_CTX_set(BN_RECP_CTX *recp, const BIGNUM *m, BN_CTX *ctx); int BN_div_recp(BIGNUM *dv, BIGNUM *rem, BIGNUM *a, BN_RECP_CTX *recp, - BN_CTX *ctx); + BN_CTX *ctx); int BN_mod_mul_reciprocal(BIGNUM *r, BIGNUM *a, BIGNUM *b, - BN_RECP_CTX *recp, BN_CTX *ctx); + BN_RECP_CTX *recp, BN_CTX *ctx); =head1 DESCRIPTION diff --git a/doc/man3/CMS_add0_cert.pod b/doc/man3/CMS_add0_cert.pod index a5be002de4..9fbbe9d860 100644 --- a/doc/man3/CMS_add0_cert.pod +++ b/doc/man3/CMS_add0_cert.pod @@ -17,7 +17,6 @@ CMS_add0_cert, CMS_add1_cert, CMS_get1_certs, CMS_add0_crl, CMS_add1_crl, CMS_ge int CMS_add1_crl(CMS_ContentInfo *cms, X509_CRL *crl); STACK_OF(X509_CRL) *CMS_get1_crls(CMS_ContentInfo *cms); - =head1 DESCRIPTION CMS_add0_cert() and CMS_add1_cert() add certificate B to B. diff --git a/doc/man3/CMS_add1_recipient_cert.pod b/doc/man3/CMS_add1_recipient_cert.pod index 0dae5cf5fa..56399f9289 100644 --- a/doc/man3/CMS_add1_recipient_cert.pod +++ b/doc/man3/CMS_add1_recipient_cert.pod @@ -8,9 +8,15 @@ CMS_add1_recipient_cert, CMS_add0_recipient_key - add recipients to a CMS envelo #include - CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, X509 *recip, unsigned int flags); - - CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, unsigned char *key, size_t keylen, unsigned char *id, size_t idlen, ASN1_GENERALIZEDTIME *date, ASN1_OBJECT *otherTypeId, ASN1_TYPE *otherType); + CMS_RecipientInfo *CMS_add1_recipient_cert(CMS_ContentInfo *cms, + X509 *recip, unsigned int flags); + + CMS_RecipientInfo *CMS_add0_recipient_key(CMS_ContentInfo *cms, int nid, + unsigned char *key, size_t keylen, + unsigned char *id, size_t idlen, + ASN1_GENERALIZEDTIME *date, + ASN1_OBJECT *otherTypeId, + ASN1_TYPE *otherType); =head1 DESCRIPTION diff --git a/doc/man3/CMS_add1_signer.pod b/doc/man3/CMS_add1_signer.pod index f4738e0637..48d0154e41 100644 --- a/doc/man3/CMS_add1_signer.pod +++ b/doc/man3/CMS_add1_signer.pod @@ -8,11 +8,12 @@ CMS_add1_signer, CMS_SignerInfo_sign - add a signer to a CMS_ContentInfo signed #include - CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md, unsigned int flags); + CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms, X509 *signcert, + EVP_PKEY *pkey, const EVP_MD *md, + unsigned int flags); int CMS_SignerInfo_sign(CMS_SignerInfo *si); - =head1 DESCRIPTION CMS_add1_signer() adds a signer with certificate B and private diff --git a/doc/man3/CMS_decrypt.pod b/doc/man3/CMS_decrypt.pod index 1174734022..b9f2c28447 100644 --- a/doc/man3/CMS_decrypt.pod +++ b/doc/man3/CMS_decrypt.pod @@ -8,7 +8,8 @@ CMS_decrypt - decrypt content from a CMS envelopedData structure #include - int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, BIO *dcont, BIO *out, unsigned int flags); + int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pkey, X509 *cert, + BIO *dcont, BIO *out, unsigned int flags); =head1 DESCRIPTION diff --git a/doc/man3/CMS_encrypt.pod b/doc/man3/CMS_encrypt.pod index 0ed42628c3..8d7211056e 100644 --- a/doc/man3/CMS_encrypt.pod +++ b/doc/man3/CMS_encrypt.pod @@ -8,7 +8,8 @@ CMS_encrypt - create a CMS envelopedData structure #include - CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, unsigned int flags); + CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *in, + const EVP_CIPHER *cipher, unsigned int flags); =head1 DESCRIPTION diff --git a/doc/man3/CMS_get0_RecipientInfos.pod b/doc/man3/CMS_get0_RecipientInfos.pod index 80370d6736..ba4a60ad05 100644 --- a/doc/man3/CMS_get0_RecipientInfos.pod +++ b/doc/man3/CMS_get0_RecipientInfos.pod @@ -16,13 +16,22 @@ CMS_RecipientInfo_decrypt, CMS_RecipientInfo_encrypt STACK_OF(CMS_RecipientInfo) *CMS_get0_RecipientInfos(CMS_ContentInfo *cms); int CMS_RecipientInfo_type(CMS_RecipientInfo *ri); - int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno); + int CMS_RecipientInfo_ktri_get0_signer_id(CMS_RecipientInfo *ri, + ASN1_OCTET_STRING **keyid, + X509_NAME **issuer, + ASN1_INTEGER **sno); int CMS_RecipientInfo_ktri_cert_cmp(CMS_RecipientInfo *ri, X509 *cert); int CMS_RecipientInfo_set0_pkey(CMS_RecipientInfo *ri, EVP_PKEY *pkey); - int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, X509_ALGOR **palg, ASN1_OCTET_STRING **pid, ASN1_GENERALIZEDTIME **pdate, ASN1_OBJECT **potherid, ASN1_TYPE **pothertype); - int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, const unsigned char *id, size_t idlen); - int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, unsigned char *key, size_t keylen); + int CMS_RecipientInfo_kekri_get0_id(CMS_RecipientInfo *ri, X509_ALGOR **palg, + ASN1_OCTET_STRING **pid, + ASN1_GENERALIZEDTIME **pdate, + ASN1_OBJECT **potherid, + ASN1_TYPE **pothertype); + int CMS_RecipientInfo_kekri_id_cmp(CMS_RecipientInfo *ri, + const unsigned char *id, size_t idlen); + int CMS_RecipientInfo_set0_key(CMS_RecipientInfo *ri, + unsigned char *key, size_t keylen); int CMS_RecipientInfo_decrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri); diff --git a/doc/man3/CMS_get0_SignerInfos.pod b/doc/man3/CMS_get0_SignerInfos.pod index e5532c96f4..7abe39f411 100644 --- a/doc/man3/CMS_get0_SignerInfos.pod +++ b/doc/man3/CMS_get0_SignerInfos.pod @@ -13,7 +13,8 @@ CMS_SignerInfo_get0_signature, CMS_SignerInfo_cert_cmp STACK_OF(CMS_SignerInfo) *CMS_get0_SignerInfos(CMS_ContentInfo *cms); - int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid, X509_NAME **issuer, ASN1_INTEGER **sno); + int CMS_SignerInfo_get0_signer_id(CMS_SignerInfo *si, ASN1_OCTET_STRING **keyid, + X509_NAME **issuer, ASN1_INTEGER **sno); ASN1_OCTET_STRING *CMS_SignerInfo_get0_signature(CMS_SignerInfo *si); int CMS_SignerInfo_cert_cmp(CMS_SignerInfo *si, X509 *cert); void CMS_SignerInfo_set1_signer_cert(CMS_SignerInfo *si, X509 *signer); diff --git a/doc/man3/CMS_get1_ReceiptRequest.pod b/doc/man3/CMS_get1_ReceiptRequest.pod index 79f5f4232d..4f7f245193 100644 --- a/doc/man3/CMS_get1_ReceiptRequest.pod +++ b/doc/man3/CMS_get1_ReceiptRequest.pod @@ -8,10 +8,16 @@ CMS_ReceiptRequest_create0, CMS_add1_ReceiptRequest, CMS_get1_ReceiptRequest, CM #include - CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, int allorfirst, STACK_OF(GENERAL_NAMES) *receiptList, STACK_OF(GENERAL_NAMES) *receiptsTo); + CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, + int allorfirst, + STACK_OF(GENERAL_NAMES) *receiptList, + STACK_OF(GENERAL_NAMES) *receiptsTo); int CMS_add1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest *rr); int CMS_get1_ReceiptRequest(CMS_SignerInfo *si, CMS_ReceiptRequest **prr); - void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, ASN1_STRING **pcid, int *pallorfirst, STACK_OF(GENERAL_NAMES) **plist, STACK_OF(GENERAL_NAMES) **prto); + void CMS_ReceiptRequest_get0_values(CMS_ReceiptRequest *rr, ASN1_STRING **pcid, + int *pallorfirst, + STACK_OF(GENERAL_NAMES) **plist, + STACK_OF(GENERAL_NAMES) **prto); =head1 DESCRIPTION diff --git a/doc/man3/CMS_sign.pod b/doc/man3/CMS_sign.pod index 396deef772..79446b1298 100644 --- a/doc/man3/CMS_sign.pod +++ b/doc/man3/CMS_sign.pod @@ -8,7 +8,8 @@ CMS_sign - create a CMS SignedData structure #include - CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, unsigned int flags); + CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, unsigned int flags); =head1 DESCRIPTION diff --git a/doc/man3/CMS_sign_receipt.pod b/doc/man3/CMS_sign_receipt.pod index 8ea6df1fbc..d65a2081e2 100644 --- a/doc/man3/CMS_sign_receipt.pod +++ b/doc/man3/CMS_sign_receipt.pod @@ -8,7 +8,9 @@ CMS_sign_receipt - create a CMS signed receipt #include - CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, unsigned int flags); + CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert, + EVP_PKEY *pkey, STACK_OF(X509) *certs, + unsigned int flags); =head1 DESCRIPTION diff --git a/doc/man3/CMS_verify.pod b/doc/man3/CMS_verify.pod index c2ff57bcf2..7187d9840a 100644 --- a/doc/man3/CMS_verify.pod +++ b/doc/man3/CMS_verify.pod @@ -8,7 +8,8 @@ CMS_verify, CMS_get0_signers - verify a CMS SignedData structure #include - int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, unsigned int flags); + int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, X509_STORE *store, + BIO *indata, BIO *out, unsigned int flags); STACK_OF(X509) *CMS_get0_signers(CMS_ContentInfo *cms); diff --git a/doc/man3/CMS_verify_receipt.pod b/doc/man3/CMS_verify_receipt.pod index 193241c620..6773529969 100644 --- a/doc/man3/CMS_verify_receipt.pod +++ b/doc/man3/CMS_verify_receipt.pod @@ -8,7 +8,9 @@ CMS_verify_receipt - verify a CMS signed receipt #include - int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, STACK_OF(X509) *certs, X509_STORE *store, unsigned int flags); + int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, + STACK_OF(X509) *certs, X509_STORE *store, + unsigned int flags); =head1 DESCRIPTION diff --git a/doc/man3/CONF_modules_load_file.pod b/doc/man3/CONF_modules_load_file.pod index a752c2ff82..ecf294a2c6 100644 --- a/doc/man3/CONF_modules_load_file.pod +++ b/doc/man3/CONF_modules_load_file.pod @@ -9,9 +9,9 @@ CONF_modules_load_file, CONF_modules_load - OpenSSL configuration functions #include int CONF_modules_load_file(const char *filename, const char *appname, - unsigned long flags); + unsigned long flags); int CONF_modules_load(const CONF *cnf, const char *appname, - unsigned long flags); + unsigned long flags); =head1 DESCRIPTION @@ -94,6 +94,7 @@ Load and parse configuration file manually, custom error handling: FILE *fp; CONF *cnf = NULL; long eline; + fp = fopen("/somepath/app.cnf", "r"); if (fp == NULL) { fprintf(stderr, "Error opening configuration file\n"); diff --git a/doc/man3/CRYPTO_get_ex_new_index.pod b/doc/man3/CRYPTO_get_ex_new_index.pod index a5bf620972..8251dda94f 100644 --- a/doc/man3/CRYPTO_get_ex_new_index.pod +++ b/doc/man3/CRYPTO_get_ex_new_index.pod @@ -12,10 +12,10 @@ CRYPTO_get_ex_data, CRYPTO_free_ex_data, CRYPTO_new_ex_data #include int CRYPTO_get_ex_new_index(int class_index, - long argl, void *argp, - CRYPTO_EX_new *new_func, - CRYPTO_EX_dup *dup_func, - CRYPTO_EX_free *free_func); + long argl, void *argp, + CRYPTO_EX_new *new_func, + CRYPTO_EX_dup *dup_func, + CRYPTO_EX_free *free_func); typedef void CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp); diff --git a/doc/man3/CT_POLICY_EVAL_CTX_new.pod b/doc/man3/CT_POLICY_EVAL_CTX_new.pod index 4d0cae3bbf..f068fde626 100644 --- a/doc/man3/CT_POLICY_EVAL_CTX_new.pod +++ b/doc/man3/CT_POLICY_EVAL_CTX_new.pod @@ -20,7 +20,8 @@ Encapsulates the data required to evaluate whether SCTs meet a Certificate Trans X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx); int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer); const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx); - void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, CTLOG_STORE *log_store); + void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, + CTLOG_STORE *log_store); uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx); void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms); diff --git a/doc/man3/DEFINE_STACK_OF.pod b/doc/man3/DEFINE_STACK_OF.pod index e6684f8009..82989fad08 100644 --- a/doc/man3/DEFINE_STACK_OF.pod +++ b/doc/man3/DEFINE_STACK_OF.pod @@ -56,7 +56,8 @@ stack container STACK_OF(TYPE) *sk_TYPE_deep_copy(const STACK_OF(TYPE) *sk, sk_TYPE_copyfunc copyfunc, sk_TYPE_freefunc freefunc); - sk_TYPE_compfunc (*sk_TYPE_set_cmp_func(STACK_OF(TYPE) *sk, sk_TYPE_compfunc compare); + sk_TYPE_compfunc (*sk_TYPE_set_cmp_func(STACK_OF(TYPE) *sk, + sk_TYPE_compfunc compare)); =head1 DESCRIPTION diff --git a/doc/man3/DES_random_key.pod b/doc/man3/DES_random_key.pod index 4a7b106354..748ea381d6 100644 --- a/doc/man3/DES_random_key.pod +++ b/doc/man3/DES_random_key.pod @@ -20,75 +20,74 @@ DES_fcrypt, DES_crypt - DES encryption int DES_set_key(const_DES_cblock *key, DES_key_schedule *schedule); int DES_key_sched(const_DES_cblock *key, DES_key_schedule *schedule); - int DES_set_key_checked(const_DES_cblock *key, - DES_key_schedule *schedule); - void DES_set_key_unchecked(const_DES_cblock *key, - DES_key_schedule *schedule); + int DES_set_key_checked(const_DES_cblock *key, DES_key_schedule *schedule); + void DES_set_key_unchecked(const_DES_cblock *key, DES_key_schedule *schedule); void DES_set_odd_parity(DES_cblock *key); int DES_is_weak_key(const_DES_cblock *key); void DES_ecb_encrypt(const_DES_cblock *input, DES_cblock *output, - DES_key_schedule *ks, int enc); + DES_key_schedule *ks, int enc); void DES_ecb2_encrypt(const_DES_cblock *input, DES_cblock *output, - DES_key_schedule *ks1, DES_key_schedule *ks2, int enc); + DES_key_schedule *ks1, DES_key_schedule *ks2, int enc); void DES_ecb3_encrypt(const_DES_cblock *input, DES_cblock *output, - DES_key_schedule *ks1, DES_key_schedule *ks2, - DES_key_schedule *ks3, int enc); + DES_key_schedule *ks1, DES_key_schedule *ks2, + DES_key_schedule *ks3, int enc); void DES_ncbc_encrypt(const unsigned char *input, unsigned char *output, - long length, DES_key_schedule *schedule, DES_cblock *ivec, - int enc); + long length, DES_key_schedule *schedule, DES_cblock *ivec, + int enc); void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, - int numbits, long length, DES_key_schedule *schedule, - DES_cblock *ivec, int enc); + int numbits, long length, DES_key_schedule *schedule, + DES_cblock *ivec, int enc); void DES_ofb_encrypt(const unsigned char *in, unsigned char *out, - int numbits, long length, DES_key_schedule *schedule, - DES_cblock *ivec); + int numbits, long length, DES_key_schedule *schedule, + DES_cblock *ivec); void DES_pcbc_encrypt(const unsigned char *input, unsigned char *output, - long length, DES_key_schedule *schedule, DES_cblock *ivec, - int enc); + long length, DES_key_schedule *schedule, DES_cblock *ivec, + int enc); void DES_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, DES_key_schedule *schedule, DES_cblock *ivec, - int *num, int enc); + long length, DES_key_schedule *schedule, DES_cblock *ivec, + int *num, int enc); void DES_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, DES_key_schedule *schedule, DES_cblock *ivec, - int *num); + long length, DES_key_schedule *schedule, DES_cblock *ivec, + int *num); void DES_xcbc_encrypt(const unsigned char *input, unsigned char *output, - long length, DES_key_schedule *schedule, DES_cblock *ivec, - const_DES_cblock *inw, const_DES_cblock *outw, int enc); - - void DES_ede2_cbc_encrypt(const unsigned char *input, - unsigned char *output, long length, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_cblock *ivec, int enc); - void DES_ede2_cfb64_encrypt(const unsigned char *in, - unsigned char *out, long length, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_cblock *ivec, int *num, int enc); - void DES_ede2_ofb64_encrypt(const unsigned char *in, - unsigned char *out, long length, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_cblock *ivec, int *num); - - void DES_ede3_cbc_encrypt(const unsigned char *input, - unsigned char *output, long length, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3, DES_cblock *ivec, - int enc); + long length, DES_key_schedule *schedule, DES_cblock *ivec, + const_DES_cblock *inw, const_DES_cblock *outw, int enc); + + void DES_ede2_cbc_encrypt(const unsigned char *input, unsigned char *output, + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_cblock *ivec, int enc); + void DES_ede2_cfb64_encrypt(const unsigned char *in, unsigned char *out, + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_cblock *ivec, + int *num, int enc); + void DES_ede2_ofb64_encrypt(const unsigned char *in, unsigned char *out, + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_cblock *ivec, int *num); + + void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output, + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3, + DES_cblock *ivec, int enc); void DES_ede3_cfb64_encrypt(const unsigned char *in, unsigned char *out, - long length, DES_key_schedule *ks1, DES_key_schedule *ks2, - DES_key_schedule *ks3, DES_cblock *ivec, int *num, int enc); + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3, + DES_cblock *ivec, int *num, int enc); void DES_ede3_ofb64_encrypt(const unsigned char *in, unsigned char *out, - long length, DES_key_schedule *ks1, - DES_key_schedule *ks2, DES_key_schedule *ks3, - DES_cblock *ivec, int *num); + long length, DES_key_schedule *ks1, + DES_key_schedule *ks2, DES_key_schedule *ks3, + DES_cblock *ivec, int *num); DES_LONG DES_cbc_cksum(const unsigned char *input, DES_cblock *output, - long length, DES_key_schedule *schedule, - const_DES_cblock *ivec); + long length, DES_key_schedule *schedule, + const_DES_cblock *ivec); DES_LONG DES_quad_cksum(const unsigned char *input, DES_cblock output[], - long length, int out_count, DES_cblock *seed); + long length, int out_count, DES_cblock *seed); void DES_string_to_key(const char *str, DES_cblock *key); - void DES_string_to_2keys(const char *str, DES_cblock *key1, - DES_cblock *key2); + void DES_string_to_2keys(const char *str, DES_cblock *key1, DES_cblock *key2); char *DES_fcrypt(const char *buf, const char *salt, char *ret); char *DES_crypt(const char *buf, const char *salt); diff --git a/doc/man3/DH_generate_parameters.pod b/doc/man3/DH_generate_parameters.pod index ce178af0be..54e98f50c9 100644 --- a/doc/man3/DH_generate_parameters.pod +++ b/doc/man3/DH_generate_parameters.pod @@ -19,7 +19,7 @@ Deprecated: #if OPENSSL_API_COMPAT < 0x00908000L DH *DH_generate_parameters(int prime_len, int generator, - void (*callback)(int, int, void *), void *cb_arg); + void (*callback)(int, int, void *), void *cb_arg); #endif =head1 DESCRIPTION diff --git a/doc/man3/DH_meth_new.pod b/doc/man3/DH_meth_new.pod index bf38c37dd3..02acb54f27 100644 --- a/doc/man3/DH_meth_new.pod +++ b/doc/man3/DH_meth_new.pod @@ -15,35 +15,46 @@ DH_meth_set_generate_params - Routines to build up DH methods #include DH_METHOD *DH_meth_new(const char *name, int flags); + void DH_meth_free(DH_METHOD *dhm); + DH_METHOD *DH_meth_dup(const DH_METHOD *dhm); + const char *DH_meth_get0_name(const DH_METHOD *dhm); int DH_meth_set1_name(DH_METHOD *dhm, const char *name); + int DH_meth_get_flags(DH_METHOD *dhm); int DH_meth_set_flags(DH_METHOD *dhm, int flags); + void *DH_meth_get0_app_data(const DH_METHOD *dhm); int DH_meth_set0_app_data(DH_METHOD *dhm, void *app_data); - int (*DH_meth_get_generate_key(const DH_METHOD *dhm)) (DH *); - int DH_meth_set_generate_key(DH_METHOD *dhm, int (*generate_key) (DH *)); + + int (*DH_meth_get_generate_key(const DH_METHOD *dhm))(DH *); + int DH_meth_set_generate_key(DH_METHOD *dhm, int (*generate_key)(DH *)); + int (*DH_meth_get_compute_key(const DH_METHOD *dhm)) - (unsigned char *key, const BIGNUM *pub_key, DH *dh); + (unsigned char *key, const BIGNUM *pub_key, DH *dh); int DH_meth_set_compute_key(DH_METHOD *dhm, - int (*compute_key) (unsigned char *key, const BIGNUM *pub_key, DH *dh)); + int (*compute_key)(unsigned char *key, const BIGNUM *pub_key, DH *dh)); + int (*DH_meth_get_bn_mod_exp(const DH_METHOD *dhm)) (const DH *dh, BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); int DH_meth_set_bn_mod_exp(DH_METHOD *dhm, - int (*bn_mod_exp) (const DH *dh, BIGNUM *r, const BIGNUM *a, - const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, - BN_MONT_CTX *m_ctx)); + int (*bn_mod_exp)(const DH *dh, BIGNUM *r, const BIGNUM *a, + const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *m_ctx)); + int (*DH_meth_get_init(const DH_METHOD *dhm))(DH *); int DH_meth_set_init(DH_METHOD *dhm, int (*init)(DH *)); - int (*DH_meth_get_finish(const DH_METHOD *dhm)) (DH *); - int DH_meth_set_finish(DH_METHOD *dhm, int (*finish) (DH *)); + + int (*DH_meth_get_finish(const DH_METHOD *dhm))(DH *); + int DH_meth_set_finish(DH_METHOD *dhm, int (*finish)(DH *)); + int (*DH_meth_get_generate_params(const DH_METHOD *dhm)) - (DH *, int, int, BN_GENCB *); + (DH *, int, int, BN_GENCB *); int DH_meth_set_generate_params(DH_METHOD *dhm, - int (*generate_params) (DH *, int, int, BN_GENCB *)); + int (*generate_params)(DH *, int, int, BN_GENCB *)); =head1 DESCRIPTION diff --git a/doc/man3/DSA_do_sign.pod b/doc/man3/DSA_do_sign.pod index 9372124ed0..a0dd8bb2f6 100644 --- a/doc/man3/DSA_do_sign.pod +++ b/doc/man3/DSA_do_sign.pod @@ -11,7 +11,7 @@ DSA_do_sign, DSA_do_verify - raw DSA signature operations DSA_SIG *DSA_do_sign(const unsigned char *dgst, int dlen, DSA *dsa); int DSA_do_verify(const unsigned char *dgst, int dgst_len, - DSA_SIG *sig, DSA *dsa); + DSA_SIG *sig, DSA *dsa); =head1 DESCRIPTION diff --git a/doc/man3/DSA_dup_DH.pod b/doc/man3/DSA_dup_DH.pod index b9113005f6..ecc9fdf71a 100644 --- a/doc/man3/DSA_dup_DH.pod +++ b/doc/man3/DSA_dup_DH.pod @@ -8,7 +8,7 @@ DSA_dup_DH - create a DH structure out of DSA structure #include - DH * DSA_dup_DH(const DSA *r); + DH *DSA_dup_DH(const DSA *r); =head1 DESCRIPTION diff --git a/doc/man3/DSA_generate_parameters.pod b/doc/man3/DSA_generate_parameters.pod index fc051495f6..4e3d74850a 100644 --- a/doc/man3/DSA_generate_parameters.pod +++ b/doc/man3/DSA_generate_parameters.pod @@ -9,15 +9,16 @@ DSA_generate_parameters_ex, DSA_generate_parameters - generate DSA parameters #include int DSA_generate_parameters_ex(DSA *dsa, int bits, - const unsigned char *seed, int seed_len, - int *counter_ret, unsigned long *h_ret, BN_GENCB *cb); + const unsigned char *seed, int seed_len, + int *counter_ret, unsigned long *h_ret, + BN_GENCB *cb); Deprecated: #if OPENSSL_API_COMPAT < 0x00908000L - DSA *DSA_generate_parameters(int bits, unsigned char *seed, - int seed_len, int *counter_ret, unsigned long *h_ret, - void (*callback)(int, int, void *), void *cb_arg); + DSA *DSA_generate_parameters(int bits, unsigned char *seed, int seed_len, + int *counter_ret, unsigned long *h_ret, + void (*callback)(int, int, void *), void *cb_arg); #endif =head1 DESCRIPTION diff --git a/doc/man3/DSA_meth_new.pod b/doc/man3/DSA_meth_new.pod index ea251cdfec..cd1735c1a3 100644 --- a/doc/man3/DSA_meth_new.pod +++ b/doc/man3/DSA_meth_new.pod @@ -17,50 +17,72 @@ DSA_meth_set_keygen - Routines to build up DSA methods #include DSA_METHOD *DSA_meth_new(const char *name, int flags); + void DSA_meth_free(DSA_METHOD *dsam); + DSA_METHOD *DSA_meth_dup(const DSA_METHOD *meth); + const char *DSA_meth_get0_name(const DSA_METHOD *dsam); int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name); + int DSA_meth_get_flags(DSA_METHOD *dsam); int DSA_meth_set_flags(DSA_METHOD *dsam, int flags); + void *DSA_meth_get0_app_data(const DSA_METHOD *dsam); int DSA_meth_set0_app_data(DSA_METHOD *dsam, void *app_data); - DSA_SIG *(*DSA_meth_get_sign(const DSA_METHOD *dsam)) - (const unsigned char *, int, DSA *); - int DSA_meth_set_sign(DSA_METHOD *dsam, - DSA_SIG *(*sign) (const unsigned char *, int, DSA *)); - int (*DSA_meth_get_sign_setup(const DSA_METHOD *dsam)) - (DSA *, BN_CTX *, BIGNUM **, BIGNUM **); - int DSA_meth_set_sign_setup(DSA_METHOD *dsam, - int (*sign_setup) (DSA *, BN_CTX *, BIGNUM **, BIGNUM **)); - int (*DSA_meth_get_verify(const DSA_METHOD *dsam)) - (const unsigned char *, int , DSA_SIG *, DSA *); - int DSA_meth_set_verify(DSA_METHOD *dsam, - int (*verify) (const unsigned char *, int, DSA_SIG *, DSA *)); - int (*DSA_meth_get_mod_exp(const DSA_METHOD *dsam)) - (DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, - BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *in_mont); - int DSA_meth_set_mod_exp(DSA_METHOD *dsam, - int (*mod_exp) (DSA *dsa, BIGNUM *rr, BIGNUM *a1, BIGNUM *p1, BIGNUM *a2, - BIGNUM *p2, BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *mont)); - int (*DSA_meth_get_bn_mod_exp(const DSA_METHOD *dsam)) - (DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, const BIGNUM *m, - BN_CTX *ctx, BN_MONT_CTX *mont); - int DSA_meth_set_bn_mod_exp(DSA_METHOD *dsam, - int (*bn_mod_exp) (DSA *dsa, BIGNUM *r, BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *mont)); + + DSA_SIG *(*DSA_meth_get_sign(const DSA_METHOD *dsam))(const unsigned char *, + int, DSA *); + int DSA_meth_set_sign(DSA_METHOD *dsam, DSA_SIG *(*sign)(const unsigned char *, + int, DSA *)); + + int (*DSA_meth_get_sign_setup(const DSA_METHOD *dsam))(DSA *, BN_CTX *,$ + BIGNUM **, BIGNUM **); + int DSA_meth_set_sign_setup(DSA_METHOD *dsam, int (*sign_setup)(DSA *, BN_CTX *, + BIGNUM **, BIGNUM **)); + + int (*DSA_meth_get_verify(const DSA_METHOD *dsam))(const unsigned char *, + int, DSA_SIG *, DSA *); + int DSA_meth_set_verify(DSA_METHOD *dsam, int (*verify)(const unsigned char *, + int, DSA_SIG *, DSA *)); + + int (*DSA_meth_get_mod_exp(const DSA_METHOD *dsam))(DSA *dsa, BIGNUM *rr, BIGNUM *a1, + BIGNUM *p1, BIGNUM *a2, BIGNUM *p2, + BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *in_mont); + int DSA_meth_set_mod_exp(DSA_METHOD *dsam, int (*mod_exp)(DSA *dsa, BIGNUM *rr, + BIGNUM *a1, BIGNUM *p1, + BIGNUM *a2, BIGNUM *p2, + BIGNUM *m, BN_CTX *ctx, + BN_MONT_CTX *mont)); + + int (*DSA_meth_get_bn_mod_exp(const DSA_METHOD *dsam))(DSA *dsa, BIGNUM *r, BIGNUM *a, + const BIGNUM *p, const BIGNUM *m, + BN_CTX *ctx, BN_MONT_CTX *mont); + int DSA_meth_set_bn_mod_exp(DSA_METHOD *dsam, int (*bn_mod_exp)(DSA *dsa, + BIGNUM *r, + BIGNUM *a, + const BIGNUM *p, + const BIGNUM *m, + BN_CTX *ctx, + BN_MONT_CTX *mont)); + int (*DSA_meth_get_init(const DSA_METHOD *dsam))(DSA *); int DSA_meth_set_init(DSA_METHOD *dsam, int (*init)(DSA *)); - int (*DSA_meth_get_finish(const DSA_METHOD *dsam)) (DSA *); - int DSA_meth_set_finish(DSA_METHOD *dsam, int (*finish) (DSA *)); - int (*DSA_meth_get_paramgen(const DSA_METHOD *dsam)) - (DSA *, int, const unsigned char *, int, int *, unsigned long *, - BN_GENCB *); + + int (*DSA_meth_get_finish(const DSA_METHOD *dsam))(DSA *); + int DSA_meth_set_finish(DSA_METHOD *dsam, int (*finish)(DSA *)); + + int (*DSA_meth_get_paramgen(const DSA_METHOD *dsam))(DSA *, int, + const unsigned char *, + int, int *, unsigned long *, + BN_GENCB *); int DSA_meth_set_paramgen(DSA_METHOD *dsam, - int (*paramgen) (DSA *, int, const unsigned char *, int, int *, - unsigned long *, BN_GENCB *)); - int (*DSA_meth_get_keygen(const DSA_METHOD *dsam)) (DSA *); - int DSA_meth_set_keygen(DSA_METHOD *dsam, int (*keygen) (DSA *)); + int (*paramgen)(DSA *, int, const unsigned char *, + int, int *, unsigned long *, BN_GENCB *)); + + int (*DSA_meth_get_keygen(const DSA_METHOD *dsam))(DSA *); + int DSA_meth_set_keygen(DSA_METHOD *dsam, int (*keygen)(DSA *)); =head1 DESCRIPTION diff --git a/doc/man3/DSA_sign.pod b/doc/man3/DSA_sign.pod index c7108c4814..458e16a3c6 100644 --- a/doc/man3/DSA_sign.pod +++ b/doc/man3/DSA_sign.pod @@ -8,13 +8,12 @@ DSA_sign, DSA_sign_setup, DSA_verify - DSA signatures #include - int DSA_sign(int type, const unsigned char *dgst, int len, - unsigned char *sigret, unsigned int *siglen, DSA *dsa); + int DSA_sign(int type, const unsigned char *dgst, int len, + unsigned char *sigret, unsigned int *siglen, DSA *dsa); - int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, - BIGNUM **rp); + int DSA_sign_setup(DSA *dsa, BN_CTX *ctx, BIGNUM **kinvp, BIGNUM **rp); - int DSA_verify(int type, const unsigned char *dgst, int len, + int DSA_verify(int type, const unsigned char *dgst, int len, unsigned char *sigbuf, int siglen, DSA *dsa); =head1 DESCRIPTION diff --git a/doc/man3/ECDSA_SIG_new.pod b/doc/man3/ECDSA_SIG_new.pod index 8d35c9e5f9..9d3cdceeab 100644 --- a/doc/man3/ECDSA_SIG_new.pod +++ b/doc/man3/ECDSA_SIG_new.pod @@ -139,6 +139,7 @@ specific) int ret; ECDSA_SIG *sig; EC_KEY *eckey; + eckey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); if (eckey == NULL) /* error */ @@ -156,6 +157,7 @@ or using ECDSA_sign(): unsigned char *buffer, *pp; int buf_len; + buf_len = ECDSA_size(eckey); buffer = OPENSSL_malloc(buf_len); pp = buffer; diff --git a/doc/man3/EC_GROUP_copy.pod b/doc/man3/EC_GROUP_copy.pod index fd5f58c919..ee20f9526a 100644 --- a/doc/man3/EC_GROUP_copy.pod +++ b/doc/man3/EC_GROUP_copy.pod @@ -23,7 +23,8 @@ EC_GROUP_get_pentanomial_basis const EC_METHOD *EC_GROUP_method_of(const EC_GROUP *group); - int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, const BIGNUM *order, const BIGNUM *cofactor); + int EC_GROUP_set_generator(EC_GROUP *group, const EC_POINT *generator, + const BIGNUM *order, const BIGNUM *cofactor); const EC_POINT *EC_GROUP_get0_generator(const EC_GROUP *group); int EC_GROUP_get_order(const EC_GROUP *group, BIGNUM *order, BN_CTX *ctx); @@ -56,7 +57,7 @@ EC_GROUP_get_pentanomial_basis int EC_GROUP_get_basis_type(const EC_GROUP *); int EC_GROUP_get_trinomial_basis(const EC_GROUP *, unsigned int *k); int EC_GROUP_get_pentanomial_basis(const EC_GROUP *, unsigned int *k1, - unsigned int *k2, unsigned int *k3); + unsigned int *k2, unsigned int *k3); =head1 DESCRIPTION diff --git a/doc/man3/EC_GROUP_new.pod b/doc/man3/EC_GROUP_new.pod index 2f658dc2c3..e36c3cb33f 100644 --- a/doc/man3/EC_GROUP_new.pod +++ b/doc/man3/EC_GROUP_new.pod @@ -21,14 +21,20 @@ objects void EC_GROUP_free(EC_GROUP *group); void EC_GROUP_clear_free(EC_GROUP *group); - EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); - EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + EC_GROUP *EC_GROUP_new_curve_GFp(const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); + EC_GROUP *EC_GROUP_new_curve_GF2m(const BIGNUM *p, const BIGNUM *a, + const BIGNUM *b, BN_CTX *ctx); EC_GROUP *EC_GROUP_new_by_curve_name(int nid); - int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); - int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); - int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); - int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, BIGNUM *a, BIGNUM *b, BN_CTX *ctx); + int EC_GROUP_set_curve_GFp(EC_GROUP *group, const BIGNUM *p, + const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + int EC_GROUP_get_curve_GFp(const EC_GROUP *group, BIGNUM *p, + BIGNUM *a, BIGNUM *b, BN_CTX *ctx); + int EC_GROUP_set_curve_GF2m(EC_GROUP *group, const BIGNUM *p, + const BIGNUM *a, const BIGNUM *b, BN_CTX *ctx); + int EC_GROUP_get_curve_GF2m(const EC_GROUP *group, BIGNUM *p, + BIGNUM *a, BIGNUM *b, BN_CTX *ctx); ECPARAMETERS *EC_GROUP_get_ecparameters(const EC_GROUP *group, ECPARAMETERS *params) ECPKPARAMETERS *EC_GROUP_get_ecpkparameters(const EC_GROUP *group, ECPKPARAMETERS *params) diff --git a/doc/man3/EC_KEY_new.pod b/doc/man3/EC_KEY_new.pod index c040706c6c..9d32d78a39 100644 --- a/doc/man3/EC_KEY_new.pod +++ b/doc/man3/EC_KEY_new.pod @@ -41,13 +41,11 @@ EC_KEY objects int EC_KEY_precompute_mult(EC_KEY *key, BN_CTX *ctx); int EC_KEY_generate_key(EC_KEY *key); int EC_KEY_check_key(const EC_KEY *key); - int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, - BIGNUM *x, BIGNUM *y); + int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, BIGNUM *y); const EC_KEY_METHOD *EC_KEY_get_method(const EC_KEY *key); int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth); - int EC_KEY_oct2key(EC_KEY *eckey, const unsigned char *buf, size_t len, - BN_CTX *ctx); + int EC_KEY_oct2key(EC_KEY *eckey, const unsigned char *buf, size_t len, BN_CTX *ctx); size_t EC_KEY_key2buf(const EC_KEY *eckey, point_conversion_form_t form, unsigned char **pbuf, BN_CTX *ctx); diff --git a/doc/man3/EC_POINT_add.pod b/doc/man3/EC_POINT_add.pod index 6f3e2308bd..3c047e1ab0 100644 --- a/doc/man3/EC_POINT_add.pod +++ b/doc/man3/EC_POINT_add.pod @@ -8,16 +8,20 @@ EC_POINT_add, EC_POINT_dbl, EC_POINT_invert, EC_POINT_is_at_infinity, EC_POINT_i #include - int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); + int EC_POINT_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, + const EC_POINT *b, BN_CTX *ctx); int EC_POINT_dbl(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a, BN_CTX *ctx); int EC_POINT_invert(const EC_GROUP *group, EC_POINT *a, BN_CTX *ctx); int EC_POINT_is_at_infinity(const EC_GROUP *group, const EC_POINT *p); int EC_POINT_is_on_curve(const EC_GROUP *group, const EC_POINT *point, BN_CTX *ctx); int EC_POINT_cmp(const EC_GROUP *group, const EC_POINT *a, const EC_POINT *b, BN_CTX *ctx); int EC_POINT_make_affine(const EC_GROUP *group, EC_POINT *point, BN_CTX *ctx); - int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], BN_CTX *ctx); - int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx); - int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); + int EC_POINTs_make_affine(const EC_GROUP *group, size_t num, + EC_POINT *points[], BN_CTX *ctx); + int EC_POINTs_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, size_t num, + const EC_POINT *p[], const BIGNUM *m[], BN_CTX *ctx); + int EC_POINT_mul(const EC_GROUP *group, EC_POINT *r, const BIGNUM *n, + const EC_POINT *q, const BIGNUM *m, BN_CTX *ctx); int EC_GROUP_precompute_mult(EC_GROUP *group, BN_CTX *ctx); int EC_GROUP_have_precompute_mult(const EC_GROUP *group); diff --git a/doc/man3/ENGINE_add.pod b/doc/man3/ENGINE_add.pod index 5346fd4d98..9585b00da7 100644 --- a/doc/man3/ENGINE_add.pod +++ b/doc/man3/ENGINE_add.pod @@ -115,9 +115,9 @@ ENGINE_unregister_digests int ENGINE_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void)); int ENGINE_cmd_is_executable(ENGINE *e, int cmd); int ENGINE_ctrl_cmd(ENGINE *e, const char *cmd_name, - long i, void *p, void (*f)(void), int cmd_optional); + long i, void *p, void (*f)(void), int cmd_optional); int ENGINE_ctrl_cmd_string(ENGINE *e, const char *cmd_name, const char *arg, - int cmd_optional); + int cmd_optional); ENGINE *ENGINE_new(void); int ENGINE_free(ENGINE *e); @@ -164,9 +164,9 @@ ENGINE_unregister_digests const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e); EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, - UI_METHOD *ui_method, void *callback_data); + UI_METHOD *ui_method, void *callback_data); EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, - UI_METHOD *ui_method, void *callback_data); + UI_METHOD *ui_method, void *callback_data); Deprecated: @@ -550,7 +550,7 @@ If an ENGINE specifies the ENGINE_FLAGS_MANUAL_CMD_CTRL flag, then it will simply pass all these "core" control commands directly to the ENGINE's ctrl() handler (and thus, it must have supplied one), so it is up to the ENGINE to reply to these "discovery" commands itself. If that flag is not set, then the -OpenSSL framework code will work with the following rules; +OpenSSL framework code will work with the following rules: if no ctrl() handler supplied; ENGINE_HAS_CTRL_FUNCTION returns FALSE (zero), diff --git a/doc/man3/ERR_get_error.pod b/doc/man3/ERR_get_error.pod index 3b223c99de..a76df03882 100644 --- a/doc/man3/ERR_get_error.pod +++ b/doc/man3/ERR_get_error.pod @@ -20,11 +20,11 @@ ERR_peek_last_error_line_data - obtain error code and data unsigned long ERR_peek_last_error_line(const char **file, int *line); unsigned long ERR_get_error_line_data(const char **file, int *line, - const char **data, int *flags); + const char **data, int *flags); unsigned long ERR_peek_error_line_data(const char **file, int *line, - const char **data, int *flags); + const char **data, int *flags); unsigned long ERR_peek_last_error_line_data(const char **file, int *line, - const char **data, int *flags); + const char **data, int *flags); =head1 DESCRIPTION diff --git a/doc/man3/ERR_print_errors.pod b/doc/man3/ERR_print_errors.pod index 134b374d0d..f7e612f618 100644 --- a/doc/man3/ERR_print_errors.pod +++ b/doc/man3/ERR_print_errors.pod @@ -11,8 +11,7 @@ ERR_print_errors, ERR_print_errors_fp, ERR_print_errors_cb void ERR_print_errors(BIO *bp); void ERR_print_errors_fp(FILE *fp); - void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), - void *u) + void ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u) =head1 DESCRIPTION diff --git a/doc/man3/ERR_put_error.pod b/doc/man3/ERR_put_error.pod index 509ee1e375..4fba618db4 100644 --- a/doc/man3/ERR_put_error.pod +++ b/doc/man3/ERR_put_error.pod @@ -8,8 +8,7 @@ ERR_put_error, ERR_add_error_data, ERR_add_error_vdata - record an error #include - void ERR_put_error(int lib, int func, int reason, const char *file, - int line); + void ERR_put_error(int lib, int func, int reason, const char *file, int line); void ERR_add_error_data(int num, ...); void ERR_add_error_vdata(int num, va_list arg); diff --git a/doc/man3/EVP_CIPHER_meth_new.pod b/doc/man3/EVP_CIPHER_meth_new.pod index 6190b71ee6..f8478e38d4 100644 --- a/doc/man3/EVP_CIPHER_meth_new.pod +++ b/doc/man3/EVP_CIPHER_meth_new.pod @@ -24,26 +24,26 @@ EVP_CIPHER_meth_get_ctrl - Routines to build up EVP_CIPHER methods int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags); int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size); int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher, - int (*init) (EVP_CIPHER_CTX *ctx, - const unsigned char *key, - const unsigned char *iv, - int enc)); + int (*init)(EVP_CIPHER_CTX *ctx, + const unsigned char *key, + const unsigned char *iv, + int enc)); int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher, - int (*do_cipher) (EVP_CIPHER_CTX *ctx, - unsigned char *out, - const unsigned char *in, - size_t inl)); + int (*do_cipher)(EVP_CIPHER_CTX *ctx, + unsigned char *out, + const unsigned char *in, + size_t inl)); int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher, - int (*cleanup) (EVP_CIPHER_CTX *)); + int (*cleanup)(EVP_CIPHER_CTX *)); int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher, - int (*set_asn1_parameters) (EVP_CIPHER_CTX *, - ASN1_TYPE *)); + int (*set_asn1_parameters)(EVP_CIPHER_CTX *, + ASN1_TYPE *)); int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher, - int (*get_asn1_parameters) (EVP_CIPHER_CTX *, - ASN1_TYPE *)); + int (*get_asn1_parameters)(EVP_CIPHER_CTX *, + ASN1_TYPE *)); int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher, - int (*ctrl) (EVP_CIPHER_CTX *, int type, - int arg, void *ptr)); + int (*ctrl)(EVP_CIPHER_CTX *, int type, + int arg, void *ptr)); int (*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, const unsigned char *key, @@ -57,7 +57,7 @@ EVP_CIPHER_meth_get_ctrl - Routines to build up EVP_CIPHER methods int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, ASN1_TYPE *); int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, - ASN1_TYPE *); + ASN1_TYPE *); int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, int type, int arg, void *ptr); diff --git a/doc/man3/EVP_DigestInit.pod b/doc/man3/EVP_DigestInit.pod index 26f0b6e8bb..d0bb33713a 100644 --- a/doc/man3/EVP_DigestInit.pod +++ b/doc/man3/EVP_DigestInit.pod @@ -22,14 +22,12 @@ EVP_get_digestbynid, EVP_get_digestbyobj - EVP digest routines int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); - int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, - unsigned int *s); + int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); int EVP_MD_CTX_copy_ex(EVP_MD_CTX *out, const EVP_MD_CTX *in); int EVP_DigestInit(EVP_MD_CTX *ctx, const EVP_MD *type); - int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, - unsigned int *s); + int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *s); int EVP_MD_CTX_copy(EVP_MD_CTX *out, EVP_MD_CTX *in); diff --git a/doc/man3/EVP_DigestVerifyInit.pod b/doc/man3/EVP_DigestVerifyInit.pod index c48b5593e5..a1f0473958 100644 --- a/doc/man3/EVP_DigestVerifyInit.pod +++ b/doc/man3/EVP_DigestVerifyInit.pod @@ -10,7 +10,7 @@ EVP_DigestVerify - EVP signature verification functions #include int EVP_DigestVerifyInit(EVP_MD_CTX *ctx, EVP_PKEY_CTX **pctx, - const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); + const EVP_MD *type, ENGINE *e, EVP_PKEY *pkey); int EVP_DigestVerifyUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt); int EVP_DigestVerifyFinal(EVP_MD_CTX *ctx, const unsigned char *sig, size_t siglen); diff --git a/doc/man3/EVP_EncodeInit.pod b/doc/man3/EVP_EncodeInit.pod index 55a17befe0..8055b100b2 100644 --- a/doc/man3/EVP_EncodeInit.pod +++ b/doc/man3/EVP_EncodeInit.pod @@ -24,8 +24,7 @@ EVP_DecodeBlock - EVP base 64 encode/decode routines void EVP_DecodeInit(EVP_ENCODE_CTX *ctx); int EVP_DecodeUpdate(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl, const unsigned char *in, int inl); - int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned - char *out, int *outl); + int EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl); int EVP_DecodeBlock(unsigned char *t, const unsigned char *f, int n); =head1 DESCRIPTION diff --git a/doc/man3/EVP_EncryptInit.pod b/doc/man3/EVP_EncryptInit.pod index bf93a2b6d2..46e6a57d4b 100644 --- a/doc/man3/EVP_EncryptInit.pod +++ b/doc/man3/EVP_EncryptInit.pod @@ -45,40 +45,34 @@ EVP_chacha20, EVP_chacha20_poly1305 - EVP cipher routines void EVP_CIPHER_CTX_free(EVP_CIPHER_CTX *ctx); int EVP_EncryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - ENGINE *impl, unsigned char *key, unsigned char *iv); + ENGINE *impl, unsigned char *key, unsigned char *iv); int EVP_EncryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, unsigned char *in, int inl); - int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl); + int *outl, unsigned char *in, int inl); + int EVP_EncryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); int EVP_DecryptInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - ENGINE *impl, unsigned char *key, unsigned char *iv); + ENGINE *impl, unsigned char *key, unsigned char *iv); int EVP_DecryptUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, unsigned char *in, int inl); - int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, - int *outl); + int *outl, unsigned char *in, int inl); + int EVP_DecryptFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - ENGINE *impl, unsigned char *key, unsigned char *iv, int enc); + ENGINE *impl, unsigned char *key, unsigned char *iv, int enc); int EVP_CipherUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, unsigned char *in, int inl); - int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, - int *outl); + int *outl, unsigned char *in, int inl); + int EVP_CipherFinal_ex(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_EncryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - unsigned char *key, unsigned char *iv); - int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl); + unsigned char *key, unsigned char *iv); + int EVP_EncryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); int EVP_DecryptInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - unsigned char *key, unsigned char *iv); - int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, - int *outl); + unsigned char *key, unsigned char *iv); + int EVP_DecryptFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_CipherInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, - unsigned char *key, unsigned char *iv, int enc); - int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, - int *outl); + unsigned char *key, unsigned char *iv, int enc); + int EVP_CipherFinal(EVP_CIPHER_CTX *ctx, unsigned char *outm, int *outl); int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *x, int padding); int EVP_CIPHER_CTX_set_key_length(EVP_CIPHER_CTX *x, int keylen); diff --git a/doc/man3/EVP_OpenInit.pod b/doc/man3/EVP_OpenInit.pod index 3b6fd1a1bf..61b4307bca 100644 --- a/doc/man3/EVP_OpenInit.pod +++ b/doc/man3/EVP_OpenInit.pod @@ -9,11 +9,10 @@ EVP_OpenInit, EVP_OpenUpdate, EVP_OpenFinal - EVP envelope decryption #include int EVP_OpenInit(EVP_CIPHER_CTX *ctx, EVP_CIPHER *type, unsigned char *ek, - int ekl, unsigned char *iv, EVP_PKEY *priv); + int ekl, unsigned char *iv, EVP_PKEY *priv); int EVP_OpenUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, unsigned char *in, int inl); - int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl); + int *outl, unsigned char *in, int inl); + int EVP_OpenFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); =head1 DESCRIPTION diff --git a/doc/man3/EVP_PKEY_CTX_ctrl.pod b/doc/man3/EVP_PKEY_CTX_ctrl.pod index 0e043f1a72..5c8df6dd0f 100644 --- a/doc/man3/EVP_PKEY_CTX_ctrl.pod +++ b/doc/man3/EVP_PKEY_CTX_ctrl.pod @@ -16,9 +16,9 @@ EVP_PKEY_CTX_set_ec_param_enc - algorithm specific control operations #include int EVP_PKEY_CTX_ctrl(EVP_PKEY_CTX *ctx, int keytype, int optype, - int cmd, int p1, void *p2); + int cmd, int p1, void *p2); int EVP_PKEY_CTX_ctrl_str(EVP_PKEY_CTX *ctx, const char *type, - const char *value); + const char *value); #include diff --git a/doc/man3/EVP_PKEY_CTX_set_tls1_prf_md.pod b/doc/man3/EVP_PKEY_CTX_set_tls1_prf_md.pod index 81fd7aa943..30e50bc63e 100644 --- a/doc/man3/EVP_PKEY_CTX_set_tls1_prf_md.pod +++ b/doc/man3/EVP_PKEY_CTX_set_tls1_prf_md.pod @@ -78,6 +78,7 @@ and seed value "seed": EVP_PKEY_CTX *pctx; unsigned char out[10]; size_t outlen = sizeof(out); + pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_TLS1_PRF, NULL); if (EVP_PKEY_derive_init(pctx) <= 0) /* Error */ diff --git a/doc/man3/EVP_PKEY_decrypt.pod b/doc/man3/EVP_PKEY_decrypt.pod index b36da85e6b..07eaa04f4b 100644 --- a/doc/man3/EVP_PKEY_decrypt.pod +++ b/doc/man3/EVP_PKEY_decrypt.pod @@ -10,8 +10,8 @@ EVP_PKEY_decrypt_init, EVP_PKEY_decrypt - decrypt using a public key algorithm int EVP_PKEY_decrypt_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_decrypt(EVP_PKEY_CTX *ctx, - unsigned char *out, size_t *outlen, - const unsigned char *in, size_t inlen); + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); =head1 DESCRIPTION @@ -52,6 +52,7 @@ Decrypt data using OAEP (for RSA keys): unsigned char *out, *in; size_t outlen, inlen; EVP_PKEY *key; + /* * NB: assumes key in, inlen are already set up * and that key is an RSA private key diff --git a/doc/man3/EVP_PKEY_encrypt.pod b/doc/man3/EVP_PKEY_encrypt.pod index 2234897bd2..4e9a34e740 100644 --- a/doc/man3/EVP_PKEY_encrypt.pod +++ b/doc/man3/EVP_PKEY_encrypt.pod @@ -10,8 +10,8 @@ EVP_PKEY_encrypt_init, EVP_PKEY_encrypt - encrypt using a public key algorithm int EVP_PKEY_encrypt_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_encrypt(EVP_PKEY_CTX *ctx, - unsigned char *out, size_t *outlen, - const unsigned char *in, size_t inlen); + unsigned char *out, size_t *outlen, + const unsigned char *in, size_t inlen); =head1 DESCRIPTION @@ -56,6 +56,7 @@ set 'eng = NULL;' to start with the default OpenSSL RSA implementation: unsigned char *out, *in; size_t outlen, inlen; EVP_PKEY *key; + /* * NB: assumes eng, key, in, inlen are already set up, * and that key is an RSA public key diff --git a/doc/man3/EVP_PKEY_keygen.pod b/doc/man3/EVP_PKEY_keygen.pod index f7c788570a..b7f2128baa 100644 --- a/doc/man3/EVP_PKEY_keygen.pod +++ b/doc/man3/EVP_PKEY_keygen.pod @@ -98,6 +98,7 @@ Generate a 2048 bit RSA key: EVP_PKEY_CTX *ctx; EVP_PKEY *pkey = NULL; + ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_RSA, NULL); if (!ctx) /* Error occurred */ @@ -117,6 +118,7 @@ Generate a key from a set of parameters: EVP_PKEY_CTX *ctx; EVP_PKEY *pkey = NULL, *param; + /* Assumed param is set up already */ ctx = EVP_PKEY_CTX_new(param); if (!ctx) @@ -139,6 +141,7 @@ Example of generation callback for OpenSSL public key implementations: char c = '*'; BIO *b = EVP_PKEY_CTX_get_app_data(ctx); int p = EVP_PKEY_CTX_get_keygen_info(ctx, 0); + if (p == 0) c = '.'; if (p == 1) diff --git a/doc/man3/EVP_PKEY_print_private.pod b/doc/man3/EVP_PKEY_print_private.pod index 9f1d324f81..d652819c46 100644 --- a/doc/man3/EVP_PKEY_print_private.pod +++ b/doc/man3/EVP_PKEY_print_private.pod @@ -9,11 +9,11 @@ EVP_PKEY_print_public, EVP_PKEY_print_private, EVP_PKEY_print_params - public ke #include int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey, - int indent, ASN1_PCTX *pctx); + int indent, ASN1_PCTX *pctx); int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey, - int indent, ASN1_PCTX *pctx); + int indent, ASN1_PCTX *pctx); int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey, - int indent, ASN1_PCTX *pctx); + int indent, ASN1_PCTX *pctx); =head1 DESCRIPTION diff --git a/doc/man3/EVP_PKEY_sign.pod b/doc/man3/EVP_PKEY_sign.pod index eec782fc09..bdebf0b924 100644 --- a/doc/man3/EVP_PKEY_sign.pod +++ b/doc/man3/EVP_PKEY_sign.pod @@ -10,8 +10,8 @@ EVP_PKEY_sign_init, EVP_PKEY_sign - sign using a public key algorithm int EVP_PKEY_sign_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_sign(EVP_PKEY_CTX *ctx, - unsigned char *sig, size_t *siglen, - const unsigned char *tbs, size_t tbslen); + unsigned char *sig, size_t *siglen, + const unsigned char *tbs, size_t tbslen); =head1 DESCRIPTION diff --git a/doc/man3/EVP_PKEY_verify.pod b/doc/man3/EVP_PKEY_verify.pod index bf122c7bfb..5c416920fc 100644 --- a/doc/man3/EVP_PKEY_verify.pod +++ b/doc/man3/EVP_PKEY_verify.pod @@ -10,8 +10,8 @@ EVP_PKEY_verify_init, EVP_PKEY_verify - signature verification using a public ke int EVP_PKEY_verify_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_verify(EVP_PKEY_CTX *ctx, - const unsigned char *sig, size_t siglen, - const unsigned char *tbs, size_t tbslen); + const unsigned char *sig, size_t siglen, + const unsigned char *tbs, size_t tbslen); =head1 DESCRIPTION @@ -55,6 +55,7 @@ Verify signature using PKCS#1 and SHA256 digest: unsigned char *md, *sig; size_t mdlen, siglen; EVP_PKEY *verify_key; + /* * NB: assumes verify_key, sig, siglen md and mdlen are already set up * and that verify_key is an RSA public key diff --git a/doc/man3/EVP_PKEY_verify_recover.pod b/doc/man3/EVP_PKEY_verify_recover.pod index beb5b614a9..830ec03035 100644 --- a/doc/man3/EVP_PKEY_verify_recover.pod +++ b/doc/man3/EVP_PKEY_verify_recover.pod @@ -10,8 +10,8 @@ EVP_PKEY_verify_recover_init, EVP_PKEY_verify_recover - recover signature using int EVP_PKEY_verify_recover_init(EVP_PKEY_CTX *ctx); int EVP_PKEY_verify_recover(EVP_PKEY_CTX *ctx, - unsigned char *rout, size_t *routlen, - const unsigned char *sig, size_t siglen); + unsigned char *rout, size_t *routlen, + const unsigned char *sig, size_t siglen); =head1 DESCRIPTION @@ -60,6 +60,7 @@ Recover digest originally signed using PKCS#1 and SHA256 digest: unsigned char *rout, *sig; size_t routlen, siglen; EVP_PKEY *verify_key; + /* * NB: assumes verify_key, sig and siglen are already set up * and that verify_key is an RSA public key diff --git a/doc/man3/EVP_SealInit.pod b/doc/man3/EVP_SealInit.pod index fda0102e7f..29d89c3052 100644 --- a/doc/man3/EVP_SealInit.pod +++ b/doc/man3/EVP_SealInit.pod @@ -12,9 +12,8 @@ EVP_SealInit, EVP_SealUpdate, EVP_SealFinal - EVP envelope encryption unsigned char **ek, int *ekl, unsigned char *iv, EVP_PKEY **pubk, int npubk); int EVP_SealUpdate(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl, unsigned char *in, int inl); - int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, - int *outl); + int *outl, unsigned char *in, int inl); + int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl); =head1 DESCRIPTION diff --git a/doc/man3/EVP_VerifyInit.pod b/doc/man3/EVP_VerifyInit.pod index ffb6f140b7..ad8a8c0199 100644 --- a/doc/man3/EVP_VerifyInit.pod +++ b/doc/man3/EVP_VerifyInit.pod @@ -12,7 +12,8 @@ EVP_VerifyInit, EVP_VerifyUpdate, EVP_VerifyFinal int EVP_VerifyInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl); int EVP_VerifyUpdate(EVP_MD_CTX *ctx, const void *d, unsigned int cnt); - int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf, unsigned int siglen, EVP_PKEY *pkey); + int EVP_VerifyFinal(EVP_MD_CTX *ctx, unsigned char *sigbuf, unsigned int siglen, + EVP_PKEY *pkey); int EVP_VerifyInit(EVP_MD_CTX *ctx, const EVP_MD *type); diff --git a/doc/man3/HMAC.pod b/doc/man3/HMAC.pod index ad7aaeb099..8cc3df9ab7 100644 --- a/doc/man3/HMAC.pod +++ b/doc/man3/HMAC.pod @@ -21,14 +21,14 @@ HMAC_size #include unsigned char *HMAC(const EVP_MD *evp_md, const void *key, - int key_len, const unsigned char *d, int n, - unsigned char *md, unsigned int *md_len); + int key_len, const unsigned char *d, int n, + unsigned char *md, unsigned int *md_len); HMAC_CTX *HMAC_CTX_new(void); int HMAC_CTX_reset(HMAC_CTX *ctx); int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int key_len, - const EVP_MD *md, ENGINE *impl); + const EVP_MD *md, ENGINE *impl); int HMAC_Update(HMAC_CTX *ctx, const unsigned char *data, int len); int HMAC_Final(HMAC_CTX *ctx, unsigned char *md, unsigned int *len); diff --git a/doc/man3/MD5.pod b/doc/man3/MD5.pod index 78da750796..83547f2ce5 100644 --- a/doc/man3/MD5.pod +++ b/doc/man3/MD5.pod @@ -9,34 +9,28 @@ MD4_Final, MD5_Init, MD5_Update, MD5_Final - MD2, MD4, and MD5 hash functions #include - unsigned char *MD2(const unsigned char *d, unsigned long n, - unsigned char *md); + unsigned char *MD2(const unsigned char *d, unsigned long n, unsigned char *md); int MD2_Init(MD2_CTX *c); - int MD2_Update(MD2_CTX *c, const unsigned char *data, - unsigned long len); + int MD2_Update(MD2_CTX *c, const unsigned char *data, unsigned long len); int MD2_Final(unsigned char *md, MD2_CTX *c); #include - unsigned char *MD4(const unsigned char *d, unsigned long n, - unsigned char *md); + unsigned char *MD4(const unsigned char *d, unsigned long n, unsigned char *md); int MD4_Init(MD4_CTX *c); - int MD4_Update(MD4_CTX *c, const void *data, - unsigned long len); + int MD4_Update(MD4_CTX *c, const void *data, unsigned long len); int MD4_Final(unsigned char *md, MD4_CTX *c); #include - unsigned char *MD5(const unsigned char *d, unsigned long n, - unsigned char *md); + unsigned char *MD5(const unsigned char *d, unsigned long n, unsigned char *md); int MD5_Init(MD5_CTX *c); - int MD5_Update(MD5_CTX *c, const void *data, - unsigned long len); + int MD5_Update(MD5_CTX *c, const void *data, unsigned long len); int MD5_Final(unsigned char *md, MD5_CTX *c); =head1 DESCRIPTION diff --git a/doc/man3/MDC2_Init.pod b/doc/man3/MDC2_Init.pod index f7db71b460..fb8d25a9bb 100644 --- a/doc/man3/MDC2_Init.pod +++ b/doc/man3/MDC2_Init.pod @@ -9,11 +9,11 @@ MDC2, MDC2_Init, MDC2_Update, MDC2_Final - MDC2 hash function #include unsigned char *MDC2(const unsigned char *d, unsigned long n, - unsigned char *md); + unsigned char *md); int MDC2_Init(MDC2_CTX *c); int MDC2_Update(MDC2_CTX *c, const unsigned char *data, - unsigned long len); + unsigned long len); int MDC2_Final(unsigned char *md, MDC2_CTX *c); =head1 DESCRIPTION diff --git a/doc/man3/OBJ_nid2obj.pod b/doc/man3/OBJ_nid2obj.pod index b4322f17dd..5c628f5f91 100644 --- a/doc/man3/OBJ_nid2obj.pod +++ b/doc/man3/OBJ_nid2obj.pod @@ -137,8 +137,7 @@ The latter cannot be constant because it needs to be freed after use. Create an object for B: - ASN1_OBJECT *o; - o = OBJ_nid2obj(NID_commonName); + ASN1_OBJECT *o = OBJ_nid2obj(NID_commonName); Check if an object is B @@ -147,12 +146,8 @@ Check if an object is B Create a new NID and initialize an object from it: - int new_nid; - ASN1_OBJECT *obj; - - new_nid = OBJ_create("1.2.3.4", "NewOID", "New Object Identifier"); - - obj = OBJ_nid2obj(new_nid); + int new_nid = OBJ_create("1.2.3.4", "NewOID", "New Object Identifier"); + ASN1_OBJECT *obj = OBJ_nid2obj(new_nid); Create a new object directly: diff --git a/doc/man3/OPENSSL_malloc.pod b/doc/man3/OPENSSL_malloc.pod index afcdb55606..39f9047bda 100644 --- a/doc/man3/OPENSSL_malloc.pod +++ b/doc/man3/OPENSSL_malloc.pod @@ -49,7 +49,8 @@ OPENSSL_MALLOC_FD void CRYPTO_free(void *str, const char *, int) char *CRYPTO_strdup(const char *p, const char *file, int line) char *CRYPTO_strndup(const char *p, size_t num, const char *file, int line) - void *CRYPTO_clear_realloc(void *p, size_t old_len, size_t num, const char *file, int line) + void *CRYPTO_clear_realloc(void *p, size_t old_len, size_t num, + const char *file, int line) void CRYPTO_clear_free(void *str, size_t num, const char *, int) void CRYPTO_get_mem_functions( diff --git a/doc/man3/PEM_read_bio_PrivateKey.pod b/doc/man3/PEM_read_bio_PrivateKey.pod index f736545cf2..5fb14e9cef 100644 --- a/doc/man3/PEM_read_bio_PrivateKey.pod +++ b/doc/man3/PEM_read_bio_PrivateKey.pod @@ -305,6 +305,7 @@ most of them are set to 0 or NULL. Read a certificate in PEM format from a BIO: X509 *x; + x = PEM_read_bio_X509(bp, NULL, 0, NULL); if (x == NULL) /* Error */ @@ -312,6 +313,7 @@ Read a certificate in PEM format from a BIO: Alternative method: X509 *x = NULL; + if (!PEM_read_bio_X509(bp, &x, 0, NULL)) /* Error */ @@ -377,6 +379,7 @@ A frequent cause of problems is attempting to use the PEM routines like this: X509 *x; + PEM_read_bio_X509(bp, &x, 0, NULL); this is a bug because an attempt will be made to reuse the data at B diff --git a/doc/man3/PKCS12_newpass.pod b/doc/man3/PKCS12_newpass.pod index 5c8eaf79ac..58207f5ea5 100644 --- a/doc/man3/PKCS12_newpass.pod +++ b/doc/man3/PKCS12_newpass.pod @@ -49,6 +49,7 @@ the result to a new file. { FILE *fp; PKCS12 *p12; + if (argc != 5) { fprintf(stderr, "Usage: pkread p12file password newpass opfile\n"); return 1; diff --git a/doc/man3/PKCS5_PBKDF2_HMAC.pod b/doc/man3/PKCS5_PBKDF2_HMAC.pod index 5217b192f2..e5d1689e30 100644 --- a/doc/man3/PKCS5_PBKDF2_HMAC.pod +++ b/doc/man3/PKCS5_PBKDF2_HMAC.pod @@ -13,9 +13,9 @@ PKCS5_PBKDF2_HMAC, PKCS5_PBKDF2_HMAC_SHA1 - password based derivation routines w const EVP_MD *digest, int keylen, unsigned char *out); -int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, - const unsigned char *salt, int saltlen, int iter, - int keylen, unsigned char *out); + int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen, + const unsigned char *salt, int saltlen, int iter, + int keylen, unsigned char *out); =head1 DESCRIPTION diff --git a/doc/man3/PKCS7_encrypt.pod b/doc/man3/PKCS7_encrypt.pod index 4e1afc916f..9895a1f73b 100644 --- a/doc/man3/PKCS7_encrypt.pod +++ b/doc/man3/PKCS7_encrypt.pod @@ -8,7 +8,8 @@ PKCS7_encrypt - create a PKCS#7 envelopedData structure #include - PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, int flags); + PKCS7 *PKCS7_encrypt(STACK_OF(X509) *certs, BIO *in, const EVP_CIPHER *cipher, + int flags); =head1 DESCRIPTION diff --git a/doc/man3/PKCS7_sign.pod b/doc/man3/PKCS7_sign.pod index b5a52da9a2..567d7db0cd 100644 --- a/doc/man3/PKCS7_sign.pod +++ b/doc/man3/PKCS7_sign.pod @@ -8,7 +8,8 @@ PKCS7_sign - create a PKCS#7 signedData structure #include - PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, int flags); + PKCS7 *PKCS7_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, + BIO *data, int flags); =head1 DESCRIPTION @@ -65,7 +66,6 @@ way data can be signed in a single pass. If the B flag is set a partial B structure is output to which additional signers and capabilities can be added before finalization. - =head1 NOTES If the flag B is set the returned B structure is B diff --git a/doc/man3/PKCS7_sign_add_signer.pod b/doc/man3/PKCS7_sign_add_signer.pod index c2a06e7a77..048a94817a 100644 --- a/doc/man3/PKCS7_sign_add_signer.pod +++ b/doc/man3/PKCS7_sign_add_signer.pod @@ -8,7 +8,8 @@ PKCS7_sign_add_signer - add a signer PKCS7 signed data structure #include - PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert, EVP_PKEY *pkey, const EVP_MD *md, int flags); + PKCS7_SIGNER_INFO *PKCS7_sign_add_signer(PKCS7 *p7, X509 *signcert, + EVP_PKEY *pkey, const EVP_MD *md, int flags); =head1 DESCRIPTION diff --git a/doc/man3/PKCS7_verify.pod b/doc/man3/PKCS7_verify.pod index c34808eced..ebcdde0795 100644 --- a/doc/man3/PKCS7_verify.pod +++ b/doc/man3/PKCS7_verify.pod @@ -8,7 +8,8 @@ PKCS7_verify, PKCS7_get0_signers - verify a PKCS#7 signedData structure #include - int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, BIO *indata, BIO *out, int flags); + int PKCS7_verify(PKCS7 *p7, STACK_OF(X509) *certs, X509_STORE *store, + BIO *indata, BIO *out, int flags); STACK_OF(X509) *PKCS7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags); diff --git a/doc/man3/RIPEMD160_Init.pod b/doc/man3/RIPEMD160_Init.pod index a372e32ca3..a5c3c26a4a 100644 --- a/doc/man3/RIPEMD160_Init.pod +++ b/doc/man3/RIPEMD160_Init.pod @@ -10,11 +10,10 @@ RIPEMD-160 hash function #include unsigned char *RIPEMD160(const unsigned char *d, unsigned long n, - unsigned char *md); + unsigned char *md); int RIPEMD160_Init(RIPEMD160_CTX *c); - int RIPEMD160_Update(RIPEMD_CTX *c, const void *data, - unsigned long len); + int RIPEMD160_Update(RIPEMD_CTX *c, const void *data, unsigned long len); int RIPEMD160_Final(unsigned char *md, RIPEMD160_CTX *c); =head1 DESCRIPTION diff --git a/doc/man3/RSA_generate_key.pod b/doc/man3/RSA_generate_key.pod index e51c0b147b..6cda49d745 100644 --- a/doc/man3/RSA_generate_key.pod +++ b/doc/man3/RSA_generate_key.pod @@ -14,7 +14,7 @@ Deprecated: #if OPENSSL_API_COMPAT < 0x00908000L RSA *RSA_generate_key(int num, unsigned long e, - void (*callback)(int, int, void *), void *cb_arg); + void (*callback)(int, int, void *), void *cb_arg); #endif =head1 DESCRIPTION diff --git a/doc/man3/RSA_meth_new.pod b/doc/man3/RSA_meth_new.pod index e46b3984f6..5e430d6395 100644 --- a/doc/man3/RSA_meth_new.pod +++ b/doc/man3/RSA_meth_new.pod @@ -21,88 +21,95 @@ RSA_meth_set_verify, RSA_meth_get_keygen, RSA_meth_set_keygen RSA_METHOD *RSA_meth_new(const char *name, int flags); void RSA_meth_free(RSA_METHOD *meth); + RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); + const char *RSA_meth_get0_name(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); + int RSA_meth_get_flags(RSA_METHOD *meth); int RSA_meth_set_flags(RSA_METHOD *meth, int flags); + void *RSA_meth_get0_app_data(const RSA_METHOD *meth); int RSA_meth_set0_app_data(RSA_METHOD *meth, void *app_data); - int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth)) - (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); + + int (*RSA_meth_get_pub_enc(const RSA_METHOD *meth))(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, int padding); int RSA_meth_set_pub_enc(RSA_METHOD *rsa, - int (*pub_enc) (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, - int padding)); + int (*pub_enc)(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, + int padding)); + int (*RSA_meth_get_pub_dec(const RSA_METHOD *meth)) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding); int RSA_meth_set_pub_dec(RSA_METHOD *rsa, - int (*pub_dec) (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, - int padding)); - int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth)) - (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); + int (*pub_dec)(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, + int padding)); + + int (*RSA_meth_get_priv_enc(const RSA_METHOD *meth))(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, + int padding); int RSA_meth_set_priv_enc(RSA_METHOD *rsa, - int (*priv_enc) (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, - int padding)); - int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth)) - (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); + int (*priv_enc)(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, int padding)); + + int (*RSA_meth_get_priv_dec(const RSA_METHOD *meth))(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, + int padding); int RSA_meth_set_priv_dec(RSA_METHOD *rsa, - int (*priv_dec) (int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, - int padding)); - /* Can be null */ - int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth)) - (BIGNUM *r0, const BIGNUM *I, RSA *rsa, BN_CTX *ctx); + int (*priv_dec)(int flen, const unsigned char *from, + unsigned char *to, RSA *rsa, int padding)); + + /* Can be null */ + int (*RSA_meth_get_mod_exp(const RSA_METHOD *meth))(BIGNUM *r0, const BIGNUM *I, + RSA *rsa, BN_CTX *ctx); int RSA_meth_set_mod_exp(RSA_METHOD *rsa, - int (*mod_exp) (BIGNUM *r0, const BIGNUM *I, RSA *rsa, - BN_CTX *ctx)); - /* Can be null */ - int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth)) - (BIGNUM *r, const BIGNUM *a, const BIGNUM *p, - const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); + int (*mod_exp)(BIGNUM *r0, const BIGNUM *I, RSA *rsa, + BN_CTX *ctx)); + + /* Can be null */ + int (*RSA_meth_get_bn_mod_exp(const RSA_METHOD *meth))(BIGNUM *r, const BIGNUM *a, + const BIGNUM *p, const BIGNUM *m, + BN_CTX *ctx, BN_MONT_CTX *m_ctx); int RSA_meth_set_bn_mod_exp(RSA_METHOD *rsa, - int (*bn_mod_exp) (BIGNUM *r, - const BIGNUM *a, - const BIGNUM *p, - const BIGNUM *m, - BN_CTX *ctx, - BN_MONT_CTX *m_ctx)); - /* called at new */ - int (*RSA_meth_get_init(const RSA_METHOD *meth)) (RSA *rsa); - int RSA_meth_set_init(RSA_METHOD *rsa, int (*init) (RSA *rsa)); - /* called at free */ - int (*RSA_meth_get_finish(const RSA_METHOD *meth)) (RSA *rsa); - int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish) (RSA *rsa)); - int (*RSA_meth_get_sign(const RSA_METHOD *meth)) - (int type, - const unsigned char *m, unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, - const RSA *rsa); + int (*bn_mod_exp)(BIGNUM *r, const BIGNUM *a, + const BIGNUM *p, const BIGNUM *m, + BN_CTX *ctx, BN_MONT_CTX *m_ctx)); + + /* called at new */ + int (*RSA_meth_get_init(const RSA_METHOD *meth) (RSA *rsa); + int RSA_meth_set_init(RSA_METHOD *rsa, int (*init (RSA *rsa)); + + /* called at free */ + int (*RSA_meth_get_finish(const RSA_METHOD *meth))(RSA *rsa); + int RSA_meth_set_finish(RSA_METHOD *rsa, int (*finish)(RSA *rsa)); + + int (*RSA_meth_get_sign(const RSA_METHOD *meth))(int type, const unsigned char *m, + unsigned int m_length, + unsigned char *sigret, + unsigned int *siglen, const RSA *rsa); int RSA_meth_set_sign(RSA_METHOD *rsa, - int (*sign) (int type, const unsigned char *m, - unsigned int m_length, - unsigned char *sigret, unsigned int *siglen, - const RSA *rsa)); - int (*RSA_meth_get_verify(const RSA_METHOD *meth)) - (int dtype, const unsigned char *m, - unsigned int m_length, const unsigned char *sigbuf, - unsigned int siglen, const RSA *rsa); + int (*sign)(int type, const unsigned char *m, + unsigned int m_length, unsigned char *sigret, + unsigned int *siglen, const RSA *rsa)); + + int (*RSA_meth_get_verify(const RSA_METHOD *meth))(int dtype, const unsigned char *m, + unsigned int m_length, + const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa); int RSA_meth_set_verify(RSA_METHOD *rsa, - int (*verify) (int dtype, const unsigned char *m, - unsigned int m_length, - const unsigned char *sigbuf, - unsigned int siglen, const RSA *rsa)); - int (*RSA_meth_get_keygen(const RSA_METHOD *meth)) - (RSA *rsa, int bits, BIGNUM *e, BN_GENCB *cb); + int (*verify)(int dtype, const unsigned char *m, + unsigned int m_length, + const unsigned char *sigbuf, + unsigned int siglen, const RSA *rsa)); + + int (*RSA_meth_get_keygen(const RSA_METHOD *meth))(RSA *rsa, int bits, BIGNUM *e, + BN_GENCB *cb); int RSA_meth_set_keygen(RSA_METHOD *rsa, - int (*keygen) (RSA *rsa, int bits, BIGNUM *e, - BN_GENCB *cb)); + int (*keygen)(RSA *rsa, int bits, BIGNUM *e, + BN_GENCB *cb)); =head1 DESCRIPTION diff --git a/doc/man3/RSA_new.pod b/doc/man3/RSA_new.pod index 3317920741..d57fe826d1 100644 --- a/doc/man3/RSA_new.pod +++ b/doc/man3/RSA_new.pod @@ -8,7 +8,7 @@ RSA_new, RSA_free - allocate and free RSA objects #include - RSA * RSA_new(void); + RSA *RSA_new(void); void RSA_free(RSA *rsa); diff --git a/doc/man3/RSA_padding_add_PKCS1_type_1.pod b/doc/man3/RSA_padding_add_PKCS1_type_1.pod index 30899440ad..52ca15a72c 100644 --- a/doc/man3/RSA_padding_add_PKCS1_type_1.pod +++ b/doc/man3/RSA_padding_add_PKCS1_type_1.pod @@ -14,34 +14,35 @@ padding #include int RSA_padding_add_PKCS1_type_1(unsigned char *to, int tlen, - unsigned char *f, int fl); + unsigned char *f, int fl); int RSA_padding_check_PKCS1_type_1(unsigned char *to, int tlen, - unsigned char *f, int fl, int rsa_len); + unsigned char *f, int fl, int rsa_len); int RSA_padding_add_PKCS1_type_2(unsigned char *to, int tlen, - unsigned char *f, int fl); + unsigned char *f, int fl); int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen, - unsigned char *f, int fl, int rsa_len); + unsigned char *f, int fl, int rsa_len); int RSA_padding_add_PKCS1_OAEP(unsigned char *to, int tlen, - unsigned char *f, int fl, unsigned char *p, int pl); + unsigned char *f, int fl, unsigned char *p, int pl); int RSA_padding_check_PKCS1_OAEP(unsigned char *to, int tlen, - unsigned char *f, int fl, int rsa_len, unsigned char *p, int pl); + unsigned char *f, int fl, int rsa_len, + unsigned char *p, int pl); int RSA_padding_add_SSLv23(unsigned char *to, int tlen, - unsigned char *f, int fl); + unsigned char *f, int fl); int RSA_padding_check_SSLv23(unsigned char *to, int tlen, - unsigned char *f, int fl, int rsa_len); + unsigned char *f, int fl, int rsa_len); int RSA_padding_add_none(unsigned char *to, int tlen, - unsigned char *f, int fl); + unsigned char *f, int fl); int RSA_padding_check_none(unsigned char *to, int tlen, - unsigned char *f, int fl, int rsa_len); + unsigned char *f, int fl, int rsa_len); =head1 DESCRIPTION diff --git a/doc/man3/RSA_private_encrypt.pod b/doc/man3/RSA_private_encrypt.pod index 1eb7a0adbd..060a9000f8 100644 --- a/doc/man3/RSA_private_encrypt.pod +++ b/doc/man3/RSA_private_encrypt.pod @@ -8,11 +8,11 @@ RSA_private_encrypt, RSA_public_decrypt - low level signature operations #include - int RSA_private_encrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); + int RSA_private_encrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding); - int RSA_public_decrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); + int RSA_public_decrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding); =head1 DESCRIPTION diff --git a/doc/man3/RSA_public_encrypt.pod b/doc/man3/RSA_public_encrypt.pod index 182d2cfdda..a495ecdf76 100644 --- a/doc/man3/RSA_public_encrypt.pod +++ b/doc/man3/RSA_public_encrypt.pod @@ -8,11 +8,11 @@ RSA_public_encrypt, RSA_private_decrypt - RSA public key cryptography #include - int RSA_public_encrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); + int RSA_public_encrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding); - int RSA_private_decrypt(int flen, const unsigned char *from, - unsigned char *to, RSA *rsa, int padding); + int RSA_private_decrypt(int flen, unsigned char *from, + unsigned char *to, RSA *rsa, int padding); =head1 DESCRIPTION diff --git a/doc/man3/RSA_sign.pod b/doc/man3/RSA_sign.pod index fbb38d811c..310abd4901 100644 --- a/doc/man3/RSA_sign.pod +++ b/doc/man3/RSA_sign.pod @@ -9,10 +9,10 @@ RSA_sign, RSA_verify - RSA signatures #include int RSA_sign(int type, const unsigned char *m, unsigned int m_len, - unsigned char *sigret, unsigned int *siglen, RSA *rsa); + unsigned char *sigret, unsigned int *siglen, RSA *rsa); int RSA_verify(int type, const unsigned char *m, unsigned int m_len, - unsigned char *sigbuf, unsigned int siglen, RSA *rsa); + unsigned char *sigbuf, unsigned int siglen, RSA *rsa); =head1 DESCRIPTION diff --git a/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod b/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod index fb3fa2593a..f577e153d6 100644 --- a/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod +++ b/doc/man3/RSA_sign_ASN1_OCTET_STRING.pod @@ -9,12 +9,12 @@ RSA_sign_ASN1_OCTET_STRING, RSA_verify_ASN1_OCTET_STRING - RSA signatures #include int RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m, - unsigned int m_len, unsigned char *sigret, unsigned int *siglen, - RSA *rsa); + unsigned int m_len, unsigned char *sigret, + unsigned int *siglen, RSA *rsa); int RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m, - unsigned int m_len, unsigned char *sigbuf, unsigned int siglen, - RSA *rsa); + unsigned int m_len, unsigned char *sigbuf, + unsigned int siglen, RSA *rsa); =head1 DESCRIPTION diff --git a/doc/man3/SHA256_Init.pod b/doc/man3/SHA256_Init.pod index f3565bb2f4..6a8f2fa0db 100644 --- a/doc/man3/SHA256_Init.pod +++ b/doc/man3/SHA256_Init.pod @@ -15,31 +15,31 @@ SHA512_Final - Secure Hash Algorithm int SHA1_Update(SHA_CTX *c, const void *data, size_t len); int SHA1_Final(unsigned char *md, SHA_CTX *c); unsigned char *SHA1(const unsigned char *d, size_t n, - unsigned char *md); + unsigned char *md); int SHA224_Init(SHA256_CTX *c); int SHA224_Update(SHA256_CTX *c, const void *data, size_t len); int SHA224_Final(unsigned char *md, SHA256_CTX *c); unsigned char *SHA224(const unsigned char *d, size_t n, - unsigned char *md); + unsigned char *md); int SHA256_Init(SHA256_CTX *c); int SHA256_Update(SHA256_CTX *c, const void *data, size_t len); int SHA256_Final(unsigned char *md, SHA256_CTX *c); unsigned char *SHA256(const unsigned char *d, size_t n, - unsigned char *md); + unsigned char *md); int SHA384_Init(SHA512_CTX *c); int SHA384_Update(SHA512_CTX *c, const void *data, size_t len); int SHA384_Final(unsigned char *md, SHA512_CTX *c); unsigned char *SHA384(const unsigned char *d, size_t n, - unsigned char *md); + unsigned char *md); int SHA512_Init(SHA512_CTX *c); int SHA512_Update(SHA512_CTX *c, const void *data, size_t len); int SHA512_Final(unsigned char *md, SHA512_CTX *c); unsigned char *SHA512(const unsigned char *d, size_t n, - unsigned char *md); + unsigned char *md); =head1 DESCRIPTION diff --git a/doc/man3/SSL_CTX_sess_set_get_cb.pod b/doc/man3/SSL_CTX_sess_set_get_cb.pod index 65f1e4e7c5..109ca6abe0 100644 --- a/doc/man3/SSL_CTX_sess_set_get_cb.pod +++ b/doc/man3/SSL_CTX_sess_set_get_cb.pod @@ -11,18 +11,20 @@ SSL_CTX_sess_set_new_cb, SSL_CTX_sess_set_remove_cb, SSL_CTX_sess_set_get_cb, SS void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx, int (*new_session_cb)(SSL *, SSL_SESSION *)); void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx, - void (*remove_session_cb)(SSL_CTX *ctx, SSL_SESSION *)); + void (*remove_session_cb)(SSL_CTX *ctx, + SSL_SESSION *)); void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx, - SSL_SESSION (*get_session_cb)(SSL *, const unsigned char *, int, int *)); - - int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl, SSL_SESSION *sess); - void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(struct ssl_ctx_st *ctx, SSL_SESSION *sess); - SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl, const unsigned char *data, int len, int *copy); - - int (*new_session_cb)(struct ssl_st *ssl, SSL_SESSION *sess); - void (*remove_session_cb)(struct ssl_ctx_st *ctx, SSL_SESSION *sess); - SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, unsigned char *data, - int len, int *copy); + SSL_SESSION (*get_session_cb)(SSL *, + const unsigned char *, + int, int *)); + + int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx))(struct ssl_st *ssl, + SSL_SESSION *sess); + void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx))(struct ssl_ctx_st *ctx, + SSL_SESSION *sess); + SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx))(struct ssl_st *ssl, + const unsigned char *data, + int len, int *copy); =head1 DESCRIPTION diff --git a/doc/man3/SSL_CTX_set_cert_cb.pod b/doc/man3/SSL_CTX_set_cert_cb.pod index 87e1b78b2a..d14b9ebe5c 100644 --- a/doc/man3/SSL_CTX_set_cert_cb.pod +++ b/doc/man3/SSL_CTX_set_cert_cb.pod @@ -8,7 +8,8 @@ SSL_CTX_set_cert_cb, SSL_set_cert_cb - handle certificate callback function #include - void SSL_CTX_set_cert_cb(SSL_CTX *c, int (*cert_cb)(SSL *ssl, void *arg), void *arg); + void SSL_CTX_set_cert_cb(SSL_CTX *c, int (*cert_cb)(SSL *ssl, void *arg), + void *arg); void SSL_set_cert_cb(SSL *s, int (*cert_cb)(SSL *ssl, void *arg), void *arg); int (*cert_cb)(SSL *ssl, void *arg); diff --git a/doc/man3/SSL_CTX_set_cert_verify_callback.pod b/doc/man3/SSL_CTX_set_cert_verify_callback.pod index 99021ae3f0..3bf5583d0d 100644 --- a/doc/man3/SSL_CTX_set_cert_verify_callback.pod +++ b/doc/man3/SSL_CTX_set_cert_verify_callback.pod @@ -8,7 +8,9 @@ SSL_CTX_set_cert_verify_callback - set peer certificate verification procedure #include - void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*callback)(X509_STORE_CTX *, void *), void *arg); + void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, + int (*callback)(X509_STORE_CTX *, void *), + void *arg); =head1 DESCRIPTION diff --git a/doc/man3/SSL_CTX_set_client_cert_cb.pod b/doc/man3/SSL_CTX_set_client_cert_cb.pod index 982b6f90f4..0902dac147 100644 --- a/doc/man3/SSL_CTX_set_client_cert_cb.pod +++ b/doc/man3/SSL_CTX_set_client_cert_cb.pod @@ -8,8 +8,11 @@ SSL_CTX_set_client_cert_cb, SSL_CTX_get_client_cert_cb - handle client certifica #include - void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey)); - int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, EVP_PKEY **pkey); + void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx, + int (*client_cert_cb)(SSL *ssl, X509 **x509, + EVP_PKEY **pkey)); + int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx))(SSL *ssl, X509 **x509, + EVP_PKEY **pkey); int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey); =head1 DESCRIPTION diff --git a/doc/man3/SSL_CTX_set_generate_session_id.pod b/doc/man3/SSL_CTX_set_generate_session_id.pod index 90f768da47..2bee351a4d 100644 --- a/doc/man3/SSL_CTX_set_generate_session_id.pod +++ b/doc/man3/SSL_CTX_set_generate_session_id.pod @@ -94,6 +94,7 @@ server id given, and will fill the rest with pseudo random bytes: unsigned int *id_len) { unsigned int count = 0; + do { RAND_pseudo_bytes(id, *id_len); /* diff --git a/doc/man3/SSL_CTX_set_min_proto_version.pod b/doc/man3/SSL_CTX_set_min_proto_version.pod index 5996d48fe3..a22c3f5931 100644 --- a/doc/man3/SSL_CTX_set_min_proto_version.pod +++ b/doc/man3/SSL_CTX_set_min_proto_version.pod @@ -12,6 +12,7 @@ and maximum supported protocol version int SSL_CTX_set_min_proto_version(SSL_CTX *ctx, int version); int SSL_CTX_set_max_proto_version(SSL_CTX *ctx, int version); + int SSL_set_min_proto_version(SSL *ssl, int version); int SSL_set_max_proto_version(SSL *ssl, int version); diff --git a/doc/man3/SSL_CTX_set_msg_callback.pod b/doc/man3/SSL_CTX_set_msg_callback.pod index b3e8a4fd4c..6c360c6ed7 100644 --- a/doc/man3/SSL_CTX_set_msg_callback.pod +++ b/doc/man3/SSL_CTX_set_msg_callback.pod @@ -12,10 +12,16 @@ SSL_set_msg_callback_arg #include - void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); + void SSL_CTX_set_msg_callback(SSL_CTX *ctx, + void (*cb)(int write_p, int version, + int content_type, const void *buf, + size_t len, SSL *ssl, void *arg)); void SSL_CTX_set_msg_callback_arg(SSL_CTX *ctx, void *arg); - void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg)); + void SSL_set_msg_callback(SSL *ssl, + void (*cb)(int write_p, int version, + int content_type, const void *buf, + size_t len, SSL *ssl, void *arg)); void SSL_set_msg_callback_arg(SSL *ssl, void *arg); =head1 DESCRIPTION diff --git a/doc/man3/SSL_CTX_set_psk_client_callback.pod b/doc/man3/SSL_CTX_set_psk_client_callback.pod index a4175081c5..e7080eb799 100644 --- a/doc/man3/SSL_CTX_set_psk_client_callback.pod +++ b/doc/man3/SSL_CTX_set_psk_client_callback.pod @@ -9,13 +9,13 @@ SSL_CTX_set_psk_client_callback, SSL_set_psk_client_callback - set PSK client ca #include void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx, - unsigned int (*callback)(SSL *ssl, const char *hint, - char *identity, unsigned int max_identity_len, - unsigned char *psk, unsigned int max_psk_len)); + unsigned int (*callback)(SSL *ssl, const char *hint, + char *identity, unsigned int max_identity_len, + unsigned char *psk, unsigned int max_psk_len)); void SSL_set_psk_client_callback(SSL *ssl, - unsigned int (*callback)(SSL *ssl, const char *hint, - char *identity, unsigned int max_identity_len, - unsigned char *psk, unsigned int max_psk_len)); + unsigned int (*callback)(SSL *ssl, const char *hint, + char *identity, unsigned int max_identity_len, + unsigned char *psk, unsigned int max_psk_len)); =head1 DESCRIPTION diff --git a/doc/man3/SSL_CTX_set_security_level.pod b/doc/man3/SSL_CTX_set_security_level.pod index 361330697d..48a5240843 100644 --- a/doc/man3/SSL_CTX_set_security_level.pod +++ b/doc/man3/SSL_CTX_set_security_level.pod @@ -15,15 +15,20 @@ SSL_CTX_set_security_level, SSL_set_security_level, SSL_CTX_get_security_level, int SSL_get_security_level(const SSL *s); void SSL_CTX_set_security_callback(SSL_CTX *ctx, - int (*cb)(SSL *s, SSL_CTX *ctx, int op, int bits, int nid, - void *other, void *ex)); - - void SSL_set_security_callback(SSL *s, - int (*cb)(SSL *s, SSL_CTX *ctx, int op, int bits, int nid, - void *other, void *ex)); - - int (*SSL_CTX_get_security_callback(const SSL_CTX *ctx))(SSL *s, SSL_CTX *ctx, int op, int bits, int nid, void *other, void *ex); - int (*SSL_get_security_callback(const SSL *s))(SSL *s, SSL_CTX *ctx, int op, int bits, int nid, void *other, void *ex); + int (*cb)(SSL *s, SSL_CTX *ctx, int op, + int bits, int nid, + void *other, void *ex)); + + void SSL_set_security_callback(SSL *s, int (*cb)(SSL *s, SSL_CTX *ctx, int op, + int bits, int nid, + void *other, void *ex)); + + int (*SSL_CTX_get_security_callback(const SSL_CTX *ctx))(SSL *s, SSL_CTX *ctx, int op, + int bits, int nid, void *other, + void *ex); + int (*SSL_get_security_callback(const SSL *s))(SSL *s, SSL_CTX *ctx, int op, + int bits, int nid, void *other, + void *ex); void SSL_CTX_set0_security_ex_data(SSL_CTX *ctx, void *ex); void SSL_set0_security_ex_data(SSL *s, void *ex); diff --git a/doc/man3/SSL_CTX_set_tlsext_status_cb.pod b/doc/man3/SSL_CTX_set_tlsext_status_cb.pod index c12ff0e587..d6c04eced8 100644 --- a/doc/man3/SSL_CTX_set_tlsext_status_cb.pod +++ b/doc/man3/SSL_CTX_set_tlsext_status_cb.pod @@ -18,10 +18,8 @@ SSL_set_tlsext_status_ocsp_resp #include - long SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, - int (*callback)(SSL *, void *)); - long SSL_CTX_get_tlsext_status_cb(SSL_CTX *ctx, - int (**callback)(SSL *, void *)); + long SSL_CTX_set_tlsext_status_cb(SSL_CTX *ctx, int (*callback)(SSL *, void *)); + long SSL_CTX_get_tlsext_status_cb(SSL_CTX *ctx, int (**callback)(SSL *, void *)); long SSL_CTX_set_tlsext_status_arg(SSL_CTX *ctx, void *arg); long SSL_CTX_get_tlsext_status_arg(SSL_CTX *ctx, void **arg); diff --git a/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod b/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod index 5c11089acd..3cf0717d2a 100644 --- a/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod +++ b/doc/man3/SSL_CTX_set_tlsext_ticket_key_cb.pod @@ -9,9 +9,9 @@ SSL_CTX_set_tlsext_ticket_key_cb - set a callback for session ticket processing #include long SSL_CTX_set_tlsext_ticket_key_cb(SSL_CTX sslctx, - int (*cb)(SSL *s, unsigned char key_name[16], - unsigned char iv[EVP_MAX_IV_LENGTH], - EVP_CIPHER_CTX *ctx, HMAC_CTX *hctx, int enc)); + int (*cb)(SSL *s, unsigned char key_name[16], + unsigned char iv[EVP_MAX_IV_LENGTH], + EVP_CIPHER_CTX *ctx, HMAC_CTX *hctx, int enc)); =head1 DESCRIPTION diff --git a/doc/man3/SSL_CTX_set_tmp_dh_callback.pod b/doc/man3/SSL_CTX_set_tmp_dh_callback.pod index a0f74572ed..76c61f8743 100644 --- a/doc/man3/SSL_CTX_set_tmp_dh_callback.pod +++ b/doc/man3/SSL_CTX_set_tmp_dh_callback.pod @@ -9,11 +9,13 @@ SSL_CTX_set_tmp_dh_callback, SSL_CTX_set_tmp_dh, SSL_set_tmp_dh_callback, SSL_se #include void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, - DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength)); + DH *(*tmp_dh_callback)(SSL *ssl, int is_export, + int keylength)); long SSL_CTX_set_tmp_dh(SSL_CTX *ctx, DH *dh); void SSL_set_tmp_dh_callback(SSL *ctx, - DH *(*tmp_dh_callback)(SSL *ssl, int is_export, int keylength)); + DH *(*tmp_dh_callback)(SSL *ssl, int is_export, + int keylength)); long SSL_set_tmp_dh(SSL *ssl, DH *dh) =head1 DESCRIPTION @@ -91,10 +93,9 @@ Command-line parameter generation: Code for setting up parameters during server initialization: SSL_CTX ctx = SSL_CTX_new(); - DH *dh_2048 = NULL; - FILE *paramfile; - paramfile = fopen("dh_param_2048.pem", "r"); + FILE *paramfile = fopen("dh_param_2048.pem", "r"); + if (paramfile) { dh_2048 = PEM_read_DHparams(paramfile, NULL, NULL, NULL); fclose(paramfile); diff --git a/doc/man3/SSL_CTX_use_psk_identity_hint.pod b/doc/man3/SSL_CTX_use_psk_identity_hint.pod index 753074a720..c1ee5ed767 100644 --- a/doc/man3/SSL_CTX_use_psk_identity_hint.pod +++ b/doc/man3/SSL_CTX_use_psk_identity_hint.pod @@ -14,11 +14,15 @@ identity hint to use int SSL_use_psk_identity_hint(SSL *ssl, const char *hint); void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx, - unsigned int (*callback)(SSL *ssl, const char *identity, - unsigned char *psk, int max_psk_len)); + unsigned int (*callback)(SSL *ssl, + const char *identity, + unsigned char *psk, + int max_psk_len)); void SSL_set_psk_server_callback(SSL *ssl, - unsigned int (*callback)(SSL *ssl, const char *identity, - unsigned char *psk, int max_psk_len)); + unsigned int (*callback)(SSL *ssl, + const char *identity, + unsigned char *psk, + int max_psk_len)); =head1 DESCRIPTION diff --git a/doc/man3/SSL_get_client_random.pod b/doc/man3/SSL_get_client_random.pod index 701207667e..7f4e753582 100644 --- a/doc/man3/SSL_get_client_random.pod +++ b/doc/man3/SSL_get_client_random.pod @@ -10,7 +10,8 @@ SSL_get_client_random, SSL_get_server_random, SSL_SESSION_get_master_key - retri size_t SSL_get_client_random(const SSL *ssl, unsigned char *out, size_t outlen); size_t SSL_get_server_random(const SSL *ssl, unsigned char *out, size_t outlen); - size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, unsigned char *out, size_t outlen); + size_t SSL_SESSION_get_master_key(const SSL_SESSION *session, + unsigned char *out, size_t outlen); =head1 DESCRIPTION diff --git a/doc/man3/SSL_get_psk_identity.pod b/doc/man3/SSL_get_psk_identity.pod index d330eee52d..5cd406c353 100644 --- a/doc/man3/SSL_get_psk_identity.pod +++ b/doc/man3/SSL_get_psk_identity.pod @@ -11,7 +11,6 @@ SSL_get_psk_identity, SSL_get_psk_identity_hint - get PSK client identity and hi const char *SSL_get_psk_identity_hint(const SSL *ssl); const char *SSL_get_psk_identity(const SSL *ssl); - =head1 DESCRIPTION SSL_get_psk_identity_hint() is used to retrieve the PSK identity hint diff --git a/doc/man3/UI_new.pod b/doc/man3/UI_new.pod index 60a3fd672e..469ea53a32 100644 --- a/doc/man3/UI_new.pod +++ b/doc/man3/UI_new.pod @@ -22,19 +22,21 @@ UI_get_method, UI_set_method, UI_OpenSSL, UI_null - user interface void UI_free(UI *ui); int UI_add_input_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize); + char *result_buf, int minsize, int maxsize); int UI_dup_input_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize); + char *result_buf, int minsize, int maxsize); int UI_add_verify_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize, const char *test_buf); + char *result_buf, int minsize, int maxsize, + const char *test_buf); int UI_dup_verify_string(UI *ui, const char *prompt, int flags, - char *result_buf, int minsize, int maxsize, const char *test_buf); + char *result_buf, int minsize, int maxsize, + const char *test_buf); int UI_add_input_boolean(UI *ui, const char *prompt, const char *action_desc, - const char *ok_chars, const char *cancel_chars, - int flags, char *result_buf); + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); int UI_dup_input_boolean(UI *ui, const char *prompt, const char *action_desc, - const char *ok_chars, const char *cancel_chars, - int flags, char *result_buf); + const char *ok_chars, const char *cancel_chars, + int flags, char *result_buf); int UI_add_info_string(UI *ui, const char *text); int UI_dup_info_string(UI *ui, const char *text); int UI_add_error_string(UI *ui, const char *text); diff --git a/doc/man3/X509_LOOKUP_hash_dir.pod b/doc/man3/X509_LOOKUP_hash_dir.pod index 5f8dfa93b0..83703e2692 100644 --- a/doc/man3/X509_LOOKUP_hash_dir.pod +++ b/doc/man3/X509_LOOKUP_hash_dir.pod @@ -10,14 +10,14 @@ lookup methods =head1 SYNOPSIS - #include + #include - X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); - X509_LOOKUP_METHOD *X509_LOOKUP_file(void); + X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void); + X509_LOOKUP_METHOD *X509_LOOKUP_file(void); - int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); - int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); - int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); + int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type); + int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type); + int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type); =head1 DESCRIPTION diff --git a/doc/man3/X509_NAME_ENTRY_get_object.pod b/doc/man3/X509_NAME_ENTRY_get_object.pod index 72e0f7b11d..51d9385f84 100644 --- a/doc/man3/X509_NAME_ENTRY_get_object.pod +++ b/doc/man3/X509_NAME_ENTRY_get_object.pod @@ -11,15 +11,22 @@ X509_NAME_ENTRY_create_by_OBJ - X509_NAME_ENTRY utility functions #include - ASN1_OBJECT * X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne); - ASN1_STRING * X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne); + ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne); + ASN1_STRING *X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne); int X509_NAME_ENTRY_set_object(X509_NAME_ENTRY *ne, const ASN1_OBJECT *obj); - int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, const unsigned char *bytes, int len); - - X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field, int type, const unsigned char *bytes, int len); - X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, int type, const unsigned char *bytes, int len); - X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, const ASN1_OBJECT *obj, int type, const unsigned char *bytes, int len); + int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *ne, int type, + const unsigned char *bytes, int len); + + X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, const char *field, + int type, const unsigned char *bytes, + int len); + X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid, + int type, const unsigned char *bytes, + int len); + X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne, + const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len); =head1 DESCRIPTION diff --git a/doc/man3/X509_NAME_add_entry_by_txt.pod b/doc/man3/X509_NAME_add_entry_by_txt.pod index 9aa03659c0..b48f0908e8 100644 --- a/doc/man3/X509_NAME_add_entry_by_txt.pod +++ b/doc/man3/X509_NAME_add_entry_by_txt.pod @@ -9,11 +9,14 @@ X509_NAME_add_entry, X509_NAME_delete_entry - X509_NAME modification functions #include - int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, const unsigned char *bytes, int len, int loc, int set); + int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type, + const unsigned char *bytes, int len, int loc, int set); - int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type, const unsigned char *bytes, int len, int loc, int set); + int X509_NAME_add_entry_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int type, + const unsigned char *bytes, int len, int loc, int set); - int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, const unsigned char *bytes, int len, int loc, int set); + int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type, + const unsigned char *bytes, int len, int loc, int set); int X509_NAME_add_entry(X509_NAME *name, const X509_NAME_ENTRY *ne, int loc, int set); @@ -78,6 +81,7 @@ Create an B structure: "C=UK, O=Disorganized Organization, CN=Joe Bloggs" X509_NAME *nm; + nm = X509_NAME_new(); if (nm == NULL) /* Some error */ diff --git a/doc/man3/X509_NAME_print_ex.pod b/doc/man3/X509_NAME_print_ex.pod index 3e9caa889c..e59512dc58 100644 --- a/doc/man3/X509_NAME_print_ex.pod +++ b/doc/man3/X509_NAME_print_ex.pod @@ -11,7 +11,7 @@ X509_NAME_oneline - X509_NAME printing routines int X509_NAME_print_ex(BIO *out, const X509_NAME *nm, int indent, unsigned long flags); int X509_NAME_print_ex_fp(FILE *fp, const X509_NAME *nm, int indent, unsigned long flags); - char * X509_NAME_oneline(const X509_NAME *a, char *buf, int size); + char *X509_NAME_oneline(const X509_NAME *a, char *buf, int size); int X509_NAME_print(BIO *bp, const X509_NAME *name, int obase); =head1 DESCRIPTION diff --git a/doc/man3/X509_STORE_CTX_set_verify_cb.pod b/doc/man3/X509_STORE_CTX_set_verify_cb.pod index f8e5501bbc..5688ab79a7 100644 --- a/doc/man3/X509_STORE_CTX_set_verify_cb.pod +++ b/doc/man3/X509_STORE_CTX_set_verify_cb.pod @@ -122,6 +122,7 @@ expired just one specific case: { int err = X509_STORE_CTX_get_error(ctx); X509 *err_cert = X509_STORE_CTX_get_current_cert(ctx); + if (err == X509_V_ERR_CERT_HAS_EXPIRED) { if (check_is_acceptable_expired_cert(err_cert) return 1; diff --git a/doc/man3/X509_VERIFY_PARAM_set_flags.pod b/doc/man3/X509_VERIFY_PARAM_set_flags.pod index 2ea4895338..e8428e1c57 100644 --- a/doc/man3/X509_VERIFY_PARAM_set_flags.pod +++ b/doc/man3/X509_VERIFY_PARAM_set_flags.pod @@ -37,15 +37,15 @@ X509_VERIFY_PARAM_set1_ip_asc time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param); int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param, - ASN1_OBJECT *policy); + ASN1_OBJECT *policy); int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param, - STACK_OF(ASN1_OBJECT) *policies); + STACK_OF(ASN1_OBJECT) *policies); void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth); int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param); void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, - int auth_level); + int auth_level); int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param); int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param, @@ -56,7 +56,7 @@ X509_VERIFY_PARAM_set1_ip_asc unsigned int flags); char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param); int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param, - const char *email, size_t emaillen); + const char *email, size_t emaillen); int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param, const unsigned char *ip, size_t iplen); int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc); @@ -311,6 +311,7 @@ Enable CRL checking when performing certificate verification during SSL connections associated with an B structure B: X509_VERIFY_PARAM *param; + param = X509_VERIFY_PARAM_new(); X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK); SSL_CTX_set1_param(ctx, param); diff --git a/doc/man3/X509_check_ca.pod b/doc/man3/X509_check_ca.pod index b79efb5b5a..0954055dda 100644 --- a/doc/man3/X509_check_ca.pod +++ b/doc/man3/X509_check_ca.pod @@ -6,9 +6,9 @@ X509_check_ca - check if given certificate is CA certificate =head1 SYNOPSIS - #include + #include - int X509_check_ca(X509 *cert); + int X509_check_ca(X509 *cert); =head1 DESCRIPTION diff --git a/doc/man3/X509_digest.pod b/doc/man3/X509_digest.pod index 3c76c8fdfa..ee393450f1 100644 --- a/doc/man3/X509_digest.pod +++ b/doc/man3/X509_digest.pod @@ -17,7 +17,7 @@ PKCS7_ISSUER_AND_SERIAL_digest unsigned int *len); int X509_CRL_digest(const X509_CRL *data, const EVP_MD *type, unsigned char *md, - unsigned int *len); + unsigned int *len); int X509_pubkey_digest(const X509 *data, const EVP_MD *type, unsigned char *md, unsigned int *len); diff --git a/doc/man3/X509_get_extension_flags.pod b/doc/man3/X509_get_extension_flags.pod index c78e4573c3..8742d4735a 100644 --- a/doc/man3/X509_get_extension_flags.pod +++ b/doc/man3/X509_get_extension_flags.pod @@ -13,16 +13,16 @@ X509_get_proxy_pathlen - retrieve certificate extension data =head1 SYNOPSIS - #include - - long X509_get_pathlen(X509 *x); - uint32_t X509_get_extension_flags(X509 *x); - uint32_t X509_get_key_usage(X509 *x); - uint32_t X509_get_extended_key_usage(X509 *x); - const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x); - void X509_set_proxy_flag(X509 *x); - void X509_set_proxy_pathlen(int l); - long X509_get_proxy_pathlen(X509 *x); + #include + + long X509_get_pathlen(X509 *x); + uint32_t X509_get_extension_flags(X509 *x); + uint32_t X509_get_key_usage(X509 *x); + uint32_t X509_get_extended_key_usage(X509 *x); + const ASN1_OCTET_STRING *X509_get0_subject_key_id(X509 *x); + void X509_set_proxy_flag(X509 *x); + void X509_set_proxy_pathlen(int l); + long X509_get_proxy_pathlen(X509 *x); =head1 DESCRIPTION diff --git a/doc/man3/X509v3_get_ext_by_NID.pod b/doc/man3/X509v3_get_ext_by_NID.pod index 032f71c494..81c938e95d 100644 --- a/doc/man3/X509v3_get_ext_by_NID.pod +++ b/doc/man3/X509v3_get_ext_by_NID.pod @@ -50,7 +50,7 @@ X509_REVOKED_add_ext - extension stack utility functions X509_EXTENSION *X509_REVOKED_get_ext(const X509_REVOKED *x, int loc); int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos); int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj, - int lastpos); + int lastpos); int X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit, int lastpos); X509_EXTENSION *X509_REVOKED_delete_ext(X509_REVOKED *x, int loc); int X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc); diff --git a/doc/man3/d2i_PKCS8PrivateKey_bio.pod b/doc/man3/d2i_PKCS8PrivateKey_bio.pod index 164d93ff4f..03aa218e0a 100644 --- a/doc/man3/d2i_PKCS8PrivateKey_bio.pod +++ b/doc/man3/d2i_PKCS8PrivateKey_bio.pod @@ -14,20 +14,20 @@ i2d_PKCS8PrivateKey_nid_bio, i2d_PKCS8PrivateKey_nid_fp - PKCS#8 format private EVP_PKEY *d2i_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY **x, pem_password_cb *cb, void *u); int i2d_PKCS8PrivateKey_bio(BIO *bp, EVP_PKEY *x, const EVP_CIPHER *enc, - char *kstr, int klen, - pem_password_cb *cb, void *u); + char *kstr, int klen, + pem_password_cb *cb, void *u); int i2d_PKCS8PrivateKey_fp(FILE *fp, EVP_PKEY *x, const EVP_CIPHER *enc, - char *kstr, int klen, - pem_password_cb *cb, void *u); + char *kstr, int klen, + pem_password_cb *cb, void *u); int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); + char *kstr, int klen, + pem_password_cb *cb, void *u); int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, EVP_PKEY *x, int nid, - char *kstr, int klen, - pem_password_cb *cb, void *u); + char *kstr, int klen, + pem_password_cb *cb, void *u); =head1 DESCRIPTION diff --git a/doc/man3/d2i_SSL_SESSION.pod b/doc/man3/d2i_SSL_SESSION.pod index d300ff2b28..68ed302d73 100644 --- a/doc/man3/d2i_SSL_SESSION.pod +++ b/doc/man3/d2i_SSL_SESSION.pod @@ -8,7 +8,8 @@ d2i_SSL_SESSION, i2d_SSL_SESSION - convert SSL_SESSION object from/to ASN1 repre #include - SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, long length); + SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, + long length); int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp); =head1 DESCRIPTION diff --git a/doc/man3/o2i_SCT_LIST.pod b/doc/man3/o2i_SCT_LIST.pod index f0f3df31fb..28989387ed 100644 --- a/doc/man3/o2i_SCT_LIST.pod +++ b/doc/man3/o2i_SCT_LIST.pod @@ -9,7 +9,8 @@ decode and encode Signed Certificate Timestamp lists in TLS wire format #include - STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, size_t len); + STACK_OF(SCT) *o2i_SCT_LIST(STACK_OF(SCT) **a, const unsigned char **pp, + size_t len); int i2o_SCT_LIST(const STACK_OF(SCT) *a, unsigned char **pp); SCT *o2i_SCT(SCT **psct, const unsigned char **in, size_t len); int i2o_SCT(const SCT *sct, unsigned char **out); -- 2.25.1