merge conflicts, regen man pages.
This commit is contained in:
parent
3f3c3d73c1
commit
4261787c4e
|
@ -7,6 +7,77 @@
|
|||
https://github.com/openssl/openssl/commits/ and pick the appropriate
|
||||
release branch.
|
||||
|
||||
Changes between 1.1.1b and 1.1.1c [28 May 2019]
|
||||
|
||||
*) Add build tests for C++. These are generated files that only do one
|
||||
thing, to include one public OpenSSL head file each. This tests that
|
||||
the public header files can be usefully included in a C++ application.
|
||||
|
||||
This test isn't enabled by default. It can be enabled with the option
|
||||
'enable-buildtest-c++'.
|
||||
[Richard Levitte]
|
||||
|
||||
*) Enable SHA3 pre-hashing for ECDSA and DSA.
|
||||
[Patrick Steuer]
|
||||
|
||||
*) Change the default RSA, DSA and DH size to 2048 bit instead of 1024.
|
||||
This changes the size when using the genpkey app when no size is given. It
|
||||
fixes an omission in earlier changes that changed all RSA, DSA and DH
|
||||
generation apps to use 2048 bits by default.
|
||||
[Kurt Roeckx]
|
||||
|
||||
*) Reorganize the manual pages to consistently have RETURN VALUES,
|
||||
EXAMPLES, SEE ALSO and HISTORY come in that order, and adjust
|
||||
util/fix-doc-nits accordingly.
|
||||
[Paul Yang, Joshua Lock]
|
||||
|
||||
*) Add the missing accessor EVP_PKEY_get0_engine()
|
||||
[Matt Caswell]
|
||||
|
||||
*) Have apps like 's_client' and 's_server' output the signature scheme
|
||||
along with other cipher suite parameters when debugging.
|
||||
[Lorinczy Zsigmond]
|
||||
|
||||
*) Make OPENSSL_config() error agnostic again.
|
||||
[Richard Levitte]
|
||||
|
||||
*) Do the error handling in RSA decryption constant time.
|
||||
[Bernd Edlinger]
|
||||
|
||||
*) Prevent over long nonces in ChaCha20-Poly1305.
|
||||
|
||||
ChaCha20-Poly1305 is an AEAD cipher, and requires a unique nonce input
|
||||
for every encryption operation. RFC 7539 specifies that the nonce value
|
||||
(IV) should be 96 bits (12 bytes). OpenSSL allows a variable nonce length
|
||||
and front pads the nonce with 0 bytes if it is less than 12
|
||||
bytes. However it also incorrectly allows a nonce to be set of up to 16
|
||||
bytes. In this case only the last 12 bytes are significant and any
|
||||
additional leading bytes are ignored.
|
||||
|
||||
It is a requirement of using this cipher that nonce values are
|
||||
unique. Messages encrypted using a reused nonce value are susceptible to
|
||||
serious confidentiality and integrity attacks. If an application changes
|
||||
the default nonce length to be longer than 12 bytes and then makes a
|
||||
change to the leading bytes of the nonce expecting the new value to be a
|
||||
new unique nonce then such an application could inadvertently encrypt
|
||||
messages with a reused nonce.
|
||||
|
||||
Additionally the ignored bytes in a long nonce are not covered by the
|
||||
integrity guarantee of this cipher. Any application that relies on the
|
||||
integrity of these ignored leading bytes of a long nonce may be further
|
||||
affected. Any OpenSSL internal use of this cipher, including in SSL/TLS,
|
||||
is safe because no such use sets such a long nonce value. However user
|
||||
applications that use this cipher directly and set a non-default nonce
|
||||
length to be longer than 12 bytes may be vulnerable.
|
||||
|
||||
This issue was reported to OpenSSL on 16th of March 2019 by Joran Dirk
|
||||
Greef of Ronomon.
|
||||
(CVE-2019-1543)
|
||||
[Matt Caswell]
|
||||
|
||||
*) Ensure that SM2 only uses SM3 as digest algorithm
|
||||
[Paul Yang]
|
||||
|
||||
Changes between 1.1.1a and 1.1.1b [26 Feb 2019]
|
||||
|
||||
*) Added SCA hardening for modular field inversion in EC_GROUP through
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -5,6 +5,10 @@
|
|||
This file gives a brief overview of the major changes between each OpenSSL
|
||||
release. For more details please read the CHANGES file.
|
||||
|
||||
Major changes between OpenSSL 1.1.1b and OpenSSL 1.1.1c [28 May 2019]
|
||||
|
||||
o Prevent over long nonces in ChaCha20-Poly1305 (CVE-2019-1543)
|
||||
|
||||
Major changes between OpenSSL 1.1.1a and OpenSSL 1.1.1b [26 Feb 2019]
|
||||
|
||||
o Change the info callback signals for the start and end of a post-handshake
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
OpenSSL 1.1.1b 26 Feb 2019
|
||||
OpenSSL 1.1.1c 28 May 2019
|
||||
|
||||
Copyright (c) 1998-2018 The OpenSSL Project
|
||||
Copyright (c) 1998-2019 The OpenSSL Project
|
||||
Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson
|
||||
All rights reserved.
|
||||
|
||||
|
|
|
@ -641,8 +641,10 @@ redo_accept:
|
|||
goto end;
|
||||
}
|
||||
|
||||
if (req != NULL && add_nonce)
|
||||
OCSP_request_add1_nonce(req, NULL, -1);
|
||||
if (req != NULL && add_nonce) {
|
||||
if (!OCSP_request_add1_nonce(req, NULL, -1))
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (signfile != NULL) {
|
||||
if (keyfile == NULL)
|
||||
|
@ -1245,7 +1247,10 @@ static void make_ocsp_response(BIO *err, OCSP_RESPONSE **resp, OCSP_REQUEST *req
|
|||
goto end;
|
||||
}
|
||||
}
|
||||
OCSP_basic_sign_ctx(bs, rcert, mctx, rother, flags);
|
||||
if (!OCSP_basic_sign_ctx(bs, rcert, mctx, rother, flags)) {
|
||||
*resp = OCSP_response_create(OCSP_RESPONSE_STATUS_INTERNALERROR, bs);
|
||||
goto end;
|
||||
}
|
||||
|
||||
if (badsig) {
|
||||
const ASN1_OCTET_STRING *sig = OCSP_resp_get0_signature(bs);
|
||||
|
|
|
@ -2253,7 +2253,10 @@ int s_client_main(int argc, char **argv)
|
|||
do {
|
||||
mbuf_len = BIO_gets(fbio, mbuf, BUFSIZZ);
|
||||
}
|
||||
while (mbuf_len > 3 && mbuf[3] == '-');
|
||||
while (mbuf_len > 3 && (!isdigit((unsigned char)mbuf[0]) ||
|
||||
!isdigit((unsigned char)mbuf[1]) ||
|
||||
!isdigit((unsigned char)mbuf[2]) ||
|
||||
mbuf[3] != ' '));
|
||||
(void)BIO_flush(fbio);
|
||||
BIO_pop(fbio);
|
||||
BIO_free(fbio);
|
||||
|
|
|
@ -489,30 +489,35 @@ static const OPT_PAIR rsa_choices[] = {
|
|||
static double rsa_results[RSA_NUM][2]; /* 2 ops: sign then verify */
|
||||
#endif /* OPENSSL_NO_RSA */
|
||||
|
||||
#define R_EC_P160 0
|
||||
#define R_EC_P192 1
|
||||
#define R_EC_P224 2
|
||||
#define R_EC_P256 3
|
||||
#define R_EC_P384 4
|
||||
#define R_EC_P521 5
|
||||
#define R_EC_K163 6
|
||||
#define R_EC_K233 7
|
||||
#define R_EC_K283 8
|
||||
#define R_EC_K409 9
|
||||
#define R_EC_K571 10
|
||||
#define R_EC_B163 11
|
||||
#define R_EC_B233 12
|
||||
#define R_EC_B283 13
|
||||
#define R_EC_B409 14
|
||||
#define R_EC_B571 15
|
||||
#define R_EC_BRP256R1 16
|
||||
#define R_EC_BRP256T1 17
|
||||
#define R_EC_BRP384R1 18
|
||||
#define R_EC_BRP384T1 19
|
||||
#define R_EC_BRP512R1 20
|
||||
#define R_EC_BRP512T1 21
|
||||
#define R_EC_X25519 22
|
||||
#define R_EC_X448 23
|
||||
enum {
|
||||
R_EC_P160,
|
||||
R_EC_P192,
|
||||
R_EC_P224,
|
||||
R_EC_P256,
|
||||
R_EC_P384,
|
||||
R_EC_P521,
|
||||
#ifndef OPENSSL_NO_EC2M
|
||||
R_EC_K163,
|
||||
R_EC_K233,
|
||||
R_EC_K283,
|
||||
R_EC_K409,
|
||||
R_EC_K571,
|
||||
R_EC_B163,
|
||||
R_EC_B233,
|
||||
R_EC_B283,
|
||||
R_EC_B409,
|
||||
R_EC_B571,
|
||||
#endif
|
||||
R_EC_BRP256R1,
|
||||
R_EC_BRP256T1,
|
||||
R_EC_BRP384R1,
|
||||
R_EC_BRP384T1,
|
||||
R_EC_BRP512R1,
|
||||
R_EC_BRP512T1,
|
||||
R_EC_X25519,
|
||||
R_EC_X448
|
||||
};
|
||||
|
||||
#ifndef OPENSSL_NO_EC
|
||||
static OPT_PAIR ecdsa_choices[] = {
|
||||
{"ecdsap160", R_EC_P160},
|
||||
|
@ -521,6 +526,7 @@ static OPT_PAIR ecdsa_choices[] = {
|
|||
{"ecdsap256", R_EC_P256},
|
||||
{"ecdsap384", R_EC_P384},
|
||||
{"ecdsap521", R_EC_P521},
|
||||
# ifndef OPENSSL_NO_EC2M
|
||||
{"ecdsak163", R_EC_K163},
|
||||
{"ecdsak233", R_EC_K233},
|
||||
{"ecdsak283", R_EC_K283},
|
||||
|
@ -531,6 +537,7 @@ static OPT_PAIR ecdsa_choices[] = {
|
|||
{"ecdsab283", R_EC_B283},
|
||||
{"ecdsab409", R_EC_B409},
|
||||
{"ecdsab571", R_EC_B571},
|
||||
# endif
|
||||
{"ecdsabrp256r1", R_EC_BRP256R1},
|
||||
{"ecdsabrp256t1", R_EC_BRP256T1},
|
||||
{"ecdsabrp384r1", R_EC_BRP384R1},
|
||||
|
@ -549,6 +556,7 @@ static const OPT_PAIR ecdh_choices[] = {
|
|||
{"ecdhp256", R_EC_P256},
|
||||
{"ecdhp384", R_EC_P384},
|
||||
{"ecdhp521", R_EC_P521},
|
||||
# ifndef OPENSSL_NO_EC2M
|
||||
{"ecdhk163", R_EC_K163},
|
||||
{"ecdhk233", R_EC_K233},
|
||||
{"ecdhk283", R_EC_K283},
|
||||
|
@ -559,6 +567,7 @@ static const OPT_PAIR ecdh_choices[] = {
|
|||
{"ecdhb283", R_EC_B283},
|
||||
{"ecdhb409", R_EC_B409},
|
||||
{"ecdhb571", R_EC_B571},
|
||||
# endif
|
||||
{"ecdhbrp256r1", R_EC_BRP256R1},
|
||||
{"ecdhbrp256t1", R_EC_BRP256T1},
|
||||
{"ecdhbrp384r1", R_EC_BRP384R1},
|
||||
|
@ -1501,6 +1510,7 @@ int speed_main(int argc, char **argv)
|
|||
{"nistp256", NID_X9_62_prime256v1, 256},
|
||||
{"nistp384", NID_secp384r1, 384},
|
||||
{"nistp521", NID_secp521r1, 521},
|
||||
# ifndef OPENSSL_NO_EC2M
|
||||
/* Binary Curves */
|
||||
{"nistk163", NID_sect163k1, 163},
|
||||
{"nistk233", NID_sect233k1, 233},
|
||||
|
@ -1512,6 +1522,7 @@ int speed_main(int argc, char **argv)
|
|||
{"nistb283", NID_sect283r1, 283},
|
||||
{"nistb409", NID_sect409r1, 409},
|
||||
{"nistb571", NID_sect571r1, 571},
|
||||
# endif
|
||||
{"brainpoolP256r1", NID_brainpoolP256r1, 256},
|
||||
{"brainpoolP256t1", NID_brainpoolP256t1, 256},
|
||||
{"brainpoolP384r1", NID_brainpoolP384r1, 384},
|
||||
|
@ -2031,6 +2042,7 @@ int speed_main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
}
|
||||
# ifndef OPENSSL_NO_EC2M
|
||||
ecdsa_c[R_EC_K163][0] = count / 1000;
|
||||
ecdsa_c[R_EC_K163][1] = count / 1000 / 2;
|
||||
for (i = R_EC_K233; i <= R_EC_K571; i++) {
|
||||
|
@ -2059,6 +2071,7 @@ int speed_main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
}
|
||||
# endif
|
||||
|
||||
ecdh_c[R_EC_P160][0] = count / 1000;
|
||||
for (i = R_EC_P192; i <= R_EC_P521; i++) {
|
||||
|
@ -2071,6 +2084,7 @@ int speed_main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
}
|
||||
# ifndef OPENSSL_NO_EC2M
|
||||
ecdh_c[R_EC_K163][0] = count / 1000;
|
||||
for (i = R_EC_K233; i <= R_EC_K571; i++) {
|
||||
ecdh_c[i][0] = ecdh_c[i - 1][0] / 2;
|
||||
|
@ -2093,6 +2107,7 @@ int speed_main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
}
|
||||
# endif
|
||||
/* repeated code good to factorize */
|
||||
ecdh_c[R_EC_BRP256R1][0] = count / 1000;
|
||||
for (i = R_EC_BRP384R1; i <= R_EC_BRP512R1; i += 2) {
|
||||
|
@ -2614,16 +2629,28 @@ int speed_main(int argc, char **argv)
|
|||
|
||||
for (k = 0; k < loopargs_len; k++) {
|
||||
loopargs[k].ctx = EVP_CIPHER_CTX_new();
|
||||
EVP_CipherInit_ex(loopargs[k].ctx, evp_cipher, NULL, NULL,
|
||||
iv, decrypt ? 0 : 1);
|
||||
if (loopargs[k].ctx == NULL) {
|
||||
BIO_printf(bio_err, "\nEVP_CIPHER_CTX_new failure\n");
|
||||
exit(1);
|
||||
}
|
||||
if (!EVP_CipherInit_ex(loopargs[k].ctx, evp_cipher, NULL,
|
||||
NULL, iv, decrypt ? 0 : 1)) {
|
||||
BIO_printf(bio_err, "\nEVP_CipherInit_ex failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
EVP_CIPHER_CTX_set_padding(loopargs[k].ctx, 0);
|
||||
|
||||
keylen = EVP_CIPHER_CTX_key_length(loopargs[k].ctx);
|
||||
loopargs[k].key = app_malloc(keylen, "evp_cipher key");
|
||||
EVP_CIPHER_CTX_rand_key(loopargs[k].ctx, loopargs[k].key);
|
||||
EVP_CipherInit_ex(loopargs[k].ctx, NULL, NULL,
|
||||
loopargs[k].key, NULL, -1);
|
||||
if (!EVP_CipherInit_ex(loopargs[k].ctx, NULL, NULL,
|
||||
loopargs[k].key, NULL, -1)) {
|
||||
BIO_printf(bio_err, "\nEVP_CipherInit_ex failure\n");
|
||||
ERR_print_errors(bio_err);
|
||||
exit(1);
|
||||
}
|
||||
OPENSSL_clear_free(loopargs[k].key, keylen);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#! /usr/bin/env perl
|
||||
# Copyright 2010-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
# Copyright 2010-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
#
|
||||
# Licensed under the OpenSSL license (the "License"). You may not use
|
||||
# this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -89,7 +89,7 @@ if ($flavour =~ /64|n32/i) {
|
|||
$SZREG=4;
|
||||
$REG_S="sw";
|
||||
$REG_L="lw";
|
||||
$code=".set mips2\n";
|
||||
$code="#if !(defined (__mips_isa_rev) && (__mips_isa_rev >= 6))\n.set mips2\n#endif\n";
|
||||
}
|
||||
|
||||
# Below is N32/64 register layout used in the original module.
|
||||
|
|
|
@ -338,6 +338,8 @@ void BN_swap(BIGNUM *a, BIGNUM *b)
|
|||
|
||||
void BN_clear(BIGNUM *a)
|
||||
{
|
||||
if (a == NULL)
|
||||
return;
|
||||
bn_check_top(a);
|
||||
if (a->d != NULL)
|
||||
OPENSSL_cleanse(a->d, sizeof(*a->d) * a->dmax);
|
||||
|
|
|
@ -204,8 +204,7 @@ int ec_GF2m_simple_group_check_discriminant(const EC_GROUP *group,
|
|||
ret = 1;
|
||||
|
||||
err:
|
||||
if (ctx != NULL)
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(new_ctx);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2006-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2006-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -504,7 +504,12 @@ static int ec_pkey_ctrl(EVP_PKEY *pkey, int op, long arg1, void *arg2)
|
|||
#endif
|
||||
|
||||
case ASN1_PKEY_CTRL_DEFAULT_MD_NID:
|
||||
*(int *)arg2 = NID_sha256;
|
||||
if (EVP_PKEY_id(pkey) == EVP_PKEY_SM2) {
|
||||
/* For SM2, the only valid digest-alg is SM3 */
|
||||
*(int *)arg2 = NID_sm3;
|
||||
} else {
|
||||
*(int *)arg2 = NID_sha256;
|
||||
}
|
||||
return 1;
|
||||
|
||||
case ASN1_PKEY_CTRL_SET1_TLS_ENCPT:
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
|
@ -1074,8 +1074,7 @@ static int ec_field_inverse_mod_ord(const EC_GROUP *group, BIGNUM *r,
|
|||
ret = 1;
|
||||
|
||||
err:
|
||||
if (ctx != NULL)
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(new_ctx);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -307,8 +307,7 @@ int ec_GFp_simple_group_check_discriminant(const EC_GROUP *group, BN_CTX *ctx)
|
|||
ret = 1;
|
||||
|
||||
err:
|
||||
if (ctx != NULL)
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(new_ctx);
|
||||
return ret;
|
||||
}
|
||||
|
@ -787,8 +786,7 @@ int ec_GFp_simple_add(const EC_GROUP *group, EC_POINT *r, const EC_POINT *a,
|
|||
ret = 1;
|
||||
|
||||
end:
|
||||
if (ctx) /* otherwise we already called BN_CTX_end */
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(new_ctx);
|
||||
return ret;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -2216,9 +2216,6 @@ static int s390x_aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
|||
if (!cctx->aes.ccm.iv_set)
|
||||
return -1;
|
||||
|
||||
if (!enc && !cctx->aes.ccm.tag_set)
|
||||
return -1;
|
||||
|
||||
if (out == NULL) {
|
||||
/* Update(): Pass message length. */
|
||||
if (in == NULL) {
|
||||
|
@ -2237,6 +2234,10 @@ static int s390x_aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
|||
return len;
|
||||
}
|
||||
|
||||
/* The tag must be set before actually decrypting data */
|
||||
if (!enc && !cctx->aes.ccm.tag_set)
|
||||
return -1;
|
||||
|
||||
/* Update(): Process message. */
|
||||
|
||||
if (!cctx->aes.ccm.len_set) {
|
||||
|
@ -3645,8 +3646,6 @@ static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
|||
if (!cctx->iv_set)
|
||||
return -1;
|
||||
|
||||
if (!EVP_CIPHER_CTX_encrypting(ctx) && !cctx->tag_set)
|
||||
return -1;
|
||||
if (!out) {
|
||||
if (!in) {
|
||||
if (CRYPTO_ccm128_setiv(ccm, EVP_CIPHER_CTX_iv_noconst(ctx),
|
||||
|
@ -3661,6 +3660,11 @@ static int aes_ccm_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
|
|||
CRYPTO_ccm128_aad(ccm, in, len);
|
||||
return len;
|
||||
}
|
||||
|
||||
/* The tag must be set before actually decrypting data */
|
||||
if (!EVP_CIPHER_CTX_encrypting(ctx) && !cctx->tag_set)
|
||||
return -1;
|
||||
|
||||
/* If not set length yet do it */
|
||||
if (!cctx->len_set) {
|
||||
if (CRYPTO_ccm128_setiv(ccm, EVP_CIPHER_CTX_iv_noconst(ctx),
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -35,6 +35,13 @@ int HMAC_Init_ex(HMAC_CTX *ctx, const void *key, int len,
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* The HMAC construction is not allowed to be used with the
|
||||
* extendable-output functions (XOF) shake128 and shake256.
|
||||
*/
|
||||
if ((EVP_MD_meth_get_flags(md) & EVP_MD_FLAG_XOF) != 0)
|
||||
return 0;
|
||||
|
||||
if (key != NULL) {
|
||||
reset = 1;
|
||||
j = EVP_MD_block_size(md);
|
||||
|
|
|
@ -318,6 +318,7 @@ void OPENSSL_cpuid_setup(void)
|
|||
#ifdef OSSL_IMPLEMENT_GETAUXVAL
|
||||
{
|
||||
unsigned long hwcap = getauxval(HWCAP);
|
||||
unsigned long hwcap2 = getauxval(HWCAP2);
|
||||
|
||||
if (hwcap & HWCAP_FPU) {
|
||||
OPENSSL_ppccap_P |= PPC_FPU;
|
||||
|
@ -336,11 +337,11 @@ void OPENSSL_cpuid_setup(void)
|
|||
if (hwcap & HWCAP_ALTIVEC) {
|
||||
OPENSSL_ppccap_P |= PPC_ALTIVEC;
|
||||
|
||||
if ((hwcap & HWCAP_VSX) && (getauxval(HWCAP2) & HWCAP_VEC_CRYPTO))
|
||||
if ((hwcap & HWCAP_VSX) && (hwcap2 & HWCAP_VEC_CRYPTO))
|
||||
OPENSSL_ppccap_P |= PPC_CRYPTO207;
|
||||
}
|
||||
|
||||
if (hwcap & HWCAP_ARCH_3_00) {
|
||||
if (hwcap2 & HWCAP_ARCH_3_00) {
|
||||
OPENSSL_ppccap_P |= PPC_MADD300;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
#include <stdio.h>
|
||||
#include "internal/dso.h"
|
||||
#if defined(__linux)
|
||||
# include <sys/syscall.h>
|
||||
# include <asm/unistd.h>
|
||||
#endif
|
||||
#if defined(__FreeBSD__)
|
||||
# include <sys/types.h>
|
||||
|
@ -324,8 +324,8 @@ static ssize_t syscall_random(void *buf, size_t buflen)
|
|||
# endif
|
||||
|
||||
/* Linux supports this since version 3.17 */
|
||||
# if defined(__linux) && defined(SYS_getrandom)
|
||||
return syscall(SYS_getrandom, buf, buflen, 0);
|
||||
# if defined(__linux) && defined(__NR_getrandom)
|
||||
return syscall(__NR_getrandom, buf, buflen, 0);
|
||||
# elif (defined(__FreeBSD__) || defined(__NetBSD__)) && defined(KERN_ARND)
|
||||
return sysctl_random(buf, buflen);
|
||||
# else
|
||||
|
@ -510,6 +510,29 @@ size_t rand_pool_acquire_entropy(RAND_POOL *pool)
|
|||
bytes_needed = rand_pool_bytes_needed(pool, 1 /*entropy_factor*/);
|
||||
{
|
||||
size_t i;
|
||||
#ifdef DEVRANDOM_WAIT
|
||||
static int wait_done = 0;
|
||||
|
||||
/*
|
||||
* On some implementations reading from /dev/urandom is possible
|
||||
* before it is initialized. Therefore we wait for /dev/random
|
||||
* to be readable to make sure /dev/urandom is initialized.
|
||||
*/
|
||||
if (!wait_done && bytes_needed > 0) {
|
||||
int f = open(DEVRANDOM_WAIT, O_RDONLY);
|
||||
|
||||
if (f >= 0) {
|
||||
fd_set fds;
|
||||
|
||||
FD_ZERO(&fds);
|
||||
FD_SET(f, &fds);
|
||||
while (select(f+1, &fds, NULL, NULL, NULL) < 0
|
||||
&& errno == EINTR);
|
||||
close(f);
|
||||
}
|
||||
wait_done = 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
for (i = 0; bytes_needed > 0 && i < OSSL_NELEM(random_device_paths); i++) {
|
||||
ssize_t bytes = 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -254,7 +254,7 @@ const char *RAND_file_name(char *buf, size_t size)
|
|||
size_t len;
|
||||
int use_randfile = 1;
|
||||
|
||||
#if defined(_WIN32) && defined(CP_UTF8)
|
||||
#if defined(_WIN32) && defined(CP_UTF8) && !defined(_WIN32_WCE)
|
||||
DWORD envlen;
|
||||
WCHAR *var;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -387,8 +387,7 @@ static int rsa_builtin_keygen(RSA *rsa, int bits, int primes, BIGNUM *e_value,
|
|||
RSAerr(RSA_F_RSA_BUILTIN_KEYGEN, ERR_LIB_BN);
|
||||
ok = 0;
|
||||
}
|
||||
if (ctx != NULL)
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_end(ctx);
|
||||
BN_CTX_free(ctx);
|
||||
return ok;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1999-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -143,7 +143,7 @@ int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
|||
* |num| is the length of the modulus; |flen| is the length of the
|
||||
* encoded message. Therefore, for any |from| that was obtained by
|
||||
* decrypting a ciphertext, we must have |flen| <= |num|. Similarly,
|
||||
* num < 2 * mdlen + 2 must hold for the modulus irrespective of
|
||||
* |num| >= 2 * |mdlen| + 2 must hold for the modulus irrespective of
|
||||
* the ciphertext, see PKCS #1 v2.2, section 7.1.2.
|
||||
* This does not leak any side-channel information.
|
||||
*/
|
||||
|
@ -179,17 +179,16 @@ int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
|||
from -= 1 & mask;
|
||||
*--em = *from & mask;
|
||||
}
|
||||
from = em;
|
||||
|
||||
/*
|
||||
* The first byte must be zero, however we must not leak if this is
|
||||
* true. See James H. Manger, "A Chosen Ciphertext Attack on RSA
|
||||
* Optimal Asymmetric Encryption Padding (OAEP) [...]", CRYPTO 2001).
|
||||
*/
|
||||
good = constant_time_is_zero(from[0]);
|
||||
good = constant_time_is_zero(em[0]);
|
||||
|
||||
maskedseed = from + 1;
|
||||
maskeddb = from + 1 + mdlen;
|
||||
maskedseed = em + 1;
|
||||
maskeddb = em + 1 + mdlen;
|
||||
|
||||
if (PKCS1_MGF1(seed, mdlen, maskeddb, dblen, mgf1md))
|
||||
goto cleanup;
|
||||
|
@ -230,29 +229,30 @@ int RSA_padding_check_PKCS1_OAEP_mgf1(unsigned char *to, int tlen,
|
|||
mlen = dblen - msg_index;
|
||||
|
||||
/*
|
||||
* For good measure, do this check in constant tine as well.
|
||||
* For good measure, do this check in constant time as well.
|
||||
*/
|
||||
good &= constant_time_ge(tlen, mlen);
|
||||
|
||||
/*
|
||||
* Even though we can't fake result's length, we can pretend copying
|
||||
* |tlen| bytes where |mlen| bytes would be real. Last |tlen| of |dblen|
|
||||
* bytes are viewed as circular buffer with start at |tlen|-|mlen'|,
|
||||
* where |mlen'| is "saturated" |mlen| value. Deducing information
|
||||
* about failure or |mlen| would take attacker's ability to observe
|
||||
* memory access pattern with byte granularity *as it occurs*. It
|
||||
* should be noted that failure is indistinguishable from normal
|
||||
* operation if |tlen| is fixed by protocol.
|
||||
* Move the result in-place by |dblen|-|mdlen|-1-|mlen| bytes to the left.
|
||||
* Then if |good| move |mlen| bytes from |db|+|mdlen|+1 to |to|.
|
||||
* Otherwise leave |to| unchanged.
|
||||
* Copy the memory back in a way that does not reveal the size of
|
||||
* the data being copied via a timing side channel. This requires copying
|
||||
* parts of the buffer multiple times based on the bits set in the real
|
||||
* length. Clear bits do a non-copy with identical access pattern.
|
||||
* The loop below has overall complexity of O(N*log(N)).
|
||||
*/
|
||||
tlen = constant_time_select_int(constant_time_lt(dblen, tlen), dblen, tlen);
|
||||
msg_index = constant_time_select_int(good, msg_index, dblen - tlen);
|
||||
mlen = dblen - msg_index;
|
||||
for (from = db + msg_index, mask = good, i = 0; i < tlen; i++) {
|
||||
unsigned int equals = constant_time_eq(i, mlen);
|
||||
|
||||
from -= dblen & equals; /* if (i == dblen) rewind */
|
||||
mask &= mask ^ equals; /* if (i == dblen) mask = 0 */
|
||||
to[i] = constant_time_select_8(mask, from[i], to[i]);
|
||||
tlen = constant_time_select_int(constant_time_lt(dblen - mdlen - 1, tlen),
|
||||
dblen - mdlen - 1, tlen);
|
||||
for (msg_index = 1; msg_index < dblen - mdlen - 1; msg_index <<= 1) {
|
||||
mask = ~constant_time_eq(msg_index & (dblen - mdlen - 1 - mlen), 0);
|
||||
for (i = mdlen + 1; i < dblen - msg_index; i++)
|
||||
db[i] = constant_time_select_8(mask, db[i + msg_index], db[i]);
|
||||
}
|
||||
for (i = 0; i < tlen; i++) {
|
||||
mask = good & constant_time_lt(i, mlen);
|
||||
to[i] = constant_time_select_8(mask, db[i + mdlen + 1], to[i]);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -192,15 +192,14 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
|||
from -= 1 & mask;
|
||||
*--em = *from & mask;
|
||||
}
|
||||
from = em;
|
||||
|
||||
good = constant_time_is_zero(from[0]);
|
||||
good &= constant_time_eq(from[1], 2);
|
||||
good = constant_time_is_zero(em[0]);
|
||||
good &= constant_time_eq(em[1], 2);
|
||||
|
||||
/* scan over padding data */
|
||||
found_zero_byte = 0;
|
||||
for (i = 2; i < num; i++) {
|
||||
unsigned int equals0 = constant_time_is_zero(from[i]);
|
||||
unsigned int equals0 = constant_time_is_zero(em[i]);
|
||||
|
||||
zero_index = constant_time_select_int(~found_zero_byte & equals0,
|
||||
i, zero_index);
|
||||
|
@ -208,7 +207,7 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
|||
}
|
||||
|
||||
/*
|
||||
* PS must be at least 8 bytes long, and it starts two bytes into |from|.
|
||||
* PS must be at least 8 bytes long, and it starts two bytes into |em|.
|
||||
* If we never found a 0-byte, then |zero_index| is 0 and the check
|
||||
* also fails.
|
||||
*/
|
||||
|
@ -227,24 +226,25 @@ int RSA_padding_check_PKCS1_type_2(unsigned char *to, int tlen,
|
|||
good &= constant_time_ge(tlen, mlen);
|
||||
|
||||
/*
|
||||
* Even though we can't fake result's length, we can pretend copying
|
||||
* |tlen| bytes where |mlen| bytes would be real. Last |tlen| of |num|
|
||||
* bytes are viewed as circular buffer with start at |tlen|-|mlen'|,
|
||||
* where |mlen'| is "saturated" |mlen| value. Deducing information
|
||||
* about failure or |mlen| would take attacker's ability to observe
|
||||
* memory access pattern with byte granularity *as it occurs*. It
|
||||
* should be noted that failure is indistinguishable from normal
|
||||
* operation if |tlen| is fixed by protocol.
|
||||
* Move the result in-place by |num|-11-|mlen| bytes to the left.
|
||||
* Then if |good| move |mlen| bytes from |em|+11 to |to|.
|
||||
* Otherwise leave |to| unchanged.
|
||||
* Copy the memory back in a way that does not reveal the size of
|
||||
* the data being copied via a timing side channel. This requires copying
|
||||
* parts of the buffer multiple times based on the bits set in the real
|
||||
* length. Clear bits do a non-copy with identical access pattern.
|
||||
* The loop below has overall complexity of O(N*log(N)).
|
||||
*/
|
||||
tlen = constant_time_select_int(constant_time_lt(num, tlen), num, tlen);
|
||||
msg_index = constant_time_select_int(good, msg_index, num - tlen);
|
||||
mlen = num - msg_index;
|
||||
for (from += msg_index, mask = good, i = 0; i < tlen; i++) {
|
||||
unsigned int equals = constant_time_eq(i, mlen);
|
||||
|
||||
from -= tlen & equals; /* if (i == mlen) rewind */
|
||||
mask &= mask ^ equals; /* if (i == mlen) mask = 0 */
|
||||
to[i] = constant_time_select_8(mask, from[i], to[i]);
|
||||
tlen = constant_time_select_int(constant_time_lt(num - 11, tlen),
|
||||
num - 11, tlen);
|
||||
for (msg_index = 1; msg_index < num - 11; msg_index <<= 1) {
|
||||
mask = ~constant_time_eq(msg_index & (num - 11 - mlen), 0);
|
||||
for (i = 11; i < num - msg_index; i++)
|
||||
em[i] = constant_time_select_8(mask, em[i + msg_index], em[i]);
|
||||
}
|
||||
for (i = 0; i < tlen; i++) {
|
||||
mask = good & constant_time_lt(i, mlen);
|
||||
to[i] = constant_time_select_8(mask, em[i + 11], to[i]);
|
||||
}
|
||||
|
||||
OPENSSL_clear_free(em, num);
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1995-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -27,10 +27,9 @@
|
|||
* set this to a comma-separated list of 'random' device files to try out. By
|
||||
* default, we will try to read at least one of these files
|
||||
*/
|
||||
# if defined(__s390__)
|
||||
# define DEVRANDOM "/dev/prandom","/dev/urandom","/dev/hwrng","/dev/random"
|
||||
# else
|
||||
# define DEVRANDOM "/dev/urandom","/dev/random","/dev/srandom"
|
||||
# define DEVRANDOM "/dev/urandom", "/dev/random", "/dev/hwrng", "/dev/srandom"
|
||||
# ifdef __linux
|
||||
# define DEVRANDOM_WAIT "/dev/random"
|
||||
# endif
|
||||
# endif
|
||||
# if !defined(OPENSSL_NO_EGD) && !defined(DEVRANDOM_EGD)
|
||||
|
@ -39,7 +38,7 @@
|
|||
* sockets will be tried in the order listed in case accessing the device
|
||||
* files listed in DEVRANDOM did not return enough randomness.
|
||||
*/
|
||||
# define DEVRANDOM_EGD "/var/run/egd-pool","/dev/egd-pool","/etc/egd-pool","/etc/entropy"
|
||||
# define DEVRANDOM_EGD "/var/run/egd-pool", "/dev/egd-pool", "/etc/egd-pool", "/etc/entropy"
|
||||
# endif
|
||||
|
||||
# if defined(OPENSSL_SYS_VXWORKS) || defined(OPENSSL_SYS_UEFI)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2004-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2004-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -41,7 +41,7 @@
|
|||
*/
|
||||
|
||||
# undef COMPILE_HW_PADLOCK
|
||||
# if !defined(I386_ONLY) && defined(PADLOCK_ASM)
|
||||
# if defined(PADLOCK_ASM)
|
||||
# define COMPILE_HW_PADLOCK
|
||||
# ifdef OPENSSL_NO_DYNAMIC_ENGINE
|
||||
static ENGINE *ENGINE_padlock(void);
|
||||
|
@ -148,7 +148,7 @@ static int padlock_init(ENGINE *e)
|
|||
* This stuff is needed if this ENGINE is being compiled into a
|
||||
* self-contained shared-library.
|
||||
*/
|
||||
# ifdef DYNAMIC_ENGINE
|
||||
# ifndef OPENSSL_NO_DYNAMIC_ENGINE
|
||||
static int padlock_bind_fn(ENGINE *e, const char *id)
|
||||
{
|
||||
if (id && (strcmp(id, padlock_id) != 0)) {
|
||||
|
@ -164,7 +164,7 @@ static int padlock_bind_fn(ENGINE *e, const char *id)
|
|||
|
||||
IMPLEMENT_DYNAMIC_CHECK_FN()
|
||||
IMPLEMENT_DYNAMIC_BIND_FN(padlock_bind_fn)
|
||||
# endif /* DYNAMIC_ENGINE */
|
||||
# endif /* !OPENSSL_NO_DYNAMIC_ENGINE */
|
||||
/* ===== Here comes the "real" engine ===== */
|
||||
|
||||
/* Some AES-related constants */
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -79,7 +79,7 @@ static __inline__ int CRYPTO_DOWN_REF(int *val, int *ret, void *lock)
|
|||
|
||||
typedef volatile int CRYPTO_REF_COUNT;
|
||||
|
||||
# if (defined(_M_ARM) && _M_ARM>=7) || defined(_M_ARM64)
|
||||
# if (defined(_M_ARM) && _M_ARM>=7 && !defined(_WIN32_WCE)) || defined(_M_ARM64)
|
||||
# include <intrin.h>
|
||||
# if defined(_M_ARM64) && !defined(_ARM_BARRIER_ISH)
|
||||
# define _ARM_BARRIER_ISH _ARM64_BARRIER_ISH
|
||||
|
@ -99,7 +99,17 @@ static __inline int CRYPTO_DOWN_REF(volatile int *val, int *ret, void *lock)
|
|||
return 1;
|
||||
}
|
||||
# else
|
||||
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||
# if !defined(_WIN32_WCE)
|
||||
# pragma intrinsic(_InterlockedExchangeAdd)
|
||||
# else
|
||||
# if _WIN32_WCE >= 0x600
|
||||
extern long __cdecl _InterlockedExchangeAdd(long volatile*, long);
|
||||
# else
|
||||
// under Windows CE we still have old-style Interlocked* functions
|
||||
extern long __cdecl InterlockedExchangeAdd(long volatile*, long);
|
||||
# define _InterlockedExchangeAdd InterlockedExchangeAdd
|
||||
# endif
|
||||
# endif
|
||||
|
||||
static __inline int CRYPTO_UP_REF(volatile int *val, int *ret, void *lock)
|
||||
{
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
|
||||
#elif defined(_MSC_VER) && _MSC_VER>=1200 \
|
||||
&& (defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) || \
|
||||
defined(_M_ARM64) || (defined(_M_ARM) && _M_ARM >= 7))
|
||||
defined(_M_ARM64) || (defined(_M_ARM) && _M_ARM >= 7 && !defined(_WIN32_WCE)))
|
||||
/*
|
||||
* There is subtle dependency on /volatile:<iso|ms> command-line option.
|
||||
* "ms" implies same semantic as memory_order_acquire for loads and
|
||||
|
|
|
@ -4478,7 +4478,7 @@ int ssl_handshake_hash(SSL *s, unsigned char *out, size_t outlen,
|
|||
return ret;
|
||||
}
|
||||
|
||||
int SSL_session_reused(SSL *s)
|
||||
int SSL_session_reused(const SSL *s)
|
||||
{
|
||||
return s->hit;
|
||||
}
|
||||
|
@ -5070,6 +5070,11 @@ int SSL_client_hello_get1_extensions_present(SSL *s, int **out, size_t *outlen)
|
|||
if (ext->present)
|
||||
num++;
|
||||
}
|
||||
if (num == 0) {
|
||||
*out = NULL;
|
||||
*outlen = 0;
|
||||
return 1;
|
||||
}
|
||||
if ((present = OPENSSL_malloc(sizeof(*present) * num)) == NULL) {
|
||||
SSLerr(SSL_F_SSL_CLIENT_HELLO_GET1_EXTENSIONS_PRESENT,
|
||||
ERR_R_MALLOC_FAILURE);
|
||||
|
|
|
@ -574,7 +574,6 @@ struct ssl_session_st {
|
|||
/* Session lifetime hint in seconds */
|
||||
unsigned long tick_lifetime_hint;
|
||||
uint32_t tick_age_add;
|
||||
int tick_identity;
|
||||
/* Max number of bytes that can be sent as early data */
|
||||
uint32_t max_early_data;
|
||||
/* The ALPN protocol selected for this session */
|
||||
|
@ -1356,6 +1355,13 @@ struct ssl_st {
|
|||
* as this extension is optional on server side.
|
||||
*/
|
||||
uint8_t max_fragment_len_mode;
|
||||
|
||||
/*
|
||||
* On the client side the number of ticket identities we sent in the
|
||||
* ClientHello. On the server side the identity of the ticket we
|
||||
* selected.
|
||||
*/
|
||||
int tick_identity;
|
||||
} ext;
|
||||
|
||||
/*
|
||||
|
@ -1509,7 +1515,7 @@ typedef struct cert_pkey_st CERT_PKEY;
|
|||
* CERT_PKEY entries
|
||||
*/
|
||||
typedef struct {
|
||||
int nid; /* NID of pubic key algorithm */
|
||||
int nid; /* NID of public key algorithm */
|
||||
uint32_t amask; /* authmask corresponding to key type */
|
||||
} SSL_CERT_LOOKUP;
|
||||
|
||||
|
@ -2052,9 +2058,6 @@ typedef enum downgrade_en {
|
|||
#define TLSEXT_KEX_MODE_FLAG_KE 1
|
||||
#define TLSEXT_KEX_MODE_FLAG_KE_DHE 2
|
||||
|
||||
/* An invalid index into the TLSv1.3 PSK identities */
|
||||
#define TLSEXT_PSK_BAD_IDENTITY -1
|
||||
|
||||
#define SSL_USE_PSS(s) (s->s3->tmp.peer_sigalg != NULL && \
|
||||
s->s3->tmp.peer_sigalg->sig == EVP_PKEY_RSA_PSS)
|
||||
|
||||
|
|
|
@ -160,10 +160,11 @@ static int test_swap(void)
|
|||
|| !TEST_ptr(d = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_bntest_rand(a, 1024, 1, 0);
|
||||
BN_bntest_rand(b, 1024, 1, 0);
|
||||
BN_copy(c, a);
|
||||
BN_copy(d, b);
|
||||
if (!(TEST_true(BN_bntest_rand(a, 1024, 1, 0))
|
||||
&& TEST_true(BN_bntest_rand(b, 1024, 1, 0))
|
||||
&& TEST_ptr(BN_copy(c, a))
|
||||
&& TEST_ptr(BN_copy(d, b))))
|
||||
goto err;
|
||||
top = BN_num_bits(a) / BN_BITS2;
|
||||
|
||||
/* regular swap */
|
||||
|
@ -233,20 +234,21 @@ static int test_sub(void)
|
|||
|
||||
for (i = 0; i < NUM0 + NUM1; i++) {
|
||||
if (i < NUM1) {
|
||||
BN_bntest_rand(a, 512, 0, 0);
|
||||
BN_copy(b, a);
|
||||
if (!TEST_int_ne(BN_set_bit(a, i), 0))
|
||||
if (!(TEST_true(BN_bntest_rand(a, 512, 0, 0)))
|
||||
&& TEST_ptr(BN_copy(b, a))
|
||||
&& TEST_int_ne(BN_set_bit(a, i), 0)
|
||||
&& TEST_true(BN_add_word(b, i)))
|
||||
goto err;
|
||||
BN_add_word(b, i);
|
||||
} else {
|
||||
BN_bntest_rand(b, 400 + i - NUM1, 0, 0);
|
||||
if (!TEST_true(BN_bntest_rand(b, 400 + i - NUM1, 0, 0)))
|
||||
goto err;
|
||||
BN_set_negative(a, rand_neg());
|
||||
BN_set_negative(b, rand_neg());
|
||||
}
|
||||
BN_sub(c, a, b);
|
||||
BN_add(c, c, b);
|
||||
BN_sub(c, c, a);
|
||||
if (!TEST_BN_eq_zero(c))
|
||||
if (!(TEST_true(BN_sub(c, a, b))
|
||||
&& TEST_true(BN_add(c, c, b))
|
||||
&& TEST_true(BN_sub(c, c, a))
|
||||
&& TEST_BN_eq_zero(c)))
|
||||
goto err;
|
||||
}
|
||||
st = 1;
|
||||
|
@ -273,20 +275,23 @@ static int test_div_recip(void)
|
|||
|
||||
for (i = 0; i < NUM0 + NUM1; i++) {
|
||||
if (i < NUM1) {
|
||||
BN_bntest_rand(a, 400, 0, 0);
|
||||
BN_copy(b, a);
|
||||
BN_lshift(a, a, i);
|
||||
BN_add_word(a, i);
|
||||
} else
|
||||
BN_bntest_rand(b, 50 + 3 * (i - NUM1), 0, 0);
|
||||
if (!(TEST_true(BN_bntest_rand(a, 400, 0, 0))
|
||||
&& TEST_ptr(BN_copy(b, a))
|
||||
&& TEST_true(BN_lshift(a, a, i))
|
||||
&& TEST_true(BN_add_word(a, i))))
|
||||
goto err;
|
||||
} else {
|
||||
if (!(TEST_true(BN_bntest_rand(b, 50 + 3 * (i - NUM1), 0, 0))))
|
||||
goto err;
|
||||
}
|
||||
BN_set_negative(a, rand_neg());
|
||||
BN_set_negative(b, rand_neg());
|
||||
BN_RECP_CTX_set(recp, b, ctx);
|
||||
BN_div_recp(d, c, a, recp, ctx);
|
||||
BN_mul(e, d, b, ctx);
|
||||
BN_add(d, e, c);
|
||||
BN_sub(d, d, a);
|
||||
if (!TEST_BN_eq_zero(d))
|
||||
if (!(TEST_true(BN_RECP_CTX_set(recp, b, ctx))
|
||||
&& TEST_true(BN_div_recp(d, c, a, recp, ctx))
|
||||
&& TEST_true(BN_mul(e, d, b, ctx))
|
||||
&& TEST_true(BN_add(d, e, c))
|
||||
&& TEST_true(BN_sub(d, d, a))
|
||||
&& TEST_BN_eq_zero(d)))
|
||||
goto err;
|
||||
}
|
||||
st = 1;
|
||||
|
@ -312,15 +317,17 @@ static int test_mod(void)
|
|||
|| !TEST_ptr(e = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_bntest_rand(a, 1024, 0, 0);
|
||||
if (!(TEST_true(BN_bntest_rand(a, 1024, 0, 0))))
|
||||
goto err;
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(b, 450 + i * 10, 0, 0);
|
||||
if (!(TEST_true(BN_bntest_rand(b, 450 + i * 10, 0, 0))))
|
||||
goto err;
|
||||
BN_set_negative(a, rand_neg());
|
||||
BN_set_negative(b, rand_neg());
|
||||
BN_mod(c, a, b, ctx);
|
||||
BN_div(d, e, a, b, ctx);
|
||||
BN_sub(e, e, c);
|
||||
if (!TEST_BN_eq_zero(e))
|
||||
if (!(TEST_true(BN_mod(c, a, b, ctx))
|
||||
&& TEST_true(BN_div(d, e, a, b, ctx))
|
||||
&& TEST_true(BN_sub(e, e, c))
|
||||
&& TEST_BN_eq_zero(e)))
|
||||
goto err;
|
||||
}
|
||||
st = 1;
|
||||
|
@ -395,46 +402,52 @@ static int test_modexp_mont5(void)
|
|||
|| !TEST_ptr(mont = BN_MONT_CTX_new()))
|
||||
goto err;
|
||||
|
||||
BN_bntest_rand(m, 1024, 0, 1); /* must be odd for montgomery */
|
||||
/* Zero exponent */
|
||||
BN_bntest_rand(a, 1024, 0, 0);
|
||||
/* must be odd for montgomery */
|
||||
if (!(TEST_true(BN_bntest_rand(m, 1024, 0, 1))
|
||||
/* Zero exponent */
|
||||
&& TEST_true(BN_bntest_rand(a, 1024, 0, 0))))
|
||||
goto err;
|
||||
BN_zero(p);
|
||||
|
||||
if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL)))
|
||||
goto err;
|
||||
if (!TEST_BN_eq_one(d))
|
||||
goto err;
|
||||
|
||||
/* Regression test for carry bug in mulx4x_mont */
|
||||
BN_hex2bn(&a,
|
||||
if (!(TEST_true(BN_hex2bn(&a,
|
||||
"7878787878787878787878787878787878787878787878787878787878787878"
|
||||
"7878787878787878787878787878787878787878787878787878787878787878"
|
||||
"7878787878787878787878787878787878787878787878787878787878787878"
|
||||
"7878787878787878787878787878787878787878787878787878787878787878");
|
||||
BN_hex2bn(&b,
|
||||
"7878787878787878787878787878787878787878787878787878787878787878"))
|
||||
&& TEST_true(BN_hex2bn(&b,
|
||||
"095D72C08C097BA488C5E439C655A192EAFB6380073D8C2664668EDDB4060744"
|
||||
"E16E57FB4EDB9AE10A0CEFCDC28A894F689A128379DB279D48A2E20849D68593"
|
||||
"9B7803BCF46CEBF5C533FB0DD35B080593DE5472E3FE5DB951B8BFF9B4CB8F03"
|
||||
"9CC638A5EE8CDD703719F8000E6A9F63BEED5F2FCD52FF293EA05A251BB4AB81");
|
||||
BN_hex2bn(&n,
|
||||
"9CC638A5EE8CDD703719F8000E6A9F63BEED5F2FCD52FF293EA05A251BB4AB81"))
|
||||
&& TEST_true(BN_hex2bn(&n,
|
||||
"D78AF684E71DB0C39CFF4E64FB9DB567132CB9C50CC98009FEB820B26F2DED9B"
|
||||
"91B9B5E2B83AE0AE4EB4E0523CA726BFBE969B89FD754F674CE99118C3F2D1C5"
|
||||
"D81FDC7C54E02B60262B241D53C040E99E45826ECA37A804668E690E1AFC1CA4"
|
||||
"2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF");
|
||||
BN_MONT_CTX_set(mont, n, ctx);
|
||||
BN_mod_mul_montgomery(c, a, b, mont, ctx);
|
||||
BN_mod_mul_montgomery(d, b, a, mont, ctx);
|
||||
if (!TEST_BN_eq(c, d))
|
||||
"2C9A15D84D4954425F0B7642FC0BD9D7B24E2618D2DCC9B729D944BADACFDDAF"))))
|
||||
goto err;
|
||||
|
||||
if (!(TEST_true(BN_MONT_CTX_set(mont, n, ctx))
|
||||
&& TEST_true(BN_mod_mul_montgomery(c, a, b, mont, ctx))
|
||||
&& TEST_true(BN_mod_mul_montgomery(d, b, a, mont, ctx))
|
||||
&& TEST_BN_eq(c, d)))
|
||||
goto err;
|
||||
|
||||
/* Regression test for carry bug in sqr[x]8x_mont */
|
||||
parse_bigBN(&n, bn1strings);
|
||||
parse_bigBN(&a, bn2strings);
|
||||
if (!(TEST_true(parse_bigBN(&n, bn1strings))
|
||||
&& TEST_true(parse_bigBN(&a, bn2strings))))
|
||||
goto err;
|
||||
BN_free(b);
|
||||
b = BN_dup(a);
|
||||
BN_MONT_CTX_set(mont, n, ctx);
|
||||
BN_mod_mul_montgomery(c, a, a, mont, ctx);
|
||||
BN_mod_mul_montgomery(d, a, b, mont, ctx);
|
||||
if (!TEST_BN_eq(c, d))
|
||||
if (!(TEST_ptr(b = BN_dup(a))
|
||||
&& TEST_true(BN_MONT_CTX_set(mont, n, ctx))
|
||||
&& TEST_true(BN_mod_mul_montgomery(c, a, a, mont, ctx))
|
||||
&& TEST_true(BN_mod_mul_montgomery(d, a, b, mont, ctx))
|
||||
&& TEST_BN_eq(c, d)))
|
||||
goto err;
|
||||
|
||||
/* Regression test for carry bug in bn_sqrx8x_internal */
|
||||
|
@ -470,78 +483,83 @@ static int test_modexp_mont5(void)
|
|||
NULL
|
||||
};
|
||||
|
||||
parse_bigBN(&a, ahex);
|
||||
parse_bigBN(&n, nhex);
|
||||
if (!(TEST_true(parse_bigBN(&a, ahex))
|
||||
&& TEST_true(parse_bigBN(&n, nhex))))
|
||||
goto err;
|
||||
}
|
||||
BN_free(b);
|
||||
b = BN_dup(a);
|
||||
BN_MONT_CTX_set(mont, n, ctx);
|
||||
if (!(TEST_ptr(b = BN_dup(a))
|
||||
&& TEST_true(BN_MONT_CTX_set(mont, n, ctx))))
|
||||
goto err;
|
||||
|
||||
if (!TEST_true(BN_mod_mul_montgomery(c, a, a, mont, ctx))
|
||||
|| !TEST_true(BN_mod_mul_montgomery(d, a, b, mont, ctx))
|
||||
|| !TEST_BN_eq(c, d))
|
||||
goto err;
|
||||
|
||||
/* Regression test for bug in BN_from_montgomery_word */
|
||||
BN_hex2bn(&a,
|
||||
if (!(TEST_true(BN_hex2bn(&a,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
|
||||
BN_hex2bn(&n,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"))
|
||||
&& TEST_true(BN_hex2bn(&n,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF");
|
||||
BN_MONT_CTX_set(mont, n, ctx);
|
||||
if (!TEST_false(BN_mod_mul_montgomery(d, a, a, mont, ctx)))
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"))
|
||||
&& TEST_true(BN_MONT_CTX_set(mont, n, ctx))
|
||||
&& TEST_false(BN_mod_mul_montgomery(d, a, a, mont, ctx))))
|
||||
goto err;
|
||||
|
||||
/* Regression test for bug in rsaz_1024_mul_avx2 */
|
||||
BN_hex2bn(&a,
|
||||
if (!(TEST_true(BN_hex2bn(&a,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020DF");
|
||||
BN_hex2bn(&b,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020DF"))
|
||||
&& TEST_true(BN_hex2bn(&b,
|
||||
"2020202020202020202020202020202020202020202020202020202020202020"
|
||||
"2020202020202020202020202020202020202020202020202020202020202020"
|
||||
"20202020202020FF202020202020202020202020202020202020202020202020"
|
||||
"2020202020202020202020202020202020202020202020202020202020202020");
|
||||
BN_hex2bn(&n,
|
||||
"2020202020202020202020202020202020202020202020202020202020202020"))
|
||||
&& TEST_true(BN_hex2bn(&n,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020FF");
|
||||
BN_MONT_CTX_set(mont, n, ctx);
|
||||
BN_mod_exp_mont_consttime(c, a, b, n, ctx, mont);
|
||||
BN_mod_exp_mont(d, a, b, n, ctx, mont);
|
||||
if (!TEST_BN_eq(c, d))
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020FF"))
|
||||
&& TEST_true(BN_MONT_CTX_set(mont, n, ctx))
|
||||
&& TEST_true(BN_mod_exp_mont_consttime(c, a, b, n, ctx, mont))
|
||||
&& TEST_true(BN_mod_exp_mont(d, a, b, n, ctx, mont))
|
||||
&& TEST_BN_eq(c, d)))
|
||||
goto err;
|
||||
|
||||
/*
|
||||
* rsaz_1024_mul_avx2 expects fully-reduced inputs.
|
||||
* BN_mod_exp_mont_consttime should reduce the input first.
|
||||
*/
|
||||
BN_hex2bn(&a,
|
||||
if (!(TEST_true(BN_hex2bn(&a,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020DF");
|
||||
BN_hex2bn(&b,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020DF"))
|
||||
&& TEST_true(BN_hex2bn(&b,
|
||||
"1FA53F26F8811C58BE0357897AA5E165693230BC9DF5F01DFA6A2D59229EC69D"
|
||||
"9DE6A89C36E3B6957B22D6FAAD5A3C73AE587B710DBE92E83D3A9A3339A085CB"
|
||||
"B58F508CA4F837924BB52CC1698B7FDC2FD74362456A595A5B58E38E38E38E38"
|
||||
"E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E");
|
||||
BN_hex2bn(&n,
|
||||
"E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E38E"))
|
||||
&& TEST_true(BN_hex2bn(&n,
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020DF");
|
||||
BN_MONT_CTX_set(mont, n, ctx);
|
||||
BN_mod_exp_mont_consttime(c, a, b, n, ctx, mont);
|
||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF2020202020DF"))
|
||||
&& TEST_true(BN_MONT_CTX_set(mont, n, ctx))
|
||||
&& TEST_true(BN_mod_exp_mont_consttime(c, a, b, n, ctx, mont))))
|
||||
goto err;
|
||||
BN_zero(d);
|
||||
if (!TEST_BN_eq(c, d))
|
||||
goto err;
|
||||
|
||||
/* Zero input */
|
||||
BN_bntest_rand(p, 1024, 0, 0);
|
||||
if (!TEST_true(BN_bntest_rand(p, 1024, 0, 0)))
|
||||
goto err;
|
||||
BN_zero(a);
|
||||
if (!TEST_true(BN_mod_exp_mont_consttime(d, a, p, m, ctx, NULL))
|
||||
|| !TEST_BN_eq_zero(d))
|
||||
|
@ -552,8 +570,9 @@ static int test_modexp_mont5(void)
|
|||
* than the modulus m, in order to test the const time precomputation
|
||||
* scattering/gathering.
|
||||
*/
|
||||
BN_one(a);
|
||||
BN_MONT_CTX_set(mont, m, ctx);
|
||||
if (!(TEST_true(BN_one(a))
|
||||
&& TEST_true(BN_MONT_CTX_set(mont, m, ctx))))
|
||||
goto err;
|
||||
if (!TEST_true(BN_from_montgomery(e, a, mont, ctx))
|
||||
|| !TEST_true(BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL))
|
||||
|| !TEST_true(BN_mod_exp_simple(a, e, p, m, ctx))
|
||||
|
@ -561,10 +580,10 @@ static int test_modexp_mont5(void)
|
|||
goto err;
|
||||
|
||||
/* Finally, some regular test vectors. */
|
||||
BN_bntest_rand(e, 1024, 0, 0);
|
||||
if (!TEST_true(BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL))
|
||||
|| !TEST_true(BN_mod_exp_simple(a, e, p, m, ctx))
|
||||
|| !TEST_BN_eq(a, d))
|
||||
if (!(TEST_true(BN_bntest_rand(e, 1024, 0, 0))
|
||||
&& TEST_true(BN_mod_exp_mont_consttime(d, e, p, m, ctx, NULL))
|
||||
&& TEST_true(BN_mod_exp_simple(a, e, p, m, ctx))
|
||||
&& TEST_BN_eq(a, d)))
|
||||
goto err;
|
||||
|
||||
st = 1;
|
||||
|
@ -594,18 +613,19 @@ static int test_gf2m_add(void)
|
|||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_rand(a, 512, 0, 0);
|
||||
BN_copy(b, BN_value_one());
|
||||
if (!(TEST_true(BN_rand(a, 512, 0, 0))
|
||||
&& TEST_ptr(BN_copy(b, BN_value_one()))))
|
||||
goto err;
|
||||
BN_set_negative(a, rand_neg());
|
||||
BN_set_negative(b, rand_neg());
|
||||
BN_GF2m_add(c, a, b);
|
||||
/* Test that two added values have the correct parity. */
|
||||
if (!TEST_false((BN_is_odd(a) && BN_is_odd(c))
|
||||
|| (!BN_is_odd(a) && !BN_is_odd(c))))
|
||||
if (!(TEST_true(BN_GF2m_add(c, a, b))
|
||||
/* Test that two added values have the correct parity. */
|
||||
&& TEST_false((BN_is_odd(a) && BN_is_odd(c))
|
||||
|| (!BN_is_odd(a) && !BN_is_odd(c)))))
|
||||
goto err;
|
||||
BN_GF2m_add(c, c, c);
|
||||
/* Test that c + c = 0. */
|
||||
if (!TEST_BN_eq_zero(c))
|
||||
if (!(TEST_true(BN_GF2m_add(c, c, c))
|
||||
/* Test that c + c = 0. */
|
||||
&& TEST_BN_eq_zero(c)))
|
||||
goto err;
|
||||
}
|
||||
st = 1;
|
||||
|
@ -629,17 +649,19 @@ static int test_gf2m_mod(void)
|
|||
|| !TEST_ptr(e = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_GF2m_arr2poly(p0, b[0]);
|
||||
BN_GF2m_arr2poly(p1, b[1]);
|
||||
if (!(TEST_true(BN_GF2m_arr2poly(p0, b[0]))
|
||||
&& TEST_true(BN_GF2m_arr2poly(p1, b[1]))))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(a, 1024, 0, 0);
|
||||
if (!TEST_true(BN_bntest_rand(a, 1024, 0, 0)))
|
||||
goto err;
|
||||
for (j = 0; j < 2; j++) {
|
||||
BN_GF2m_mod(c, a, b[j]);
|
||||
BN_GF2m_add(d, a, c);
|
||||
BN_GF2m_mod(e, d, b[j]);
|
||||
/* Test that a + (a mod p) mod p == 0. */
|
||||
if (!TEST_BN_eq_zero(e))
|
||||
if (!(TEST_true(BN_GF2m_mod(c, a, b[j]))
|
||||
&& TEST_true(BN_GF2m_add(d, a, c))
|
||||
&& TEST_true(BN_GF2m_mod(e, d, b[j]))
|
||||
/* Test that a + (a mod p) mod p == 0. */
|
||||
&& TEST_BN_eq_zero(e)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -671,22 +693,24 @@ static int test_gf2m_mul(void)
|
|||
|| !TEST_ptr(h = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_GF2m_arr2poly(p0, b[0]);
|
||||
BN_GF2m_arr2poly(p1, b[1]);
|
||||
if (!(TEST_true(BN_GF2m_arr2poly(p0, b[0]))
|
||||
&& TEST_true(BN_GF2m_arr2poly(p1, b[1]))))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(a, 1024, 0, 0);
|
||||
BN_bntest_rand(c, 1024, 0, 0);
|
||||
BN_bntest_rand(d, 1024, 0, 0);
|
||||
if (!(TEST_true(BN_bntest_rand(a, 1024, 0, 0))
|
||||
&& TEST_true(BN_bntest_rand(c, 1024, 0, 0))
|
||||
&& TEST_true(BN_bntest_rand(d, 1024, 0, 0))))
|
||||
goto err;
|
||||
for (j = 0; j < 2; j++) {
|
||||
BN_GF2m_mod_mul(e, a, c, b[j], ctx);
|
||||
BN_GF2m_add(f, a, d);
|
||||
BN_GF2m_mod_mul(g, f, c, b[j], ctx);
|
||||
BN_GF2m_mod_mul(h, d, c, b[j], ctx);
|
||||
BN_GF2m_add(f, e, g);
|
||||
BN_GF2m_add(f, f, h);
|
||||
/* Test that (a+d)*c = a*c + d*c. */
|
||||
if (!TEST_BN_eq_zero(f))
|
||||
if (!(TEST_true(BN_GF2m_mod_mul(e, a, c, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_add(f, a, d))
|
||||
&& TEST_true(BN_GF2m_mod_mul(g, f, c, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_mod_mul(h, d, c, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_add(f, e, g))
|
||||
&& TEST_true(BN_GF2m_add(f, f, h))
|
||||
/* Test that (a+d)*c = a*c + d*c. */
|
||||
&& TEST_BN_eq_zero(f)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -717,18 +741,20 @@ static int test_gf2m_sqr(void)
|
|||
|| !TEST_ptr(d = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_GF2m_arr2poly(p0, b[0]);
|
||||
BN_GF2m_arr2poly(p1, b[1]);
|
||||
if (!(TEST_true(BN_GF2m_arr2poly(p0, b[0]))
|
||||
&& TEST_true(BN_GF2m_arr2poly(p1, b[1]))))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(a, 1024, 0, 0);
|
||||
if (!TEST_true(BN_bntest_rand(a, 1024, 0, 0)))
|
||||
goto err;
|
||||
for (j = 0; j < 2; j++) {
|
||||
BN_GF2m_mod_sqr(c, a, b[j], ctx);
|
||||
BN_copy(d, a);
|
||||
BN_GF2m_mod_mul(d, a, d, b[j], ctx);
|
||||
BN_GF2m_add(d, c, d);
|
||||
/* Test that a*a = a^2. */
|
||||
if (!TEST_BN_eq_zero(d))
|
||||
if (!(TEST_true(BN_GF2m_mod_sqr(c, a, b[j], ctx))
|
||||
&& TEST_true(BN_copy(d, a))
|
||||
&& TEST_true(BN_GF2m_mod_mul(d, a, d, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_add(d, c, d))
|
||||
/* Test that a*a = a^2. */
|
||||
&& TEST_BN_eq_zero(d)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -754,16 +780,18 @@ static int test_gf2m_modinv(void)
|
|||
|| !TEST_ptr(d = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_GF2m_arr2poly(p0, b[0]);
|
||||
BN_GF2m_arr2poly(p1, b[1]);
|
||||
if (!(TEST_true(BN_GF2m_arr2poly(p0, b[0]))
|
||||
&& TEST_true(BN_GF2m_arr2poly(p1, b[1]))))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(a, 512, 0, 0);
|
||||
if (!TEST_true(BN_bntest_rand(a, 512, 0, 0)))
|
||||
goto err;
|
||||
for (j = 0; j < 2; j++) {
|
||||
BN_GF2m_mod_inv(c, a, b[j], ctx);
|
||||
BN_GF2m_mod_mul(d, a, c, b[j], ctx);
|
||||
/* Test that ((1/a)*a) = 1. */
|
||||
if (!TEST_BN_eq_one(d))
|
||||
if (!(TEST_true(BN_GF2m_mod_inv(c, a, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_mod_mul(d, a, c, b[j], ctx))
|
||||
/* Test that ((1/a)*a) = 1. */
|
||||
&& TEST_BN_eq_one(d)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -792,18 +820,20 @@ static int test_gf2m_moddiv(void)
|
|||
|| !TEST_ptr(f = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_GF2m_arr2poly(p0, b[0]);
|
||||
BN_GF2m_arr2poly(p1, b[1]);
|
||||
if (!(TEST_true(BN_GF2m_arr2poly(p0, b[0]))
|
||||
&& TEST_true(BN_GF2m_arr2poly(p1, b[1]))))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(a, 512, 0, 0);
|
||||
BN_bntest_rand(c, 512, 0, 0);
|
||||
if (!(TEST_true(BN_bntest_rand(a, 512, 0, 0))
|
||||
&& TEST_true(BN_bntest_rand(c, 512, 0, 0))))
|
||||
goto err;
|
||||
for (j = 0; j < 2; j++) {
|
||||
BN_GF2m_mod_div(d, a, c, b[j], ctx);
|
||||
BN_GF2m_mod_mul(e, d, c, b[j], ctx);
|
||||
BN_GF2m_mod_div(f, a, e, b[j], ctx);
|
||||
/* Test that ((a/c)*c)/a = 1. */
|
||||
if (!TEST_BN_eq_one(f))
|
||||
if (!(TEST_true(BN_GF2m_mod_div(d, a, c, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_mod_mul(e, d, c, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_mod_div(f, a, e, b[j], ctx))
|
||||
/* Test that ((a/c)*c)/a = 1. */
|
||||
&& TEST_BN_eq_one(f)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -834,22 +864,24 @@ static int test_gf2m_modexp(void)
|
|||
|| !TEST_ptr(f = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_GF2m_arr2poly(p0, b[0]);
|
||||
BN_GF2m_arr2poly(p1, b[1]);
|
||||
if (!(TEST_true(BN_GF2m_arr2poly(p0, b[0]))
|
||||
&& TEST_true(BN_GF2m_arr2poly(p1, b[1]))))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(a, 512, 0, 0);
|
||||
BN_bntest_rand(c, 512, 0, 0);
|
||||
BN_bntest_rand(d, 512, 0, 0);
|
||||
if (!(TEST_true(BN_bntest_rand(a, 512, 0, 0))
|
||||
&& TEST_true(BN_bntest_rand(c, 512, 0, 0))
|
||||
&& TEST_true(BN_bntest_rand(d, 512, 0, 0))))
|
||||
goto err;
|
||||
for (j = 0; j < 2; j++) {
|
||||
BN_GF2m_mod_exp(e, a, c, b[j], ctx);
|
||||
BN_GF2m_mod_exp(f, a, d, b[j], ctx);
|
||||
BN_GF2m_mod_mul(e, e, f, b[j], ctx);
|
||||
BN_add(f, c, d);
|
||||
BN_GF2m_mod_exp(f, a, f, b[j], ctx);
|
||||
BN_GF2m_add(f, e, f);
|
||||
/* Test that a^(c+d)=a^c*a^d. */
|
||||
if (!TEST_BN_eq_zero(f))
|
||||
if (!(TEST_true(BN_GF2m_mod_exp(e, a, c, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_mod_exp(f, a, d, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_mod_mul(e, e, f, b[j], ctx))
|
||||
&& TEST_true(BN_add(f, c, d))
|
||||
&& TEST_true(BN_GF2m_mod_exp(f, a, f, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_add(f, e, f))
|
||||
/* Test that a^(c+d)=a^c*a^d. */
|
||||
&& TEST_BN_eq_zero(f)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -880,18 +912,21 @@ static int test_gf2m_modsqrt(void)
|
|||
|| !TEST_ptr(f = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_GF2m_arr2poly(p0, b[0]);
|
||||
BN_GF2m_arr2poly(p1, b[1]);
|
||||
if (!(TEST_true(BN_GF2m_arr2poly(p0, b[0]))
|
||||
&& TEST_true(BN_GF2m_arr2poly(p1, b[1]))))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(a, 512, 0, 0);
|
||||
if (!TEST_true(BN_bntest_rand(a, 512, 0, 0)))
|
||||
goto err;
|
||||
|
||||
for (j = 0; j < 2; j++) {
|
||||
BN_GF2m_mod(c, a, b[j]);
|
||||
BN_GF2m_mod_sqrt(d, a, b[j], ctx);
|
||||
BN_GF2m_mod_sqr(e, d, b[j], ctx);
|
||||
BN_GF2m_add(f, c, e);
|
||||
/* Test that d^2 = a, where d = sqrt(a). */
|
||||
if (!TEST_BN_eq_zero(f))
|
||||
if (!(TEST_true(BN_GF2m_mod(c, a, b[j]))
|
||||
&& TEST_true(BN_GF2m_mod_sqrt(d, a, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_mod_sqr(e, d, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_add(f, c, e))
|
||||
/* Test that d^2 = a, where d = sqrt(a). */
|
||||
&& TEST_BN_eq_zero(f)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
@ -921,23 +956,26 @@ static int test_gf2m_modsolvequad(void)
|
|||
|| !TEST_ptr(e = BN_new()))
|
||||
goto err;
|
||||
|
||||
BN_GF2m_arr2poly(p0, b[0]);
|
||||
BN_GF2m_arr2poly(p1, b[1]);
|
||||
if (!(TEST_true(BN_GF2m_arr2poly(p0, b[0]))
|
||||
&& TEST_true(BN_GF2m_arr2poly(p1, b[1]))))
|
||||
goto err;
|
||||
|
||||
for (i = 0; i < NUM0; i++) {
|
||||
BN_bntest_rand(a, 512, 0, 0);
|
||||
if (!TEST_true(BN_bntest_rand(a, 512, 0, 0)))
|
||||
goto err;
|
||||
for (j = 0; j < 2; j++) {
|
||||
t = BN_GF2m_mod_solve_quad(c, a, b[j], ctx);
|
||||
if (t) {
|
||||
s++;
|
||||
BN_GF2m_mod_sqr(d, c, b[j], ctx);
|
||||
BN_GF2m_add(d, c, d);
|
||||
BN_GF2m_mod(e, a, b[j]);
|
||||
BN_GF2m_add(e, e, d);
|
||||
/*
|
||||
* Test that solution of quadratic c satisfies c^2 + c = a.
|
||||
*/
|
||||
if (!TEST_BN_eq_zero(e))
|
||||
if (!(TEST_true(BN_GF2m_mod_sqr(d, c, b[j], ctx))
|
||||
&& TEST_true(BN_GF2m_add(d, c, d))
|
||||
&& TEST_true(BN_GF2m_mod(e, a, b[j]))
|
||||
&& TEST_true(BN_GF2m_add(e, e, d))
|
||||
/*
|
||||
* Test that solution of quadratic c
|
||||
* satisfies c^2 + c = a.
|
||||
*/
|
||||
&& TEST_BN_eq_zero(e)))
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,32 +8,27 @@
|
|||
* https://www.openssl.org/source/license.html
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <openssl/opensslconf.h> /* To see if OPENSSL_NO_EC is defined */
|
||||
#include "testutil.h"
|
||||
|
||||
#ifndef OPENSSL_NO_EC
|
||||
|
||||
# include <openssl/crypto.h>
|
||||
# include <openssl/bio.h>
|
||||
# include <openssl/evp.h>
|
||||
# include <openssl/bn.h>
|
||||
# include <openssl/ec.h>
|
||||
# ifndef OPENSSL_NO_ENGINE
|
||||
# include <openssl/engine.h>
|
||||
# endif
|
||||
# include <openssl/sha.h>
|
||||
# include <openssl/err.h>
|
||||
# include <openssl/rand.h>
|
||||
# include "internal/nelem.h"
|
||||
# include "ecdsatest.h"
|
||||
|
||||
/* functions to change the RAND_METHOD */
|
||||
static int fbytes(unsigned char *buf, int num);
|
||||
|
||||
static RAND_METHOD fake_rand;
|
||||
static const RAND_METHOD *old_rand;
|
||||
static int use_fake = 0;
|
||||
static const char *numbers[2];
|
||||
static size_t crv_len = 0;
|
||||
static EC_builtin_curve *curves = NULL;
|
||||
|
||||
static int change_rand(void)
|
||||
{
|
||||
|
@ -57,25 +52,10 @@ static int restore_rand(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static int fbytes_counter = 0, use_fake = 0;
|
||||
static const char *numbers[8] = {
|
||||
"651056770906015076056810763456358567190100156695615665659",
|
||||
"6140507067065001063065065565667405560006161556565665656654",
|
||||
"8763001015071075675010661307616710783570106710677817767166"
|
||||
"71676178726717",
|
||||
"7000000175690566466555057817571571075705015757757057795755"
|
||||
"55657156756655",
|
||||
"1275552191113212300012030439187146164646146646466749494799",
|
||||
"1542725565216523985789236956265265265235675811949404040041",
|
||||
"1456427555219115346513212300075341203043918714616464614664"
|
||||
"64667494947990",
|
||||
"1712787255652165239672857892369562652652652356758119494040"
|
||||
"40041670216363"
|
||||
};
|
||||
|
||||
static int fbytes(unsigned char *buf, int num)
|
||||
{
|
||||
int ret = 0;
|
||||
static int fbytes_counter = 0;
|
||||
BIGNUM *tmp = NULL;
|
||||
|
||||
if (use_fake == 0)
|
||||
|
@ -83,316 +63,254 @@ static int fbytes(unsigned char *buf, int num)
|
|||
|
||||
use_fake = 0;
|
||||
|
||||
if (fbytes_counter >= 8)
|
||||
return 0;
|
||||
if (!TEST_ptr(tmp = BN_new()))
|
||||
return 0;
|
||||
if (!TEST_true(BN_dec2bn(&tmp, numbers[fbytes_counter]))) {
|
||||
BN_free(tmp);
|
||||
return 0;
|
||||
}
|
||||
fbytes_counter++;
|
||||
if (TEST_int_eq(BN_num_bytes(tmp), num)
|
||||
&& TEST_true(BN_bn2bin(tmp, buf)))
|
||||
ret = 1;
|
||||
if (!TEST_ptr(tmp = BN_new())
|
||||
|| !TEST_int_lt(fbytes_counter, OSSL_NELEM(numbers))
|
||||
|| !TEST_true(BN_hex2bn(&tmp, numbers[fbytes_counter]))
|
||||
/* tmp might need leading zeros so pad it out */
|
||||
|| !TEST_int_le(BN_num_bytes(tmp), num)
|
||||
|| !TEST_true(BN_bn2binpad(tmp, buf, num)))
|
||||
goto err;
|
||||
|
||||
fbytes_counter = (fbytes_counter + 1) % OSSL_NELEM(numbers);
|
||||
ret = 1;
|
||||
err:
|
||||
BN_free(tmp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* some tests from the X9.62 draft */
|
||||
static int x9_62_test_internal(int nid, const char *r_in, const char *s_in)
|
||||
/*-
|
||||
* This function hijacks the RNG to feed it the chosen ECDSA key and nonce.
|
||||
* The ECDSA KATs are from:
|
||||
* - the X9.62 draft (4)
|
||||
* - NIST CAVP (720)
|
||||
*
|
||||
* It uses the low-level ECDSA_sign_setup instead of EVP to control the RNG.
|
||||
* NB: This is not how applications should use ECDSA; this is only for testing.
|
||||
*
|
||||
* Tests the library can successfully:
|
||||
* - generate public keys that matches those KATs
|
||||
* - create ECDSA signatures that match those KATs
|
||||
* - accept those signatures as valid
|
||||
*/
|
||||
static int x9_62_tests(int n)
|
||||
{
|
||||
int ret = 0;
|
||||
const char message[] = "abc";
|
||||
unsigned char digest[SHA_DIGEST_LENGTH];
|
||||
int nid, md_nid, ret = 0;
|
||||
const char *r_in = NULL, *s_in = NULL, *tbs = NULL;
|
||||
unsigned char *pbuf = NULL, *qbuf = NULL, *message = NULL;
|
||||
unsigned char digest[EVP_MAX_MD_SIZE];
|
||||
unsigned int dgst_len = 0;
|
||||
EVP_MD_CTX *md_ctx;
|
||||
long q_len, msg_len = 0;
|
||||
size_t p_len;
|
||||
EVP_MD_CTX *mctx = NULL;
|
||||
EC_KEY *key = NULL;
|
||||
ECDSA_SIG *signature = NULL;
|
||||
BIGNUM *r = NULL, *s = NULL;
|
||||
BIGNUM *kinv = NULL, *rp = NULL;
|
||||
const BIGNUM *sig_r, *sig_s;
|
||||
const BIGNUM *sig_r = NULL, *sig_s = NULL;
|
||||
|
||||
if (!TEST_ptr(md_ctx = EVP_MD_CTX_new()))
|
||||
goto x962_int_err;
|
||||
nid = ecdsa_cavs_kats[n].nid;
|
||||
md_nid = ecdsa_cavs_kats[n].md_nid;
|
||||
r_in = ecdsa_cavs_kats[n].r;
|
||||
s_in = ecdsa_cavs_kats[n].s;
|
||||
tbs = ecdsa_cavs_kats[n].msg;
|
||||
numbers[0] = ecdsa_cavs_kats[n].d;
|
||||
numbers[1] = ecdsa_cavs_kats[n].k;
|
||||
|
||||
/* get the message digest */
|
||||
if (!TEST_true(EVP_DigestInit(md_ctx, EVP_sha1()))
|
||||
|| !TEST_true(EVP_DigestUpdate(md_ctx, (const void *)message, 3))
|
||||
|| !TEST_true(EVP_DigestFinal(md_ctx, digest, &dgst_len)))
|
||||
goto x962_int_err;
|
||||
TEST_info("ECDSA KATs for curve %s", OBJ_nid2sn(nid));
|
||||
|
||||
TEST_info("testing %s", OBJ_nid2sn(nid));
|
||||
if (!TEST_ptr(mctx = EVP_MD_CTX_new())
|
||||
/* get the message digest */
|
||||
|| !TEST_ptr(message = OPENSSL_hexstr2buf(tbs, &msg_len))
|
||||
|| !TEST_true(EVP_DigestInit_ex(mctx, EVP_get_digestbynid(md_nid), NULL))
|
||||
|| !TEST_true(EVP_DigestUpdate(mctx, message, msg_len))
|
||||
|| !TEST_true(EVP_DigestFinal_ex(mctx, digest, &dgst_len))
|
||||
/* create the key */
|
||||
|| !TEST_ptr(key = EC_KEY_new_by_curve_name(nid))
|
||||
/* load KAT variables */
|
||||
|| !TEST_ptr(r = BN_new())
|
||||
|| !TEST_ptr(s = BN_new())
|
||||
|| !TEST_true(BN_hex2bn(&r, r_in))
|
||||
|| !TEST_true(BN_hex2bn(&s, s_in))
|
||||
/* swap the RNG source */
|
||||
|| !TEST_true(change_rand()))
|
||||
goto err;
|
||||
|
||||
/* create the key */
|
||||
if (!TEST_ptr(key = EC_KEY_new_by_curve_name(nid)))
|
||||
goto x962_int_err;
|
||||
/* public key must match KAT */
|
||||
use_fake = 1;
|
||||
if (!TEST_true(EC_KEY_generate_key(key)))
|
||||
goto x962_int_err;
|
||||
if (!TEST_true(EC_KEY_generate_key(key))
|
||||
|| !TEST_true(p_len = EC_KEY_key2buf(key, POINT_CONVERSION_UNCOMPRESSED,
|
||||
&pbuf, NULL))
|
||||
|| !TEST_ptr(qbuf = OPENSSL_hexstr2buf(ecdsa_cavs_kats[n].Q, &q_len))
|
||||
|| !TEST_int_eq(q_len, p_len)
|
||||
|| !TEST_mem_eq(qbuf, q_len, pbuf, p_len))
|
||||
goto err;
|
||||
|
||||
/* create the signature */
|
||||
/* create the signature via ECDSA_sign_setup to avoid use of ECDSA nonces */
|
||||
use_fake = 1;
|
||||
/* Use ECDSA_sign_setup to avoid use of ECDSA nonces */
|
||||
if (!TEST_true(ECDSA_sign_setup(key, NULL, &kinv, &rp)))
|
||||
goto x962_int_err;
|
||||
if (!TEST_ptr(signature =
|
||||
ECDSA_do_sign_ex(digest, SHA_DIGEST_LENGTH, kinv, rp, key)))
|
||||
goto x962_int_err;
|
||||
if (!TEST_true(ECDSA_sign_setup(key, NULL, &kinv, &rp))
|
||||
|| !TEST_ptr(signature = ECDSA_do_sign_ex(digest, dgst_len,
|
||||
kinv, rp, key))
|
||||
/* verify the signature */
|
||||
|| !TEST_int_eq(ECDSA_do_verify(digest, dgst_len, signature, key), 1))
|
||||
goto err;
|
||||
|
||||
/* compare the created signature with the expected signature */
|
||||
if (!TEST_ptr(r = BN_new()) || !TEST_ptr(s = BN_new()))
|
||||
goto x962_int_err;
|
||||
if (!TEST_true(BN_dec2bn(&r, r_in)) || !TEST_true(BN_dec2bn(&s, s_in)))
|
||||
goto x962_int_err;
|
||||
ECDSA_SIG_get0(signature, &sig_r, &sig_s);
|
||||
if (!TEST_BN_eq(sig_r, r)
|
||||
|| !TEST_BN_eq(sig_s, s))
|
||||
goto x962_int_err;
|
||||
|
||||
/* verify the signature */
|
||||
if (!TEST_int_eq(ECDSA_do_verify(digest, SHA_DIGEST_LENGTH,
|
||||
signature, key), 1))
|
||||
goto x962_int_err;
|
||||
|| !TEST_BN_eq(sig_s, s))
|
||||
goto err;
|
||||
|
||||
ret = 1;
|
||||
|
||||
x962_int_err:
|
||||
err:
|
||||
/* restore the RNG source */
|
||||
if (!TEST_true(restore_rand()))
|
||||
ret = 0;
|
||||
|
||||
OPENSSL_free(message);
|
||||
OPENSSL_free(pbuf);
|
||||
OPENSSL_free(qbuf);
|
||||
EC_KEY_free(key);
|
||||
ECDSA_SIG_free(signature);
|
||||
BN_free(r);
|
||||
BN_free(s);
|
||||
EVP_MD_CTX_free(md_ctx);
|
||||
EVP_MD_CTX_free(mctx);
|
||||
BN_clear_free(kinv);
|
||||
BN_clear_free(rp);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int x9_62_tests(void)
|
||||
/*-
|
||||
* Positive and negative ECDSA testing through EVP interface:
|
||||
* - EVP_DigestSign (this is the one-shot version)
|
||||
* - EVP_DigestVerify
|
||||
*
|
||||
* Tests the library can successfully:
|
||||
* - create a key
|
||||
* - create a signature
|
||||
* - accept that signature
|
||||
* - reject that signature with a different public key
|
||||
* - reject that signature if its length is not correct
|
||||
* - reject that signature after modifying the message
|
||||
* - accept that signature after un-modifying the message
|
||||
* - reject that signature after modifying the signature
|
||||
* - accept that signature after un-modifying the signature
|
||||
*/
|
||||
static int test_builtin(int n)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
/* set own rand method */
|
||||
if (!change_rand())
|
||||
goto x962_err;
|
||||
|
||||
if (!TEST_true(x9_62_test_internal(NID_X9_62_prime192v1,
|
||||
"3342403536405981729393488334694600415596881826869351677613",
|
||||
"5735822328888155254683894997897571951568553642892029982342")))
|
||||
goto x962_err;
|
||||
if (!TEST_true(x9_62_test_internal(NID_X9_62_prime239v1,
|
||||
"3086361431751678114926225473006680188549593787585317781474"
|
||||
"62058306432176",
|
||||
"3238135532097973577080787768312505059318910517550078427819"
|
||||
"78505179448783")))
|
||||
goto x962_err;
|
||||
|
||||
# ifndef OPENSSL_NO_EC2M
|
||||
if (!TEST_true(x9_62_test_internal(NID_X9_62_c2tnb191v1,
|
||||
"87194383164871543355722284926904419997237591535066528048",
|
||||
"308992691965804947361541664549085895292153777025772063598")))
|
||||
goto x962_err;
|
||||
if (!TEST_true(x9_62_test_internal(NID_X9_62_c2tnb239v1,
|
||||
"2159633321041961198501834003903461262881815148684178964245"
|
||||
"5876922391552",
|
||||
"1970303740007316867383349976549972270528498040721988191026"
|
||||
"49413465737174")))
|
||||
goto x962_err;
|
||||
# endif
|
||||
ret = 1;
|
||||
|
||||
x962_err:
|
||||
if (!TEST_true(restore_rand()))
|
||||
ret = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int test_builtin(void)
|
||||
{
|
||||
EC_builtin_curve *curves = NULL;
|
||||
size_t crv_len = 0, n = 0;
|
||||
EC_KEY *eckey = NULL, *wrong_eckey = NULL;
|
||||
EC_GROUP *group;
|
||||
ECDSA_SIG *ecdsa_sig = NULL, *modified_sig = NULL;
|
||||
unsigned char digest[SHA512_DIGEST_LENGTH];
|
||||
unsigned char wrong_digest[SHA512_DIGEST_LENGTH];
|
||||
unsigned char *signature = NULL;
|
||||
const unsigned char *sig_ptr;
|
||||
unsigned char *sig_ptr2;
|
||||
unsigned char *raw_buf = NULL;
|
||||
const BIGNUM *sig_r, *sig_s;
|
||||
BIGNUM *modified_r = NULL, *modified_s = NULL;
|
||||
BIGNUM *unmodified_r = NULL, *unmodified_s = NULL;
|
||||
unsigned int sig_len, order, r_len, s_len, bn_len, buf_len;
|
||||
EC_KEY *eckey_neg = NULL, *eckey = NULL;
|
||||
unsigned char dirt, offset, tbs[128];
|
||||
unsigned char *sig = NULL;
|
||||
EVP_PKEY *pkey_neg = NULL, *pkey = NULL;
|
||||
EVP_MD_CTX *mctx = NULL;
|
||||
size_t sig_len;
|
||||
int nid, ret = 0;
|
||||
|
||||
/* fill digest values with some random data */
|
||||
if (!TEST_true(RAND_bytes(digest, SHA512_DIGEST_LENGTH))
|
||||
|| !TEST_true(RAND_bytes(wrong_digest, SHA512_DIGEST_LENGTH)))
|
||||
goto builtin_err;
|
||||
nid = curves[n].nid;
|
||||
|
||||
/* create and verify a ecdsa signature with every available curve */
|
||||
/* get a list of all internal curves */
|
||||
crv_len = EC_get_builtin_curves(NULL, 0);
|
||||
if (!TEST_ptr(curves = OPENSSL_malloc(sizeof(*curves) * crv_len))
|
||||
|| !TEST_true(EC_get_builtin_curves(curves, crv_len)))
|
||||
goto builtin_err;
|
||||
|
||||
/* now create and verify a signature for every curve */
|
||||
for (n = 0; n < crv_len; n++) {
|
||||
unsigned char dirt, offset;
|
||||
|
||||
nid = curves[n].nid;
|
||||
if (nid == NID_ipsec4 || nid == NID_ipsec3)
|
||||
continue;
|
||||
/* create new ecdsa key (== EC_KEY) */
|
||||
if (!TEST_ptr(eckey = EC_KEY_new())
|
||||
|| !TEST_ptr(group = EC_GROUP_new_by_curve_name(nid))
|
||||
|| !TEST_true(EC_KEY_set_group(eckey, group)))
|
||||
goto builtin_err;
|
||||
EC_GROUP_free(group);
|
||||
order = EC_GROUP_order_bits(EC_KEY_get0_group(eckey));
|
||||
|
||||
TEST_info("testing %s", OBJ_nid2sn(nid));
|
||||
|
||||
/* create key */
|
||||
if (!TEST_true(EC_KEY_generate_key(eckey)))
|
||||
goto builtin_err;
|
||||
/* create second key */
|
||||
if (!TEST_ptr(wrong_eckey = EC_KEY_new())
|
||||
|| !TEST_ptr(group = EC_GROUP_new_by_curve_name(nid))
|
||||
|| !TEST_true(EC_KEY_set_group(wrong_eckey, group)))
|
||||
goto builtin_err;
|
||||
EC_GROUP_free(group);
|
||||
if (!TEST_true(EC_KEY_generate_key(wrong_eckey)))
|
||||
goto builtin_err;
|
||||
|
||||
/* check key */
|
||||
if (!TEST_true(EC_KEY_check_key(eckey)))
|
||||
goto builtin_err;
|
||||
|
||||
/* create signature */
|
||||
sig_len = ECDSA_size(eckey);
|
||||
if (!TEST_ptr(signature = OPENSSL_malloc(sig_len))
|
||||
|| !TEST_true(ECDSA_sign(0, digest, SHA512_DIGEST_LENGTH,
|
||||
signature, &sig_len, eckey)))
|
||||
goto builtin_err;
|
||||
|
||||
/* verify signature */
|
||||
if (!TEST_int_eq(ECDSA_verify(0, digest, SHA512_DIGEST_LENGTH,
|
||||
signature, sig_len, eckey),
|
||||
1))
|
||||
goto builtin_err;
|
||||
|
||||
/* verify signature with the wrong key */
|
||||
if (!TEST_int_ne(ECDSA_verify(0, digest, SHA512_DIGEST_LENGTH,
|
||||
signature, sig_len, wrong_eckey),
|
||||
1))
|
||||
goto builtin_err;
|
||||
|
||||
/* wrong digest */
|
||||
if (!TEST_int_ne(ECDSA_verify(0, wrong_digest, SHA512_DIGEST_LENGTH,
|
||||
signature, sig_len, eckey),
|
||||
1))
|
||||
goto builtin_err;
|
||||
|
||||
/* wrong length */
|
||||
if (!TEST_int_ne(ECDSA_verify(0, digest, SHA512_DIGEST_LENGTH,
|
||||
signature, sig_len - 1, eckey),
|
||||
1))
|
||||
goto builtin_err;
|
||||
|
||||
/*
|
||||
* Modify a single byte of the signature: to ensure we don't garble
|
||||
* the ASN1 structure, we read the raw signature and modify a byte in
|
||||
* one of the bignums directly.
|
||||
*/
|
||||
sig_ptr = signature;
|
||||
if (!TEST_ptr(ecdsa_sig = d2i_ECDSA_SIG(NULL, &sig_ptr, sig_len)))
|
||||
goto builtin_err;
|
||||
|
||||
ECDSA_SIG_get0(ecdsa_sig, &sig_r, &sig_s);
|
||||
|
||||
/* Store the two BIGNUMs in raw_buf. */
|
||||
r_len = BN_num_bytes(sig_r);
|
||||
s_len = BN_num_bytes(sig_s);
|
||||
bn_len = (order + 7) / 8;
|
||||
if (!TEST_false(r_len > bn_len)
|
||||
|| !TEST_false(s_len > bn_len))
|
||||
goto builtin_err;
|
||||
buf_len = 2 * bn_len;
|
||||
if (!TEST_ptr(raw_buf = OPENSSL_zalloc(buf_len)))
|
||||
goto builtin_err;
|
||||
BN_bn2bin(sig_r, raw_buf + bn_len - r_len);
|
||||
BN_bn2bin(sig_s, raw_buf + buf_len - s_len);
|
||||
|
||||
/* Modify a single byte in the buffer. */
|
||||
offset = raw_buf[10] % buf_len;
|
||||
dirt = raw_buf[11] ? raw_buf[11] : 1;
|
||||
raw_buf[offset] ^= dirt;
|
||||
|
||||
/* Now read the BIGNUMs back in from raw_buf. */
|
||||
if (!TEST_ptr(modified_sig = ECDSA_SIG_new()))
|
||||
goto builtin_err;
|
||||
if (!TEST_ptr(modified_r = BN_bin2bn(raw_buf, bn_len, NULL))
|
||||
|| !TEST_ptr(modified_s = BN_bin2bn(raw_buf + bn_len,
|
||||
bn_len, NULL))
|
||||
|| !TEST_true(ECDSA_SIG_set0(modified_sig,
|
||||
modified_r, modified_s))) {
|
||||
BN_free(modified_r);
|
||||
BN_free(modified_s);
|
||||
goto builtin_err;
|
||||
}
|
||||
sig_ptr2 = signature;
|
||||
sig_len = i2d_ECDSA_SIG(modified_sig, &sig_ptr2);
|
||||
if (!TEST_false(ECDSA_verify(0, digest, SHA512_DIGEST_LENGTH,
|
||||
signature, sig_len, eckey)))
|
||||
goto builtin_err;
|
||||
|
||||
/* Sanity check: undo the modification and verify signature. */
|
||||
raw_buf[offset] ^= dirt;
|
||||
if (!TEST_ptr(unmodified_r = BN_bin2bn(raw_buf, bn_len, NULL))
|
||||
|| !TEST_ptr(unmodified_s = BN_bin2bn(raw_buf + bn_len,
|
||||
bn_len, NULL))
|
||||
|| !TEST_true(ECDSA_SIG_set0(modified_sig, unmodified_r,
|
||||
unmodified_s))) {
|
||||
BN_free(unmodified_r);
|
||||
BN_free(unmodified_s);
|
||||
goto builtin_err;
|
||||
}
|
||||
|
||||
sig_ptr2 = signature;
|
||||
sig_len = i2d_ECDSA_SIG(modified_sig, &sig_ptr2);
|
||||
if (!TEST_true(ECDSA_verify(0, digest, SHA512_DIGEST_LENGTH,
|
||||
signature, sig_len, eckey)))
|
||||
goto builtin_err;
|
||||
|
||||
/* cleanup */
|
||||
ERR_clear_error();
|
||||
OPENSSL_free(signature);
|
||||
signature = NULL;
|
||||
EC_KEY_free(eckey);
|
||||
eckey = NULL;
|
||||
EC_KEY_free(wrong_eckey);
|
||||
wrong_eckey = NULL;
|
||||
ECDSA_SIG_free(ecdsa_sig);
|
||||
ecdsa_sig = NULL;
|
||||
ECDSA_SIG_free(modified_sig);
|
||||
modified_sig = NULL;
|
||||
OPENSSL_free(raw_buf);
|
||||
raw_buf = NULL;
|
||||
/* skip built-in curves where ord(G) is not prime */
|
||||
if (nid == NID_ipsec4 || nid == NID_ipsec3) {
|
||||
TEST_info("skipped: ECDSA unsupported for curve %s", OBJ_nid2sn(nid));
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = 1;
|
||||
builtin_err:
|
||||
EC_KEY_free(eckey);
|
||||
EC_KEY_free(wrong_eckey);
|
||||
ECDSA_SIG_free(ecdsa_sig);
|
||||
ECDSA_SIG_free(modified_sig);
|
||||
OPENSSL_free(signature);
|
||||
OPENSSL_free(raw_buf);
|
||||
OPENSSL_free(curves);
|
||||
TEST_info("testing ECDSA for curve %s", OBJ_nid2sn(nid));
|
||||
|
||||
if (!TEST_ptr(mctx = EVP_MD_CTX_new())
|
||||
/* get some random message data */
|
||||
|| !TEST_true(RAND_bytes(tbs, sizeof(tbs)))
|
||||
/* real key */
|
||||
|| !TEST_ptr(eckey = EC_KEY_new_by_curve_name(nid))
|
||||
|| !TEST_true(EC_KEY_generate_key(eckey))
|
||||
|| !TEST_ptr(pkey = EVP_PKEY_new())
|
||||
|| !TEST_true(EVP_PKEY_assign_EC_KEY(pkey, eckey))
|
||||
/* fake key for negative testing */
|
||||
|| !TEST_ptr(eckey_neg = EC_KEY_new_by_curve_name(nid))
|
||||
|| !TEST_true(EC_KEY_generate_key(eckey_neg))
|
||||
|| !TEST_ptr(pkey_neg = EVP_PKEY_new())
|
||||
|| !TEST_true(EVP_PKEY_assign_EC_KEY(pkey_neg, eckey_neg)))
|
||||
goto err;
|
||||
|
||||
sig_len = ECDSA_size(eckey);
|
||||
|
||||
if (!TEST_ptr(sig = OPENSSL_malloc(sig_len))
|
||||
/* create a signature */
|
||||
|| !TEST_true(EVP_DigestSignInit(mctx, NULL, NULL, NULL, pkey))
|
||||
|| !TEST_true(EVP_DigestSign(mctx, sig, &sig_len, tbs, sizeof(tbs)))
|
||||
|| !TEST_int_le(sig_len, ECDSA_size(eckey))
|
||||
/* negative test, verify with wrong key, 0 return */
|
||||
|| !TEST_true(EVP_MD_CTX_reset(mctx))
|
||||
|| !TEST_true(EVP_DigestVerifyInit(mctx, NULL, NULL, NULL, pkey_neg))
|
||||
|| !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 0)
|
||||
/* negative test, verify with wrong signature length, -1 return */
|
||||
|| !TEST_true(EVP_MD_CTX_reset(mctx))
|
||||
|| !TEST_true(EVP_DigestVerifyInit(mctx, NULL, NULL, NULL, pkey))
|
||||
|| !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len - 1, tbs, sizeof(tbs)), -1)
|
||||
/* positive test, verify with correct key, 1 return */
|
||||
|| !TEST_true(EVP_MD_CTX_reset(mctx))
|
||||
|| !TEST_true(EVP_DigestVerifyInit(mctx, NULL, NULL, NULL, pkey))
|
||||
|| !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 1))
|
||||
goto err;
|
||||
|
||||
/* muck with the message, test it fails with 0 return */
|
||||
tbs[0] ^= 1;
|
||||
if (!TEST_true(EVP_MD_CTX_reset(mctx))
|
||||
|| !TEST_true(EVP_DigestVerifyInit(mctx, NULL, NULL, NULL, pkey))
|
||||
|| !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 0))
|
||||
goto err;
|
||||
/* un-muck and test it verifies */
|
||||
tbs[0] ^= 1;
|
||||
if (!TEST_true(EVP_MD_CTX_reset(mctx))
|
||||
|| !TEST_true(EVP_DigestVerifyInit(mctx, NULL, NULL, NULL, pkey))
|
||||
|| !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 1))
|
||||
goto err;
|
||||
|
||||
/*-
|
||||
* Muck with the ECDSA signature. The DER encoding is one of:
|
||||
* - 30 LL 02 ..
|
||||
* - 30 81 LL 02 ..
|
||||
*
|
||||
* - Sometimes this mucks with the high level DER sequence wrapper:
|
||||
* in that case, DER-parsing of the whole signature should fail.
|
||||
*
|
||||
* - Sometimes this mucks with the DER-encoding of ECDSA.r:
|
||||
* in that case, DER-parsing of ECDSA.r should fail.
|
||||
*
|
||||
* - Sometimes this mucks with the DER-encoding of ECDSA.s:
|
||||
* in that case, DER-parsing of ECDSA.s should fail.
|
||||
*
|
||||
* - Sometimes this mucks with ECDSA.r:
|
||||
* in that case, the signature verification should fail.
|
||||
*
|
||||
* - Sometimes this mucks with ECDSA.s:
|
||||
* in that case, the signature verification should fail.
|
||||
*
|
||||
* The usual case is changing the integer value of ECDSA.r or ECDSA.s.
|
||||
* Because the ratio of DER overhead to signature bytes is small.
|
||||
* So most of the time it will be one of the last two cases.
|
||||
*
|
||||
* In any case, EVP_PKEY_verify should not return 1 for valid.
|
||||
*/
|
||||
offset = tbs[0] % sig_len;
|
||||
dirt = tbs[1] ? tbs[1] : 1;
|
||||
sig[offset] ^= dirt;
|
||||
if (!TEST_true(EVP_MD_CTX_reset(mctx))
|
||||
|| !TEST_true(EVP_DigestVerifyInit(mctx, NULL, NULL, NULL, pkey))
|
||||
|| !TEST_int_ne(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 1))
|
||||
goto err;
|
||||
/* un-muck and test it verifies */
|
||||
sig[offset] ^= dirt;
|
||||
if (!TEST_true(EVP_MD_CTX_reset(mctx))
|
||||
|| !TEST_true(EVP_DigestVerifyInit(mctx, NULL, NULL, NULL, pkey))
|
||||
|| !TEST_int_eq(EVP_DigestVerify(mctx, sig, sig_len, tbs, sizeof(tbs)), 1))
|
||||
goto err;
|
||||
|
||||
ret = 1;
|
||||
err:
|
||||
EVP_PKEY_free(pkey);
|
||||
EVP_PKEY_free(pkey_neg);
|
||||
EVP_MD_CTX_free(mctx);
|
||||
OPENSSL_free(sig);
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
@ -402,8 +320,20 @@ int setup_tests(void)
|
|||
#ifdef OPENSSL_NO_EC
|
||||
TEST_note("Elliptic curves are disabled.");
|
||||
#else
|
||||
ADD_TEST(x9_62_tests);
|
||||
ADD_TEST(test_builtin);
|
||||
/* get a list of all internal curves */
|
||||
crv_len = EC_get_builtin_curves(NULL, 0);
|
||||
if (!TEST_ptr(curves = OPENSSL_malloc(sizeof(*curves) * crv_len))
|
||||
|| !TEST_true(EC_get_builtin_curves(curves, crv_len)))
|
||||
return 0;
|
||||
ADD_ALL_TESTS(test_builtin, crv_len);
|
||||
ADD_ALL_TESTS(x9_62_tests, OSSL_NELEM(ecdsa_cavs_kats));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
void cleanup_tests(void)
|
||||
{
|
||||
#ifndef OPENSSL_NO_EC
|
||||
OPENSSL_free(curves);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 2001-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright (c) 2002, Oracle and/or its affiliates. All rights reserved
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
|
@ -1403,6 +1403,75 @@ err:
|
|||
BN_CTX_free(ctx);
|
||||
return r;
|
||||
}
|
||||
|
||||
/*
|
||||
* Tests a point known to cause an incorrect underflow in an old version of
|
||||
* ecp_nist521.c
|
||||
*/
|
||||
static int underflow_test(void)
|
||||
{
|
||||
BN_CTX *ctx = NULL;
|
||||
EC_GROUP *grp = NULL;
|
||||
EC_POINT *P = NULL, *Q = NULL, *R = NULL;
|
||||
BIGNUM *x1 = NULL, *y1 = NULL, *z1 = NULL, *x2 = NULL, *y2 = NULL;
|
||||
BIGNUM *k = NULL;
|
||||
int testresult = 0;
|
||||
const char *x1str =
|
||||
"1534f0077fffffe87e9adcfe000000000000000000003e05a21d2400002e031b1f4"
|
||||
"b80000c6fafa4f3c1288798d624a247b5e2ffffffffffffffefe099241900004";
|
||||
const char *p521m1 =
|
||||
"1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"
|
||||
"fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe";
|
||||
|
||||
ctx = BN_CTX_new();
|
||||
if (!TEST_ptr(ctx))
|
||||
return 0;
|
||||
|
||||
BN_CTX_start(ctx);
|
||||
x1 = BN_CTX_get(ctx);
|
||||
y1 = BN_CTX_get(ctx);
|
||||
z1 = BN_CTX_get(ctx);
|
||||
x2 = BN_CTX_get(ctx);
|
||||
y2 = BN_CTX_get(ctx);
|
||||
k = BN_CTX_get(ctx);
|
||||
if (!TEST_ptr(k))
|
||||
goto err;
|
||||
|
||||
grp = EC_GROUP_new_by_curve_name(NID_secp521r1);
|
||||
P = EC_POINT_new(grp);
|
||||
Q = EC_POINT_new(grp);
|
||||
R = EC_POINT_new(grp);
|
||||
if (!TEST_ptr(grp) || !TEST_ptr(P) || !TEST_ptr(Q) || !TEST_ptr(R))
|
||||
goto err;
|
||||
|
||||
if (!TEST_int_gt(BN_hex2bn(&x1, x1str), 0)
|
||||
|| !TEST_int_gt(BN_hex2bn(&y1, p521m1), 0)
|
||||
|| !TEST_int_gt(BN_hex2bn(&z1, p521m1), 0)
|
||||
|| !TEST_int_gt(BN_hex2bn(&k, "02"), 0)
|
||||
|| !TEST_true(EC_POINT_set_Jprojective_coordinates_GFp(grp, P, x1,
|
||||
y1, z1, ctx))
|
||||
|| !TEST_true(EC_POINT_mul(grp, Q, NULL, P, k, ctx))
|
||||
|| !TEST_true(EC_POINT_get_affine_coordinates(grp, Q, x1, y1, ctx))
|
||||
|| !TEST_true(EC_POINT_dbl(grp, R, P, ctx))
|
||||
|| !TEST_true(EC_POINT_get_affine_coordinates(grp, R, x2, y2, ctx)))
|
||||
goto err;
|
||||
|
||||
if (!TEST_int_eq(BN_cmp(x1, x2), 0)
|
||||
|| !TEST_int_eq(BN_cmp(y1, y2), 0))
|
||||
goto err;
|
||||
|
||||
testresult = 1;
|
||||
|
||||
err:
|
||||
BN_CTX_end(ctx);
|
||||
EC_POINT_free(P);
|
||||
EC_POINT_free(Q);
|
||||
EC_POINT_free(R);
|
||||
EC_GROUP_free(grp);
|
||||
BN_CTX_free(ctx);
|
||||
|
||||
return testresult;
|
||||
}
|
||||
# endif
|
||||
|
||||
static const unsigned char p521_named[] = {
|
||||
|
@ -1510,6 +1579,7 @@ int setup_tests(void)
|
|||
# endif
|
||||
# ifndef OPENSSL_NO_EC_NISTP_64_GCC_128
|
||||
ADD_ALL_TESTS(nistp_single_test, OSSL_NELEM(nistp_tests_params));
|
||||
ADD_TEST(underflow_test);
|
||||
# endif
|
||||
ADD_ALL_TESTS(internal_curve_test, crv_len);
|
||||
ADD_ALL_TESTS(internal_curve_test_method, crv_len);
|
||||
|
|
|
@ -509,6 +509,66 @@ static int test_d2i_AutoPrivateKey(int i)
|
|||
}
|
||||
|
||||
#ifndef OPENSSL_NO_EC
|
||||
|
||||
static const unsigned char ec_public_sect163k1_validxy[] = {
|
||||
0x30, 0x40, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
|
||||
0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x01, 0x03, 0x2c, 0x00, 0x04,
|
||||
0x02, 0x84, 0x58, 0xa6, 0xd4, 0xa0, 0x35, 0x2b, 0xae, 0xf0, 0xc0, 0x69,
|
||||
0x05, 0xcf, 0x2a, 0x50, 0x33, 0xf9, 0xe3, 0x92, 0x79, 0x02, 0xd1, 0x7b,
|
||||
0x9f, 0x22, 0x00, 0xf0, 0x3b, 0x0e, 0x5d, 0x2e, 0xb7, 0x23, 0x24, 0xf3,
|
||||
0x6a, 0xd8, 0x17, 0x65, 0x41, 0x2f
|
||||
};
|
||||
|
||||
static const unsigned char ec_public_sect163k1_badx[] = {
|
||||
0x30, 0x40, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
|
||||
0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x01, 0x03, 0x2c, 0x00, 0x04,
|
||||
0x0a, 0x84, 0x58, 0xa6, 0xd4, 0xa0, 0x35, 0x2b, 0xae, 0xf0, 0xc0, 0x69,
|
||||
0x05, 0xcf, 0x2a, 0x50, 0x33, 0xf9, 0xe3, 0x92, 0xb0, 0x02, 0xd1, 0x7b,
|
||||
0x9f, 0x22, 0x00, 0xf0, 0x3b, 0x0e, 0x5d, 0x2e, 0xb7, 0x23, 0x24, 0xf3,
|
||||
0x6a, 0xd8, 0x17, 0x65, 0x41, 0x2f
|
||||
};
|
||||
|
||||
static const unsigned char ec_public_sect163k1_bady[] = {
|
||||
0x30, 0x40, 0x30, 0x10, 0x06, 0x07, 0x2a, 0x86, 0x48, 0xce, 0x3d, 0x02,
|
||||
0x01, 0x06, 0x05, 0x2b, 0x81, 0x04, 0x00, 0x01, 0x03, 0x2c, 0x00, 0x04,
|
||||
0x02, 0x84, 0x58, 0xa6, 0xd4, 0xa0, 0x35, 0x2b, 0xae, 0xf0, 0xc0, 0x69,
|
||||
0x05, 0xcf, 0x2a, 0x50, 0x33, 0xf9, 0xe3, 0x92, 0x79, 0x0a, 0xd1, 0x7b,
|
||||
0x9f, 0x22, 0x00, 0xf0, 0x3b, 0x0e, 0x5d, 0x2e, 0xb7, 0x23, 0x24, 0xf3,
|
||||
0x6a, 0xd8, 0x17, 0x65, 0x41, 0xe6
|
||||
};
|
||||
|
||||
static struct ec_der_pub_keys_st {
|
||||
const unsigned char *der;
|
||||
size_t len;
|
||||
int valid;
|
||||
} ec_der_pub_keys[] = {
|
||||
{ ec_public_sect163k1_validxy, sizeof(ec_public_sect163k1_validxy), 1 },
|
||||
{ ec_public_sect163k1_badx, sizeof(ec_public_sect163k1_badx), 0 },
|
||||
{ ec_public_sect163k1_bady, sizeof(ec_public_sect163k1_bady), 0 },
|
||||
};
|
||||
|
||||
/*
|
||||
* Tests the range of the decoded EC char2 public point.
|
||||
* See ec_GF2m_simple_oct2point().
|
||||
*/
|
||||
static int test_invalide_ec_char2_pub_range_decode(int id)
|
||||
{
|
||||
int ret = 0;
|
||||
BIO *bio = NULL;
|
||||
EC_KEY *eckey = NULL;
|
||||
|
||||
if (!TEST_ptr(bio = BIO_new_mem_buf(ec_der_pub_keys[id].der,
|
||||
ec_der_pub_keys[id].len)))
|
||||
goto err;
|
||||
eckey = d2i_EC_PUBKEY_bio(bio, NULL);
|
||||
ret = (ec_der_pub_keys[id].valid && TEST_ptr(eckey))
|
||||
|| TEST_ptr_null(eckey);
|
||||
err:
|
||||
EC_KEY_free(eckey);
|
||||
BIO_free(bio);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Tests loading a bad key in PKCS8 format */
|
||||
static int test_EVP_PKCS82PKEY(void)
|
||||
{
|
||||
|
@ -1035,6 +1095,8 @@ int setup_tests(void)
|
|||
ADD_TEST(test_HKDF);
|
||||
#ifndef OPENSSL_NO_EC
|
||||
ADD_TEST(test_X509_PUBKEY_inplace);
|
||||
ADD_ALL_TESTS(test_invalide_ec_char2_pub_range_decode,
|
||||
OSSL_NELEM(ec_der_pub_keys));
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -462,6 +462,7 @@ typedef struct cipher_data_st {
|
|||
size_t aad_len;
|
||||
unsigned char *tag;
|
||||
size_t tag_len;
|
||||
int tag_late;
|
||||
} CIPHER_DATA;
|
||||
|
||||
static int cipher_test_init(EVP_TEST *t, const char *alg)
|
||||
|
@ -525,6 +526,15 @@ static int cipher_test_parse(EVP_TEST *t, const char *keyword,
|
|||
return parse_bin(value, &cdat->aad, &cdat->aad_len);
|
||||
if (strcmp(keyword, "Tag") == 0)
|
||||
return parse_bin(value, &cdat->tag, &cdat->tag_len);
|
||||
if (strcmp(keyword, "SetTagLate") == 0) {
|
||||
if (strcmp(value, "TRUE") == 0)
|
||||
cdat->tag_late = 1;
|
||||
else if (strcmp(value, "FALSE") == 0)
|
||||
cdat->tag_late = 0;
|
||||
else
|
||||
return 0;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (strcmp(keyword, "Operation") == 0) {
|
||||
|
@ -610,7 +620,7 @@ static int cipher_test_enc(EVP_TEST *t, int enc,
|
|||
* If encrypting or OCB just set tag length initially, otherwise
|
||||
* set tag length and value.
|
||||
*/
|
||||
if (enc || expected->aead == EVP_CIPH_OCB_MODE) {
|
||||
if (enc || expected->aead == EVP_CIPH_OCB_MODE || expected->tag_late) {
|
||||
t->err = "TAG_LENGTH_SET_ERROR";
|
||||
tag = NULL;
|
||||
} else {
|
||||
|
@ -633,14 +643,6 @@ static int cipher_test_enc(EVP_TEST *t, int enc,
|
|||
goto err;
|
||||
}
|
||||
|
||||
if (!enc && expected->aead == EVP_CIPH_OCB_MODE) {
|
||||
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
|
||||
expected->tag_len, expected->tag)) {
|
||||
t->err = "TAG_SET_ERROR";
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (expected->aead == EVP_CIPH_CCM_MODE) {
|
||||
if (!EVP_CipherUpdate(ctx, NULL, &tmplen, NULL, out_len)) {
|
||||
t->err = "CCM_PLAINTEXT_LENGTH_SET_ERROR";
|
||||
|
@ -675,6 +677,15 @@ static int cipher_test_enc(EVP_TEST *t, int enc,
|
|||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
if (!enc && (expected->aead == EVP_CIPH_OCB_MODE || expected->tag_late)) {
|
||||
if (!EVP_CIPHER_CTX_ctrl(ctx, EVP_CTRL_AEAD_SET_TAG,
|
||||
expected->tag_len, expected->tag)) {
|
||||
t->err = "TAG_SET_ERROR";
|
||||
goto err;
|
||||
}
|
||||
}
|
||||
|
||||
EVP_CIPHER_CTX_set_padding(ctx, 0);
|
||||
t->err = "CIPHERUPDATE_ERROR";
|
||||
tmplen = 0;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 1999-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
* Copyright 1999-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
*
|
||||
* Licensed under the OpenSSL license (the "License"). You may not use
|
||||
* this file except in compliance with the License. You can obtain a copy
|
||||
|
@ -268,6 +268,36 @@ err:
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int test_rsa_sslv23(int idx)
|
||||
{
|
||||
int ret = 0;
|
||||
RSA *key;
|
||||
unsigned char ptext[256];
|
||||
unsigned char ctext[256];
|
||||
static unsigned char ptext_ex[] = "\x54\x85\x9b\x34\x2c\x49\xea\x2a";
|
||||
unsigned char ctext_ex[256];
|
||||
int plen;
|
||||
int clen = 0;
|
||||
int num;
|
||||
|
||||
plen = sizeof(ptext_ex) - 1;
|
||||
clen = rsa_setkey(&key, ctext_ex, idx);
|
||||
|
||||
num = RSA_public_encrypt(plen, ptext_ex, ctext, key,
|
||||
RSA_SSLV23_PADDING);
|
||||
if (!TEST_int_eq(num, clen))
|
||||
goto err;
|
||||
|
||||
num = RSA_private_decrypt(num, ctext, ptext, key, RSA_SSLV23_PADDING);
|
||||
if (!TEST_mem_eq(ptext, num, ptext_ex, plen))
|
||||
goto err;
|
||||
|
||||
ret = 1;
|
||||
err:
|
||||
RSA_free(key);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int test_rsa_oaep(int idx)
|
||||
{
|
||||
int ret = 0;
|
||||
|
@ -332,6 +362,7 @@ err:
|
|||
int setup_tests(void)
|
||||
{
|
||||
ADD_ALL_TESTS(test_rsa_pkcs1, 3);
|
||||
ADD_ALL_TESTS(test_rsa_sslv23, 3);
|
||||
ADD_ALL_TESTS(test_rsa_oaep, 3);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: man.inc,v 1.13 2018/10/08 16:31:35 christos Exp $
|
||||
# $NetBSD: man.inc,v 1.14 2019/06/09 18:44:30 christos Exp $
|
||||
|
||||
.PATH: ${.CURDIR}/man
|
||||
|
||||
|
@ -387,6 +387,7 @@ SSL_get_fd.3 \
|
|||
SSL_get_peer_cert_chain.3 \
|
||||
SSL_get_peer_certificate.3 \
|
||||
SSL_get_peer_signature_nid.3 \
|
||||
SSL_get_peer_tmp_key.3 \
|
||||
SSL_get_psk_identity.3 \
|
||||
SSL_get_rbio.3 \
|
||||
SSL_get_server_tmp_key.3 \
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ADMISSIONS.3,v 1.1 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ADMISSIONS.3,v 1.2 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ADMISSIONS 3"
|
||||
.TH ADMISSIONS 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ADMISSIONS 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -239,58 +243,58 @@ by <https://www.t7ev.org>.
|
|||
Knowledge of those structures and their semantics is assumed.
|
||||
.PP
|
||||
The conventional routines to convert between \s-1DER\s0 and the local format
|
||||
are described in \fId2i_X509\fR\|(3).
|
||||
are described in \fBd2i_X509\fR\|(3).
|
||||
The conventional routines to allocate and free the types are defined
|
||||
in \fIX509_dup\fR\|(3).
|
||||
in \fBX509_dup\fR\|(3).
|
||||
.PP
|
||||
The \fB\s-1PROFESSION_INFOS\s0\fR type is a stack of \fB\s-1PROFESSION_INFO\s0\fR; see
|
||||
\&\s-1\fIDEFINE_STACK_OF\s0\fR\|(3) for details.
|
||||
\&\s-1\fBDEFINE_STACK_OF\s0\fR\|(3) for details.
|
||||
.PP
|
||||
The \fB\s-1NAMING_AUTHORITY\s0\fR type has an authority \s-1ID\s0 and \s-1URL,\s0 and text fields.
|
||||
The \fINAMING_AUTHORITY_get0_authorityId()\fR,
|
||||
\&\fINAMING_AUTHORITY_get0_get0_authorityURL()\fR, and
|
||||
\&\fINAMING_AUTHORITY_get0_get0_authorityText()\fR, functions return pointers
|
||||
The \fBNAMING_AUTHORITY_get0_authorityId()\fR,
|
||||
\&\fBNAMING_AUTHORITY_get0_get0_authorityURL()\fR, and
|
||||
\&\fBNAMING_AUTHORITY_get0_get0_authorityText()\fR, functions return pointers
|
||||
to those values within the object.
|
||||
The \fINAMING_AUTHORITY_set0_authorityId()\fR,
|
||||
\&\fINAMING_AUTHORITY_set0_get0_authorityURL()\fR, and
|
||||
\&\fINAMING_AUTHORITY_set0_get0_authorityText()\fR,
|
||||
The \fBNAMING_AUTHORITY_set0_authorityId()\fR,
|
||||
\&\fBNAMING_AUTHORITY_set0_get0_authorityURL()\fR, and
|
||||
\&\fBNAMING_AUTHORITY_set0_get0_authorityText()\fR,
|
||||
functions free any existing value and set the pointer to the specified value.
|
||||
.PP
|
||||
The \fB\s-1ADMISSION_SYNTAX\s0\fR type has an authority name and a stack of
|
||||
\&\fB\s-1ADMISSION\s0\fR objects.
|
||||
The \fIADMISSION_SYNTAX_get0_admissionAuthority()\fR
|
||||
and \fIADMISSION_SYNTAX_get0_contentsOfAdmissions()\fR functions return pointers
|
||||
The \fBADMISSION_SYNTAX_get0_admissionAuthority()\fR
|
||||
and \fBADMISSION_SYNTAX_get0_contentsOfAdmissions()\fR functions return pointers
|
||||
to those values within the object.
|
||||
The
|
||||
\&\fIADMISSION_SYNTAX_set0_admissionAuthority()\fR and
|
||||
\&\fIADMISSION_SYNTAX_set0_contentsOfAdmissions()\fR
|
||||
\&\fBADMISSION_SYNTAX_set0_admissionAuthority()\fR and
|
||||
\&\fBADMISSION_SYNTAX_set0_contentsOfAdmissions()\fR
|
||||
functions free any existing value and set the pointer to the specified value.
|
||||
.PP
|
||||
The \fB\s-1ADMISSION\s0\fR type has an authority name, authority object, and a
|
||||
stack of \fB\s-1PROFSSION_INFO\s0\fR items.
|
||||
The \fIADMISSIONS_get0_admissionAuthority()\fR, \fIADMISSIONS_get0_namingAuthority()\fR,
|
||||
and \fIADMISSIONS_get0_professionInfos()\fR
|
||||
The \fBADMISSIONS_get0_admissionAuthority()\fR, \fBADMISSIONS_get0_namingAuthority()\fR,
|
||||
and \fBADMISSIONS_get0_professionInfos()\fR
|
||||
functions return pointers to those values within the object.
|
||||
The
|
||||
\&\fIADMISSIONS_set0_admissionAuthority()\fR,
|
||||
\&\fIADMISSIONS_set0_namingAuthority()\fR, and
|
||||
\&\fIADMISSIONS_set0_professionInfos()\fR
|
||||
\&\fBADMISSIONS_set0_admissionAuthority()\fR,
|
||||
\&\fBADMISSIONS_set0_namingAuthority()\fR, and
|
||||
\&\fBADMISSIONS_set0_professionInfos()\fR
|
||||
functions free any existing value and set the pointer to the specified value.
|
||||
.PP
|
||||
The \fB\s-1PROFESSION_INFO\s0\fR type has a name authority, stacks of
|
||||
profession Items and OIDs, a registration number, and additional
|
||||
profession info.
|
||||
The functions \fIPROFESSION_INFO_get0_addProfessionInfo()\fR,
|
||||
\&\fIPROFESSION_INFO_get0_namingAuthority()\fR, \fIPROFESSION_INFO_get0_professionItems()\fR,
|
||||
\&\fIPROFESSION_INFO_get0_professionOIDs()\fR, and
|
||||
\&\fIPROFESSION_INFO_get0_registrationNumber()\fR
|
||||
The functions \fBPROFESSION_INFO_get0_addProfessionInfo()\fR,
|
||||
\&\fBPROFESSION_INFO_get0_namingAuthority()\fR, \fBPROFESSION_INFO_get0_professionItems()\fR,
|
||||
\&\fBPROFESSION_INFO_get0_professionOIDs()\fR, and
|
||||
\&\fBPROFESSION_INFO_get0_registrationNumber()\fR
|
||||
functions return pointers to those values within the object.
|
||||
The
|
||||
\&\fIPROFESSION_INFO_set0_addProfessionInfo()\fR,
|
||||
\&\fIPROFESSION_INFO_set0_namingAuthority()\fR,
|
||||
\&\fIPROFESSION_INFO_set0_professionItems()\fR,
|
||||
\&\fIPROFESSION_INFO_set0_professionOIDs()\fR, and
|
||||
\&\fIPROFESSION_INFO_set0_registrationNumber()\fR
|
||||
\&\fBPROFESSION_INFO_set0_addProfessionInfo()\fR,
|
||||
\&\fBPROFESSION_INFO_set0_namingAuthority()\fR,
|
||||
\&\fBPROFESSION_INFO_set0_professionItems()\fR,
|
||||
\&\fBPROFESSION_INFO_set0_professionOIDs()\fR, and
|
||||
\&\fBPROFESSION_INFO_set0_registrationNumber()\fR
|
||||
functions free any existing value and set the pointer to the specified value.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
|
@ -299,8 +303,8 @@ Note that all of the \fIget0\fR functions return a pointer to the internal data
|
|||
structure and must not be freed.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIX509_dup\fR\|(3),
|
||||
\&\fId2i_X509\fR\|(3),
|
||||
\&\fBX509_dup\fR\|(3),
|
||||
\&\fBd2i_X509\fR\|(3),
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2017\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_INTEGER_get_int64.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_INTEGER_get_int64.3,v 1.3 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_INTEGER_get_int64 3"
|
||||
.TH ASN1_INTEGER_get_int64 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_INTEGER_get_int64 3 "2019-03-12" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -173,45 +177,45 @@ libcrypto, -lcrypto
|
|||
These functions convert to and from \fB\s-1ASN1_INTEGER\s0\fR and \fB\s-1ASN1_ENUMERATED\s0\fR
|
||||
structures.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_get_int64()\fR converts an \fB\s-1ASN1_INTEGER\s0\fR into an \fBint64_t\fR type
|
||||
\&\fBASN1_INTEGER_get_int64()\fR converts an \fB\s-1ASN1_INTEGER\s0\fR into an \fBint64_t\fR type
|
||||
If successful it returns 1 and sets \fB*pr\fR to the value of \fBa\fR. If it fails
|
||||
(due to invalid type or the value being too big to fit into an \fBint64_t\fR type)
|
||||
it returns 0.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_get_uint64()\fR is similar to \fIASN1_INTEGER_get_int64_t()\fR except it
|
||||
\&\fBASN1_INTEGER_get_uint64()\fR is similar to \fBASN1_INTEGER_get_int64_t()\fR except it
|
||||
converts to a \fBuint64_t\fR type and an error is returned if the passed integer
|
||||
is negative.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_get()\fR also returns the value of \fBa\fR but it returns 0 if \fBa\fR is
|
||||
\&\fBASN1_INTEGER_get()\fR also returns the value of \fBa\fR but it returns 0 if \fBa\fR is
|
||||
\&\s-1NULL\s0 and \-1 on error (which is ambiguous because \-1 is a legitimate value for
|
||||
an \fB\s-1ASN1_INTEGER\s0\fR). New applications should use \fIASN1_INTEGER_get_int64()\fR
|
||||
an \fB\s-1ASN1_INTEGER\s0\fR). New applications should use \fBASN1_INTEGER_get_int64()\fR
|
||||
instead.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_set_int64()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the
|
||||
\&\fBASN1_INTEGER_set_int64()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the
|
||||
\&\fBint64_t\fR value \fBr\fR.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_set_uint64()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the
|
||||
\&\fBASN1_INTEGER_set_uint64()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the
|
||||
\&\fBuint64_t\fR value \fBr\fR.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_set()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the \fBlong\fR value
|
||||
\&\fBASN1_INTEGER_set()\fR sets the value of \fB\s-1ASN1_INTEGER\s0\fR \fBa\fR to the \fBlong\fR value
|
||||
\&\fBv\fR.
|
||||
.PP
|
||||
\&\fIBN_to_ASN1_INTEGER()\fR converts \fB\s-1BIGNUM\s0\fR \fBbn\fR to an \fB\s-1ASN1_INTEGER\s0\fR. If \fBai\fR
|
||||
\&\fBBN_to_ASN1_INTEGER()\fR converts \fB\s-1BIGNUM\s0\fR \fBbn\fR to an \fB\s-1ASN1_INTEGER\s0\fR. If \fBai\fR
|
||||
is \s-1NULL\s0 a new \fB\s-1ASN1_INTEGER\s0\fR structure is returned. If \fBai\fR is not \s-1NULL\s0 then
|
||||
the existing structure will be used instead.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_to_BN()\fR converts \s-1ASN1_INTEGER \s0\fBai\fR into a \fB\s-1BIGNUM\s0\fR. If \fBbn\fR is
|
||||
\&\fBASN1_INTEGER_to_BN()\fR converts \s-1ASN1_INTEGER\s0 \fBai\fR into a \fB\s-1BIGNUM\s0\fR. If \fBbn\fR is
|
||||
\&\s-1NULL\s0 a new \fB\s-1BIGNUM\s0\fR structure is returned. If \fBbn\fR is not \s-1NULL\s0 then the
|
||||
existing structure will be used instead.
|
||||
.PP
|
||||
\&\fIASN1_ENUMERATED_get_int64()\fR, \fIASN1_ENUMERATED_set_int64()\fR,
|
||||
\&\fIASN1_ENUMERATED_set()\fR, \fIBN_to_ASN1_ENUMERATED()\fR and \fIASN1_ENUMERATED_to_BN()\fR
|
||||
\&\fBASN1_ENUMERATED_get_int64()\fR, \fBASN1_ENUMERATED_set_int64()\fR,
|
||||
\&\fBASN1_ENUMERATED_set()\fR, \fBBN_to_ASN1_ENUMERATED()\fR and \fBASN1_ENUMERATED_to_BN()\fR
|
||||
behave in an identical way to their \s-1ASN1_INTEGER\s0 counterparts except they
|
||||
operate on an \fB\s-1ASN1_ENUMERATED\s0\fR value.
|
||||
.PP
|
||||
\&\fIASN1_ENUMERATED_get()\fR returns the value of \fBa\fR in a similar way to
|
||||
\&\fIASN1_INTEGER_get()\fR but it returns \fB0xffffffffL\fR if the value of \fBa\fR will not
|
||||
fit in a long type. New applications should use \fIASN1_ENUMERATED_get_int64()\fR
|
||||
\&\fBASN1_ENUMERATED_get()\fR returns the value of \fBa\fR in a similar way to
|
||||
\&\fBASN1_INTEGER_get()\fR but it returns \fB0xffffffffL\fR if the value of \fBa\fR will not
|
||||
fit in a long type. New applications should use \fBASN1_ENUMERATED_get_int64()\fR
|
||||
instead.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
|
@ -222,36 +226,36 @@ represent small integers which can be more easily manipulated if converted to
|
|||
an appropriate C integer type.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
The ambiguous return values of \fIASN1_INTEGER_get()\fR and \fIASN1_ENUMERATED_get()\fR
|
||||
The ambiguous return values of \fBASN1_INTEGER_get()\fR and \fBASN1_ENUMERATED_get()\fR
|
||||
mean these functions should be avoided if possible. They are retained for
|
||||
compatibility. Normally the ambiguous return values are not legitimate
|
||||
values for the fields they represent.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_INTEGER_set_int64()\fR, \fIASN1_INTEGER_set()\fR, \fIASN1_ENUMERATED_set_int64()\fR and
|
||||
\&\fIASN1_ENUMERATED_set()\fR return 1 for success and 0 for failure. They will only
|
||||
\&\fBASN1_INTEGER_set_int64()\fR, \fBASN1_INTEGER_set()\fR, \fBASN1_ENUMERATED_set_int64()\fR and
|
||||
\&\fBASN1_ENUMERATED_set()\fR return 1 for success and 0 for failure. They will only
|
||||
fail if a memory allocation error occurs.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_get_int64()\fR and \fIASN1_ENUMERATED_get_int64()\fR return 1 for success
|
||||
\&\fBASN1_INTEGER_get_int64()\fR and \fBASN1_ENUMERATED_get_int64()\fR return 1 for success
|
||||
and 0 for failure. They will fail if the passed type is incorrect (this will
|
||||
only happen if there is a programming error) or if the value exceeds the range
|
||||
of an \fBint64_t\fR type.
|
||||
.PP
|
||||
\&\fIBN_to_ASN1_INTEGER()\fR and \fIBN_to_ASN1_ENUMERATED()\fR return an \fB\s-1ASN1_INTEGER\s0\fR or
|
||||
\&\fBBN_to_ASN1_INTEGER()\fR and \fBBN_to_ASN1_ENUMERATED()\fR return an \fB\s-1ASN1_INTEGER\s0\fR or
|
||||
\&\fB\s-1ASN1_ENUMERATED\s0\fR structure respectively or \s-1NULL\s0 if an error occurs. They will
|
||||
only fail due to a memory allocation error.
|
||||
.PP
|
||||
\&\fIASN1_INTEGER_to_BN()\fR and \fIASN1_ENUMERATED_to_BN()\fR return a \fB\s-1BIGNUM\s0\fR structure
|
||||
\&\fBASN1_INTEGER_to_BN()\fR and \fBASN1_ENUMERATED_to_BN()\fR return a \fB\s-1BIGNUM\s0\fR structure
|
||||
of \s-1NULL\s0 if an error occurs. They can fail if the passed type is incorrect
|
||||
(due to programming error) or due to a memory allocation failure.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIASN1_INTEGER_set_int64()\fR, \fIASN1_INTEGER_get_int64()\fR,
|
||||
\&\fIASN1_ENUMERATED_set_int64()\fR and \fIASN1_ENUMERATED_get_int64()\fR
|
||||
were added to OpenSSL 1.1.0.
|
||||
\&\fBASN1_INTEGER_set_int64()\fR, \fBASN1_INTEGER_get_int64()\fR,
|
||||
\&\fBASN1_ENUMERATED_set_int64()\fR and \fBASN1_ENUMERATED_get_int64()\fR
|
||||
were added in OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2015\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_ITEM_lookup.3,v 1.1 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_ITEM_lookup.3,v 1.2 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_ITEM_lookup 3"
|
||||
.TH ASN1_ITEM_lookup 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_ITEM_lookup 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -150,17 +154,17 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIASN1_ITEM_lookup()\fR returns the \fB\s-1ASN1_ITEM\s0 name\fR.
|
||||
\&\fBASN1_ITEM_lookup()\fR returns the \fB\s-1ASN1_ITEM\s0 name\fR.
|
||||
.PP
|
||||
\&\fIASN1_ITEM_get()\fR returns the \fB\s-1ASN1_ITEM\s0\fR with index \fBi\fR. This function
|
||||
\&\fBASN1_ITEM_get()\fR returns the \fB\s-1ASN1_ITEM\s0\fR with index \fBi\fR. This function
|
||||
returns \fB\s-1NULL\s0\fR if the index \fBi\fR is out of range.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_ITEM_lookup()\fR and \fIASN1_ITEM_get()\fR return a valid \fB\s-1ASN1_ITEM\s0\fR structure
|
||||
\&\fBASN1_ITEM_lookup()\fR and \fBASN1_ITEM_get()\fR return a valid \fB\s-1ASN1_ITEM\s0\fR structure
|
||||
or \fB\s-1NULL\s0\fR if an error occurred.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_OBJECT_new.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_OBJECT_new.3,v 1.19 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_OBJECT_new 3"
|
||||
.TH ASN1_OBJECT_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_OBJECT_new 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -153,25 +157,25 @@ libcrypto, -lcrypto
|
|||
The \s-1ASN1_OBJECT\s0 allocation routines, allocate and free an
|
||||
\&\s-1ASN1_OBJECT\s0 structure, which represents an \s-1ASN1 OBJECT IDENTIFIER.\s0
|
||||
.PP
|
||||
\&\fIASN1_OBJECT_new()\fR allocates and initializes an \s-1ASN1_OBJECT\s0 structure.
|
||||
\&\fBASN1_OBJECT_new()\fR allocates and initializes an \s-1ASN1_OBJECT\s0 structure.
|
||||
.PP
|
||||
\&\fIASN1_OBJECT_free()\fR frees up the \fB\s-1ASN1_OBJECT\s0\fR structure \fBa\fR.
|
||||
\&\fBASN1_OBJECT_free()\fR frees up the \fB\s-1ASN1_OBJECT\s0\fR structure \fBa\fR.
|
||||
If \fBa\fR is \s-1NULL,\s0 nothing is done.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
Although \fIASN1_OBJECT_new()\fR allocates a new \s-1ASN1_OBJECT\s0 structure it
|
||||
Although \fBASN1_OBJECT_new()\fR allocates a new \s-1ASN1_OBJECT\s0 structure it
|
||||
is almost never used in applications. The \s-1ASN1\s0 object utility functions
|
||||
such as \fIOBJ_nid2obj()\fR are used instead.
|
||||
such as \fBOBJ_nid2obj()\fR are used instead.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
If the allocation fails, \fIASN1_OBJECT_new()\fR returns \fB\s-1NULL\s0\fR and sets an error
|
||||
code that can be obtained by \fIERR_get_error\fR\|(3).
|
||||
If the allocation fails, \fBASN1_OBJECT_new()\fR returns \fB\s-1NULL\s0\fR and sets an error
|
||||
code that can be obtained by \fBERR_get_error\fR\|(3).
|
||||
Otherwise it returns a pointer to the newly allocated structure.
|
||||
.PP
|
||||
\&\fIASN1_OBJECT_free()\fR returns no value.
|
||||
\&\fBASN1_OBJECT_free()\fR returns no value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fId2i_ASN1_OBJECT\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBd2i_ASN1_OBJECT\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2002\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_STRING_TABLE_add.3,v 1.1 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_STRING_TABLE_add.3,v 1.2 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_STRING_TABLE_add 3"
|
||||
.TH ASN1_STRING_TABLE_add 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_STRING_TABLE_add 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -161,7 +165,7 @@ libcrypto, -lcrypto
|
|||
(basically minimum size, maximum size, type and etc) for a \s-1NID\s0 object.
|
||||
.SS "Functions"
|
||||
.IX Subsection "Functions"
|
||||
\&\fIASN1_STRING_TABLE_add()\fR adds a new \fB\s-1ASN1_STRING_TABLE\s0\fR item into the
|
||||
\&\fBASN1_STRING_TABLE_add()\fR adds a new \fB\s-1ASN1_STRING_TABLE\s0\fR item into the
|
||||
local \s-1ASN1\s0 string table based on the \fBnid\fR along with other parameters.
|
||||
.PP
|
||||
If the item is already in the table, fields of \fB\s-1ASN1_STRING_TABLE\s0\fR are
|
||||
|
@ -170,22 +174,22 @@ and \fBmaxsize\fR >= 0, \fBmask\fR and \fBflags\fR != 0). If the \fBnid\fR is st
|
|||
a copy of the standard \fB\s-1ASN1_STRING_TABLE\s0\fR is created and updated with
|
||||
other parameters.
|
||||
.PP
|
||||
\&\fIASN1_STRING_TABLE_get()\fR searches for an \fB\s-1ASN1_STRING_TABLE\s0\fR item based
|
||||
\&\fBASN1_STRING_TABLE_get()\fR searches for an \fB\s-1ASN1_STRING_TABLE\s0\fR item based
|
||||
on \fBnid\fR. It will search the local table first, then the standard one.
|
||||
.PP
|
||||
\&\fIASN1_STRING_TABLE_cleanup()\fR frees all \fB\s-1ASN1_STRING_TABLE\s0\fR items added
|
||||
by \fIASN1_STRING_TABLE_add()\fR.
|
||||
\&\fBASN1_STRING_TABLE_cleanup()\fR frees all \fB\s-1ASN1_STRING_TABLE\s0\fR items added
|
||||
by \fBASN1_STRING_TABLE_add()\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_STRING_TABLE_add()\fR returns 1 on success, 0 if an error occurred.
|
||||
\&\fBASN1_STRING_TABLE_add()\fR returns 1 on success, 0 if an error occurred.
|
||||
.PP
|
||||
\&\fIASN1_STRING_TABLE_get()\fR returns a valid \fB\s-1ASN1_STRING_TABLE\s0\fR structure
|
||||
\&\fBASN1_STRING_TABLE_get()\fR returns a valid \fB\s-1ASN1_STRING_TABLE\s0\fR structure
|
||||
or \fB\s-1NULL\s0\fR if nothing is found.
|
||||
.PP
|
||||
\&\fIASN1_STRING_TABLE_cleanup()\fR does not return a value.
|
||||
\&\fBASN1_STRING_TABLE_cleanup()\fR does not return a value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_STRING_length.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_STRING_length.3,v 1.19 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_STRING_length 3"
|
||||
.TH ASN1_STRING_length 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_STRING_length 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -165,32 +169,32 @@ libcrypto, -lcrypto
|
|||
.IX Header "DESCRIPTION"
|
||||
These functions allow an \fB\s-1ASN1_STRING\s0\fR structure to be manipulated.
|
||||
.PP
|
||||
\&\fIASN1_STRING_length()\fR returns the length of the content of \fBx\fR.
|
||||
\&\fBASN1_STRING_length()\fR returns the length of the content of \fBx\fR.
|
||||
.PP
|
||||
\&\fIASN1_STRING_get0_data()\fR returns an internal pointer to the data of \fBx\fR.
|
||||
\&\fBASN1_STRING_get0_data()\fR returns an internal pointer to the data of \fBx\fR.
|
||||
Since this is an internal pointer it should \fBnot\fR be freed or
|
||||
modified in any way.
|
||||
.PP
|
||||
\&\fIASN1_STRING_data()\fR is similar to \fIASN1_STRING_get0_data()\fR except the
|
||||
\&\fBASN1_STRING_data()\fR is similar to \fBASN1_STRING_get0_data()\fR except the
|
||||
returned value is not constant. This function is deprecated:
|
||||
applications should use \fIASN1_STRING_get0_data()\fR instead.
|
||||
applications should use \fBASN1_STRING_get0_data()\fR instead.
|
||||
.PP
|
||||
\&\fIASN1_STRING_dup()\fR returns a copy of the structure \fBa\fR.
|
||||
\&\fBASN1_STRING_dup()\fR returns a copy of the structure \fBa\fR.
|
||||
.PP
|
||||
\&\fIASN1_STRING_cmp()\fR compares \fBa\fR and \fBb\fR returning 0 if the two
|
||||
\&\fBASN1_STRING_cmp()\fR compares \fBa\fR and \fBb\fR returning 0 if the two
|
||||
are identical. The string types and content are compared.
|
||||
.PP
|
||||
\&\fIASN1_STRING_set()\fR sets the data of string \fBstr\fR to the buffer
|
||||
\&\fBASN1_STRING_set()\fR sets the data of string \fBstr\fR to the buffer
|
||||
\&\fBdata\fR or length \fBlen\fR. The supplied data is copied. If \fBlen\fR
|
||||
is \-1 then the length is determined by strlen(data).
|
||||
.PP
|
||||
\&\fIASN1_STRING_type()\fR returns the type of \fBx\fR, using standard constants
|
||||
\&\fBASN1_STRING_type()\fR returns the type of \fBx\fR, using standard constants
|
||||
such as \fBV_ASN1_OCTET_STRING\fR.
|
||||
.PP
|
||||
\&\fIASN1_STRING_to_UTF8()\fR converts the string \fBin\fR to \s-1UTF8\s0 format, the
|
||||
\&\fBASN1_STRING_to_UTF8()\fR converts the string \fBin\fR to \s-1UTF8\s0 format, the
|
||||
converted data is allocated in a buffer in \fB*out\fR. The length of
|
||||
\&\fBout\fR is returned or a negative error code. The buffer \fB*out\fR
|
||||
should be freed using \fIOPENSSL_free()\fR.
|
||||
should be freed using \fBOPENSSL_free()\fR.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
Almost all \s-1ASN1\s0 types in OpenSSL are represented as an \fB\s-1ASN1_STRING\s0\fR
|
||||
|
@ -204,36 +208,36 @@ These functions should \fBnot\fR be used to examine or modify \fB\s-1ASN1_INTEGE
|
|||
or \fB\s-1ASN1_ENUMERATED\s0\fR types: the relevant \fB\s-1INTEGER\s0\fR or \fB\s-1ENUMERATED\s0\fR
|
||||
utility functions should be used instead.
|
||||
.PP
|
||||
In general it cannot be assumed that the data returned by \fIASN1_STRING_data()\fR
|
||||
In general it cannot be assumed that the data returned by \fBASN1_STRING_data()\fR
|
||||
is null terminated or does not contain embedded nulls. The actual format
|
||||
of the data will depend on the actual string type itself: for example
|
||||
for an IA5String the data will be \s-1ASCII,\s0 for a BMPString two bytes per
|
||||
character in big endian format, and for an UTF8String it will be in \s-1UTF8\s0 format.
|
||||
.PP
|
||||
Similar care should be take to ensure the data is in the correct format
|
||||
when calling \fIASN1_STRING_set()\fR.
|
||||
when calling \fBASN1_STRING_set()\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_STRING_length()\fR returns the length of the content of \fBx\fR.
|
||||
\&\fBASN1_STRING_length()\fR returns the length of the content of \fBx\fR.
|
||||
.PP
|
||||
\&\fIASN1_STRING_get0_data()\fR and \fIASN1_STRING_data()\fR return an internal pointer to
|
||||
\&\fBASN1_STRING_get0_data()\fR and \fBASN1_STRING_data()\fR return an internal pointer to
|
||||
the data of \fBx\fR.
|
||||
.PP
|
||||
\&\fIASN1_STRING_dup()\fR returns a valid \fB\s-1ASN1_STRING\s0\fR structure or \fB\s-1NULL\s0\fR if an
|
||||
\&\fBASN1_STRING_dup()\fR returns a valid \fB\s-1ASN1_STRING\s0\fR structure or \fB\s-1NULL\s0\fR if an
|
||||
error occurred.
|
||||
.PP
|
||||
\&\fIASN1_STRING_cmp()\fR returns an integer greater than, equal to, or less than 0,
|
||||
\&\fBASN1_STRING_cmp()\fR returns an integer greater than, equal to, or less than 0,
|
||||
according to whether \fBa\fR is greater than, equal to, or less than \fBb\fR.
|
||||
.PP
|
||||
\&\fIASN1_STRING_set()\fR returns 1 on success or 0 on error.
|
||||
\&\fBASN1_STRING_set()\fR returns 1 on success or 0 on error.
|
||||
.PP
|
||||
\&\fIASN1_STRING_type()\fR returns the type of \fBx\fR.
|
||||
\&\fBASN1_STRING_type()\fR returns the type of \fBx\fR.
|
||||
.PP
|
||||
\&\fIASN1_STRING_to_UTF8()\fR returns the number of bytes in output string \fBout\fR or a
|
||||
\&\fBASN1_STRING_to_UTF8()\fR returns the number of bytes in output string \fBout\fR or a
|
||||
negative value if an error occurred.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2002\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_STRING_new.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_STRING_new.3,v 1.19 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_STRING_new 3"
|
||||
.TH ASN1_STRING_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_STRING_new 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -152,27 +156,27 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIASN1_STRING_new()\fR returns an allocated \fB\s-1ASN1_STRING\s0\fR structure. Its type
|
||||
\&\fBASN1_STRING_new()\fR returns an allocated \fB\s-1ASN1_STRING\s0\fR structure. Its type
|
||||
is undefined.
|
||||
.PP
|
||||
\&\fIASN1_STRING_type_new()\fR returns an allocated \fB\s-1ASN1_STRING\s0\fR structure of
|
||||
\&\fBASN1_STRING_type_new()\fR returns an allocated \fB\s-1ASN1_STRING\s0\fR structure of
|
||||
type \fBtype\fR.
|
||||
.PP
|
||||
\&\fIASN1_STRING_free()\fR frees up \fBa\fR.
|
||||
\&\fBASN1_STRING_free()\fR frees up \fBa\fR.
|
||||
If \fBa\fR is \s-1NULL\s0 nothing is done.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
Other string types call the \fB\s-1ASN1_STRING\s0\fR functions. For example
|
||||
\&\fIASN1_OCTET_STRING_new()\fR calls ASN1_STRING_type(V_ASN1_OCTET_STRING).
|
||||
\&\fBASN1_OCTET_STRING_new()\fR calls ASN1_STRING_type(V_ASN1_OCTET_STRING).
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_STRING_new()\fR and \fIASN1_STRING_type_new()\fR return a valid
|
||||
\&\fBASN1_STRING_new()\fR and \fBASN1_STRING_type_new()\fR return a valid
|
||||
\&\s-1ASN1_STRING\s0 structure or \fB\s-1NULL\s0\fR if an error occurred.
|
||||
.PP
|
||||
\&\fIASN1_STRING_free()\fR does not return a value.
|
||||
\&\fBASN1_STRING_free()\fR does not return a value.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2002\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_STRING_print_ex.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_STRING_print_ex.3,v 1.19 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_STRING_print_ex 3"
|
||||
.TH ASN1_STRING_print_ex 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_STRING_print_ex 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -157,19 +161,19 @@ libcrypto, -lcrypto
|
|||
These functions output an \fB\s-1ASN1_STRING\s0\fR structure. \fB\s-1ASN1_STRING\s0\fR is used to
|
||||
represent all the \s-1ASN1\s0 string types.
|
||||
.PP
|
||||
\&\fIASN1_STRING_print_ex()\fR outputs \fBstr\fR to \fBout\fR, the format is determined by
|
||||
the options \fBflags\fR. \fIASN1_STRING_print_ex_fp()\fR is identical except it outputs
|
||||
\&\fBASN1_STRING_print_ex()\fR outputs \fBstr\fR to \fBout\fR, the format is determined by
|
||||
the options \fBflags\fR. \fBASN1_STRING_print_ex_fp()\fR is identical except it outputs
|
||||
to \fBfp\fR instead.
|
||||
.PP
|
||||
\&\fIASN1_STRING_print()\fR prints \fBstr\fR to \fBout\fR but using a different format to
|
||||
\&\fIASN1_STRING_print_ex()\fR. It replaces unprintable characters (other than \s-1CR, LF\s0)
|
||||
\&\fBASN1_STRING_print()\fR prints \fBstr\fR to \fBout\fR but using a different format to
|
||||
\&\fBASN1_STRING_print_ex()\fR. It replaces unprintable characters (other than \s-1CR, LF\s0)
|
||||
with '.'.
|
||||
.PP
|
||||
\&\fIASN1_tag2str()\fR returns a human-readable name of the specified \s-1ASN.1 \s0\fBtag\fR.
|
||||
\&\fBASN1_tag2str()\fR returns a human-readable name of the specified \s-1ASN.1\s0 \fBtag\fR.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
\&\fIASN1_STRING_print()\fR is a deprecated function which should be avoided; use
|
||||
\&\fIASN1_STRING_print_ex()\fR instead.
|
||||
\&\fBASN1_STRING_print()\fR is a deprecated function which should be avoided; use
|
||||
\&\fBASN1_STRING_print_ex()\fR instead.
|
||||
.PP
|
||||
Although there are a large number of options frequently \fB\s-1ASN1_STRFLGS_RFC2253\s0\fR is
|
||||
suitable, or on \s-1UTF8\s0 terminals \fB\s-1ASN1_STRFLGS_RFC2253 &\s0 ~ASN1_STRFLGS_ESC_MSB\fR.
|
||||
|
@ -204,7 +208,7 @@ all: everything is assumed to be one byte per character. This is primarily for
|
|||
debugging purposes and can result in confusing output in multi character strings.
|
||||
.PP
|
||||
If \fB\s-1ASN1_STRFLGS_SHOW_TYPE\s0\fR is set then the string type itself is printed out
|
||||
before its value (for example \*(L"\s-1BMPSTRING\*(R"\s0), this actually uses \fIASN1_tag2str()\fR.
|
||||
before its value (for example \*(L"\s-1BMPSTRING\*(R"\s0), this actually uses \fBASN1_tag2str()\fR.
|
||||
.PP
|
||||
The content of a string instead of being interpreted can be \*(L"dumped\*(R": this just
|
||||
outputs the value of the string using the form #XXXX using hex format for each
|
||||
|
@ -226,16 +230,16 @@ equivalent to:
|
|||
\s-1ASN1_STRFLGS_UTF8_CONVERT\s0 | \s-1ASN1_STRFLGS_DUMP_UNKNOWN ASN1_STRFLGS_DUMP_DER\s0
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_STRING_print_ex()\fR and \fIASN1_STRING_print_ex_fp()\fR return the number of
|
||||
\&\fBASN1_STRING_print_ex()\fR and \fBASN1_STRING_print_ex_fp()\fR return the number of
|
||||
characters written or \-1 if an error occurred.
|
||||
.PP
|
||||
\&\fIASN1_STRING_print()\fR returns 1 on success or 0 on error.
|
||||
\&\fBASN1_STRING_print()\fR returns 1 on success or 0 on error.
|
||||
.PP
|
||||
\&\fIASN1_tag2str()\fR returns a human-readable name of the specified \s-1ASN.1 \s0\fBtag\fR.
|
||||
\&\fBASN1_tag2str()\fR returns a human-readable name of the specified \s-1ASN.1\s0 \fBtag\fR.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIX509_NAME_print_ex\fR\|(3),
|
||||
\&\fIASN1_tag2str\fR\|(3)
|
||||
\&\fBX509_NAME_print_ex\fR\|(3),
|
||||
\&\fBASN1_tag2str\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2002\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_TIME_set.3,v 1.3 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_TIME_set.3,v 1.4 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_TIME_set 3"
|
||||
.TH ASN1_TIME_set 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_TIME_set 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -197,11 +201,11 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fIASN1_TIME_set()\fR, \fIASN1_UTCTIME_set()\fR and \fIASN1_GENERALIZEDTIME_set()\fR
|
||||
The \fBASN1_TIME_set()\fR, \fBASN1_UTCTIME_set()\fR and \fBASN1_GENERALIZEDTIME_set()\fR
|
||||
functions set the structure \fBs\fR to the time represented by the time_t
|
||||
value \fBt\fR. If \fBs\fR is \s-1NULL\s0 a new time structure is allocated and returned.
|
||||
.PP
|
||||
The \fIASN1_TIME_adj()\fR, \fIASN1_UTCTIME_adj()\fR and \fIASN1_GENERALIZEDTIME_adj()\fR
|
||||
The \fBASN1_TIME_adj()\fR, \fBASN1_UTCTIME_adj()\fR and \fBASN1_GENERALIZEDTIME_adj()\fR
|
||||
functions set the time structure \fBs\fR to the time represented
|
||||
by the time \fBoffset_day\fR and \fBoffset_sec\fR after the time_t value \fBt\fR.
|
||||
The values of \fBoffset_day\fR or \fBoffset_sec\fR can be negative to set a
|
||||
|
@ -209,37 +213,37 @@ time before \fBt\fR. The \fBoffset_sec\fR value can also exceed the number of
|
|||
seconds in a day. If \fBs\fR is \s-1NULL\s0 a new structure is allocated
|
||||
and returned.
|
||||
.PP
|
||||
The \fIASN1_TIME_set_string()\fR, \fIASN1_UTCTIME_set_string()\fR and
|
||||
\&\fIASN1_GENERALIZEDTIME_set_string()\fR functions set the time structure \fBs\fR
|
||||
The \fBASN1_TIME_set_string()\fR, \fBASN1_UTCTIME_set_string()\fR and
|
||||
\&\fBASN1_GENERALIZEDTIME_set_string()\fR functions set the time structure \fBs\fR
|
||||
to the time represented by string \fBstr\fR which must be in appropriate \s-1ASN.1\s0
|
||||
time format (for example \s-1YYMMDDHHMMSSZ\s0 or \s-1YYYYMMDDHHMMSSZ\s0). If \fBs\fR is \s-1NULL\s0
|
||||
this function performs a format check on \fBstr\fR only. The string \fBstr\fR
|
||||
is copied into \fBs\fR.
|
||||
.PP
|
||||
\&\fIASN1_TIME_set_string_X509()\fR sets \s-1ASN1_TIME\s0 structure \fBs\fR to the time
|
||||
\&\fBASN1_TIME_set_string_X509()\fR sets \s-1ASN1_TIME\s0 structure \fBs\fR to the time
|
||||
represented by string \fBstr\fR which must be in appropriate time format
|
||||
that \s-1RFC 5280\s0 requires, which means it only allows \s-1YYMMDDHHMMSSZ\s0 and
|
||||
\&\s-1YYYYMMDDHHMMSSZ \s0(leap second is rejected), all other \s-1ASN.1\s0 time format
|
||||
\&\s-1YYYYMMDDHHMMSSZ\s0 (leap second is rejected), all other \s-1ASN.1\s0 time format
|
||||
are not allowed. If \fBs\fR is \s-1NULL\s0 this function performs a format check
|
||||
on \fBstr\fR only.
|
||||
.PP
|
||||
The \fIASN1_TIME_normalize()\fR function converts an \s-1ASN1_GENERALIZEDTIME\s0 or
|
||||
The \fBASN1_TIME_normalize()\fR function converts an \s-1ASN1_GENERALIZEDTIME\s0 or
|
||||
\&\s-1ASN1_UTCTIME\s0 into a time value that can be used in a certificate. It
|
||||
should be used after the \fIASN1_TIME_set_string()\fR functions and before
|
||||
\&\fIASN1_TIME_print()\fR functions to get consistent (i.e. \s-1GMT\s0) results.
|
||||
should be used after the \fBASN1_TIME_set_string()\fR functions and before
|
||||
\&\fBASN1_TIME_print()\fR functions to get consistent (i.e. \s-1GMT\s0) results.
|
||||
.PP
|
||||
The \fIASN1_TIME_check()\fR, \fIASN1_UTCTIME_check()\fR and \fIASN1_GENERALIZEDTIME_check()\fR
|
||||
The \fBASN1_TIME_check()\fR, \fBASN1_UTCTIME_check()\fR and \fBASN1_GENERALIZEDTIME_check()\fR
|
||||
functions check the syntax of the time structure \fBs\fR.
|
||||
.PP
|
||||
The \fIASN1_TIME_print()\fR, \fIASN1_UTCTIME_print()\fR and \fIASN1_GENERALIZEDTIME_print()\fR
|
||||
functions print the time structure \fBs\fR to \s-1BIO \s0\fBb\fR in human readable
|
||||
The \fBASN1_TIME_print()\fR, \fBASN1_UTCTIME_print()\fR and \fBASN1_GENERALIZEDTIME_print()\fR
|
||||
functions print the time structure \fBs\fR to \s-1BIO\s0 \fBb\fR in human readable
|
||||
format. It will be of the format \s-1MMM DD HH:MM:SS YYYY\s0 [\s-1GMT\s0], for example
|
||||
\&\*(L"Feb 3 00:55:52 2015 \s-1GMT\*(R"\s0 it does not include a newline. If the time
|
||||
structure has invalid format it prints out \*(L"Bad time value\*(R" and returns
|
||||
an error. The output for generalized time may include a fractional part
|
||||
following the second.
|
||||
.PP
|
||||
\&\fIASN1_TIME_to_tm()\fR converts the time \fBs\fR to the standard \fBtm\fR structure.
|
||||
\&\fBASN1_TIME_to_tm()\fR converts the time \fBs\fR to the standard \fBtm\fR structure.
|
||||
If \fBs\fR is \s-1NULL,\s0 then the current time is converted. The output time is \s-1GMT.\s0
|
||||
The \fBtm_sec\fR, \fBtm_min\fR, \fBtm_hour\fR, \fBtm_mday\fR, \fBtm_wday\fR, \fBtm_yday\fR,
|
||||
\&\fBtm_mon\fR and \fBtm_year\fR fields of \fBtm\fR structure are set to proper values,
|
||||
|
@ -248,7 +252,7 @@ a format check on \fBs\fR only. If \fBs\fR is in Generalized format with fractio
|
|||
seconds, e.g. \s-1YYYYMMDDHHMMSS.SSSZ,\s0 the fractional seconds will be lost while
|
||||
converting \fBs\fR to \fBtm\fR structure.
|
||||
.PP
|
||||
\&\fIASN1_TIME_diff()\fR sets \fB*pday\fR and \fB*psec\fR to the time difference between
|
||||
\&\fBASN1_TIME_diff()\fR sets \fB*pday\fR and \fB*psec\fR to the time difference between
|
||||
\&\fBfrom\fR and \fBto\fR. If \fBto\fR represents a time later than \fBfrom\fR then
|
||||
one or both (depending on the time difference) of \fB*pday\fR and \fB*psec\fR
|
||||
will be positive. If \fBto\fR represents a time earlier than \fBfrom\fR then
|
||||
|
@ -258,13 +262,13 @@ If both \fB*pday\fR and \fB*psec\fR are non-zero they will always have the same
|
|||
sign. The value of \fB*psec\fR will always be less than the number of seconds
|
||||
in a day. If \fBfrom\fR or \fBto\fR is \s-1NULL\s0 the current time is used.
|
||||
.PP
|
||||
The \fIASN1_TIME_cmp_time_t()\fR and \fIASN1_UTCTIME_cmp_time_t()\fR functions compare
|
||||
The \fBASN1_TIME_cmp_time_t()\fR and \fBASN1_UTCTIME_cmp_time_t()\fR functions compare
|
||||
the two times represented by the time structure \fBs\fR and the time_t \fBt\fR.
|
||||
.PP
|
||||
The \fIASN1_TIME_compare()\fR function compares the two times represented by the
|
||||
The \fBASN1_TIME_compare()\fR function compares the two times represented by the
|
||||
time structures \fBa\fR and \fBb\fR.
|
||||
.PP
|
||||
The \fIASN1_TIME_to_generalizedtime()\fR function converts an \s-1ASN1_TIME\s0 to an
|
||||
The \fBASN1_TIME_to_generalizedtime()\fR function converts an \s-1ASN1_TIME\s0 to an
|
||||
\&\s-1ASN1_GENERALIZEDTIME,\s0 regardless of year. If either \fBout\fR or
|
||||
\&\fB*out\fR are \s-1NULL,\s0 then a new object is allocated and must be freed after use.
|
||||
.SH "NOTES"
|
||||
|
@ -275,7 +279,7 @@ in \s-1RFC5280:\s0 if the date can be represented by UTCTime it is used, else
|
|||
GeneralizedTime is used.
|
||||
.PP
|
||||
The \s-1ASN1_TIME, ASN1_UTCTIME\s0 and \s-1ASN1_GENERALIZEDTIME\s0 structures are represented
|
||||
as an \s-1ASN1_STRING\s0 internally and can be freed up using \fIASN1_STRING_free()\fR.
|
||||
as an \s-1ASN1_STRING\s0 internally and can be freed up using \fBASN1_STRING_free()\fR.
|
||||
.PP
|
||||
The \s-1ASN1_TIME\s0 structure can represent years from 0000 to 9999 but no attempt
|
||||
is made to correct ancient calendar changes (for example from Julian to
|
||||
|
@ -284,15 +288,15 @@ Gregorian calendars).
|
|||
\&\s-1ASN1_UTCTIME\s0 is limited to a year range of 1950 through 2049.
|
||||
.PP
|
||||
Some applications add offset times directly to a time_t value and pass the
|
||||
results to \fIASN1_TIME_set()\fR (or equivalent). This can cause problems as the
|
||||
results to \fBASN1_TIME_set()\fR (or equivalent). This can cause problems as the
|
||||
time_t value can overflow on some systems resulting in unexpected results.
|
||||
New applications should use \fIASN1_TIME_adj()\fR instead and pass the offset value
|
||||
New applications should use \fBASN1_TIME_adj()\fR instead and pass the offset value
|
||||
in the \fBoffset_sec\fR and \fBoffset_day\fR parameters instead of directly
|
||||
manipulating a time_t value.
|
||||
.PP
|
||||
\&\fIASN1_TIME_adj()\fR may change the type from \s-1ASN1_GENERALIZEDTIME\s0 to \s-1ASN1_UTCTIME,\s0
|
||||
or vice versa, based on the resulting year. The \fIASN1_GENERALIZEDTIME_adj()\fR and
|
||||
\&\fIASN1_UTCTIME_adj()\fR functions will not modify the type of the return structure.
|
||||
\&\fBASN1_TIME_adj()\fR may change the type from \s-1ASN1_GENERALIZEDTIME\s0 to \s-1ASN1_UTCTIME,\s0
|
||||
or vice versa, based on the resulting year. The \fBASN1_GENERALIZEDTIME_adj()\fR and
|
||||
\&\fBASN1_UTCTIME_adj()\fR functions will not modify the type of the return structure.
|
||||
.PP
|
||||
It is recommended that functions starting with \s-1ASN1_TIME\s0 be used instead of
|
||||
those starting with \s-1ASN1_UTCTIME\s0 or \s-1ASN1_GENERALIZEDTIME.\s0 The functions
|
||||
|
@ -301,12 +305,44 @@ time format. The functions starting with \s-1ASN1_TIME\s0 will operate on either
|
|||
format.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
\&\fIASN1_TIME_print()\fR, \fIASN1_UTCTIME_print()\fR and \fIASN1_GENERALIZEDTIME_print()\fR
|
||||
\&\fBASN1_TIME_print()\fR, \fBASN1_UTCTIME_print()\fR and \fBASN1_GENERALIZEDTIME_print()\fR
|
||||
do not print out the time zone: it either prints out \*(L"\s-1GMT\*(R"\s0 or nothing. But all
|
||||
certificates complying with \s-1RFC5280\s0 et al use \s-1GMT\s0 anyway.
|
||||
.PP
|
||||
Use the \fIASN1_TIME_normalize()\fR function to normalize the time value before
|
||||
Use the \fBASN1_TIME_normalize()\fR function to normalize the time value before
|
||||
printing to get \s-1GMT\s0 results.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fBASN1_TIME_set()\fR, \fBASN1_UTCTIME_set()\fR, \fBASN1_GENERALIZEDTIME_set()\fR, \fBASN1_TIME_adj()\fR,
|
||||
ASN1_UTCTIME_adj and ASN1_GENERALIZEDTIME_set return a pointer to a time structure
|
||||
or \s-1NULL\s0 if an error occurred.
|
||||
.PP
|
||||
\&\fBASN1_TIME_set_string()\fR, \fBASN1_UTCTIME_set_string()\fR, \fBASN1_GENERALIZEDTIME_set_string()\fR
|
||||
\&\fBASN1_TIME_set_string_X509()\fR return 1 if the time value is successfully set and 0 otherwise.
|
||||
.PP
|
||||
\&\fBASN1_TIME_normalize()\fR returns 1 on success, and 0 on error.
|
||||
.PP
|
||||
\&\fBASN1_TIME_check()\fR, ASN1_UTCTIME_check and \fBASN1_GENERALIZEDTIME_check()\fR return 1
|
||||
if the structure is syntactically correct and 0 otherwise.
|
||||
.PP
|
||||
\&\fBASN1_TIME_print()\fR, \fBASN1_UTCTIME_print()\fR and \fBASN1_GENERALIZEDTIME_print()\fR return 1
|
||||
if the time is successfully printed out and 0 if an error occurred (I/O error or
|
||||
invalid time format).
|
||||
.PP
|
||||
\&\fBASN1_TIME_to_tm()\fR returns 1 if the time is successfully parsed and 0 if an
|
||||
error occurred (invalid time format).
|
||||
.PP
|
||||
\&\fBASN1_TIME_diff()\fR returns 1 for success and 0 for failure. It can fail if the
|
||||
passed-in time structure has invalid syntax, for example.
|
||||
.PP
|
||||
\&\fBASN1_TIME_cmp_time_t()\fR and \fBASN1_UTCTIME_cmp_time_t()\fR return \-1 if \fBs\fR is
|
||||
before \fBt\fR, 0 if \fBs\fR equals \fBt\fR, or 1 if \fBs\fR is after \fBt\fR. \-2 is returned
|
||||
on error.
|
||||
.PP
|
||||
\&\fBASN1_TIME_compare()\fR returns \-1 if \fBa\fR is before \fBb\fR, 0 if \fBa\fR equals \fBb\fR, or 1 if \fBa\fR is after \fBb\fR. \-2 is returned on error.
|
||||
.PP
|
||||
\&\fBASN1_TIME_to_generalizedtime()\fR returns a pointer to
|
||||
the appropriate time structure on success or \s-1NULL\s0 if an error occurred.
|
||||
.SH "EXAMPLES"
|
||||
.IX Header "EXAMPLES"
|
||||
Set a time structure to one hour after the current time and print it out:
|
||||
|
@ -342,48 +378,16 @@ Determine if one time is later or sooner than the current time:
|
|||
\& else
|
||||
\& printf("Same\en");
|
||||
.Ve
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_TIME_set()\fR, \fIASN1_UTCTIME_set()\fR, \fIASN1_GENERALIZEDTIME_set()\fR, \fIASN1_TIME_adj()\fR,
|
||||
ASN1_UTCTIME_adj and ASN1_GENERALIZEDTIME_set return a pointer to a time structure
|
||||
or \s-1NULL\s0 if an error occurred.
|
||||
.PP
|
||||
\&\fIASN1_TIME_set_string()\fR, \fIASN1_UTCTIME_set_string()\fR, \fIASN1_GENERALIZEDTIME_set_string()\fR
|
||||
\&\fIASN1_TIME_set_string_X509()\fR return 1 if the time value is successfully set and 0 otherwise.
|
||||
.PP
|
||||
\&\fIASN1_TIME_normalize()\fR returns 1 on success, and 0 on error.
|
||||
.PP
|
||||
\&\fIASN1_TIME_check()\fR, ASN1_UTCTIME_check and \fIASN1_GENERALIZEDTIME_check()\fR return 1
|
||||
if the structure is syntactically correct and 0 otherwise.
|
||||
.PP
|
||||
\&\fIASN1_TIME_print()\fR, \fIASN1_UTCTIME_print()\fR and \fIASN1_GENERALIZEDTIME_print()\fR return 1
|
||||
if the time is successfully printed out and 0 if an error occurred (I/O error or
|
||||
invalid time format).
|
||||
.PP
|
||||
\&\fIASN1_TIME_to_tm()\fR returns 1 if the time is successfully parsed and 0 if an
|
||||
error occurred (invalid time format).
|
||||
.PP
|
||||
\&\fIASN1_TIME_diff()\fR returns 1 for success and 0 for failure. It can fail if the
|
||||
passed-in time structure has invalid syntax, for example.
|
||||
.PP
|
||||
\&\fIASN1_TIME_cmp_time_t()\fR and \fIASN1_UTCTIME_cmp_time_t()\fR return \-1 if \fBs\fR is
|
||||
before \fBt\fR, 0 if \fBs\fR equals \fBt\fR, or 1 if \fBs\fR is after \fBt\fR. \-2 is returned
|
||||
on error.
|
||||
.PP
|
||||
\&\fIASN1_TIME_compare()\fR returns \-1 if \fBa\fR is before \fBb\fR, 0 if \fBa\fR equals \fBb\fR, or 1 if \fBa\fR is after \fBb\fR. \-2 is returned on error.
|
||||
.PP
|
||||
\&\fIASN1_TIME_to_generalizedtime()\fR returns a pointer to
|
||||
the appropriate time structure on success or \s-1NULL\s0 if an error occurred.
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
The \fIASN1_TIME_to_tm()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fIASN1_TIME_set_string_X509()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fIASN1_TIME_normalize()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fIASN1_TIME_cmp_time_t()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fIASN1_TIME_compare()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fBASN1_TIME_to_tm()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fBASN1_TIME_set_string_X509()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fBASN1_TIME_normalize()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fBASN1_TIME_cmp_time_t()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fBASN1_TIME_compare()\fR function was added in OpenSSL 1.1.1.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2015\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2015\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_TYPE_get.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_TYPE_get.3,v 1.3 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_TYPE_get 3"
|
||||
.TH ASN1_TYPE_get 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_TYPE_get 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -161,31 +165,31 @@ These functions allow an \s-1ASN1_TYPE\s0 structure to be manipulated. The
|
|||
\&\s-1ASN1_TYPE\s0 structure can contain any \s-1ASN.1\s0 type or constructed type
|
||||
such as a \s-1SEQUENCE:\s0 it is effectively equivalent to the \s-1ASN.1 ANY\s0 type.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_get()\fR returns the type of \fBa\fR.
|
||||
\&\fBASN1_TYPE_get()\fR returns the type of \fBa\fR.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_set()\fR sets the value of \fBa\fR to \fBtype\fR and \fBvalue\fR. This
|
||||
\&\fBASN1_TYPE_set()\fR sets the value of \fBa\fR to \fBtype\fR and \fBvalue\fR. This
|
||||
function uses the pointer \fBvalue\fR internally so it must \fBnot\fR be freed
|
||||
up after the call.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_set1()\fR sets the value of \fBa\fR to \fBtype\fR a copy of \fBvalue\fR.
|
||||
\&\fBASN1_TYPE_set1()\fR sets the value of \fBa\fR to \fBtype\fR a copy of \fBvalue\fR.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_cmp()\fR compares \s-1ASN.1\s0 types \fBa\fR and \fBb\fR and returns 0 if
|
||||
\&\fBASN1_TYPE_cmp()\fR compares \s-1ASN.1\s0 types \fBa\fR and \fBb\fR and returns 0 if
|
||||
they are identical and non-zero otherwise.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_unpack_sequence()\fR attempts to parse the \s-1SEQUENCE\s0 present in
|
||||
\&\fBASN1_TYPE_unpack_sequence()\fR attempts to parse the \s-1SEQUENCE\s0 present in
|
||||
\&\fBt\fR using the \s-1ASN.1\s0 structure \fBit\fR. If successful it returns a pointer
|
||||
to the \s-1ASN.1\s0 structure corresponding to \fBit\fR which must be freed by the
|
||||
caller. If it fails it return \s-1NULL.\s0
|
||||
.PP
|
||||
\&\fIASN1_TYPE_pack_sequence()\fR attempts to encode the \s-1ASN.1\s0 structure \fBs\fR
|
||||
\&\fBASN1_TYPE_pack_sequence()\fR attempts to encode the \s-1ASN.1\s0 structure \fBs\fR
|
||||
corresponding to \fBit\fR into an \s-1ASN1_TYPE.\s0 If successful the encoded
|
||||
\&\s-1ASN1_TYPE\s0 is returned. If \fBt\fR and \fB*t\fR are not \s-1NULL\s0 the encoded type
|
||||
is written to \fBt\fR overwriting any existing data. If \fBt\fR is not \s-1NULL\s0
|
||||
but \fB*t\fR is \s-1NULL\s0 the returned \s-1ASN1_TYPE\s0 is written to \fB*t\fR.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
The type and meaning of the \fBvalue\fR parameter for \fIASN1_TYPE_set()\fR and
|
||||
\&\fIASN1_TYPE_set1()\fR is determined by the \fBtype\fR parameter.
|
||||
The type and meaning of the \fBvalue\fR parameter for \fBASN1_TYPE_set()\fR and
|
||||
\&\fBASN1_TYPE_set1()\fR is determined by the \fBtype\fR parameter.
|
||||
If \fBtype\fR is V_ASN1_NULL \fBvalue\fR is ignored. If \fBtype\fR is V_ASN1_BOOLEAN
|
||||
then the boolean is set to \s-1TRUE\s0 if \fBvalue\fR is not \s-1NULL.\s0 If \fBtype\fR is
|
||||
V_ASN1_OBJECT then value is an \s-1ASN1_OBJECT\s0 structure. Otherwise \fBtype\fR
|
||||
|
@ -196,12 +200,12 @@ a tagged type (V_ASN1_SEQUENCE, V_ASN1_SET or V_ASN1_OTHER) then the
|
|||
\&\s-1ASN1_STRING\s0 contains the entire \s-1ASN.1\s0 encoding verbatim (including tag and
|
||||
length octets).
|
||||
.PP
|
||||
\&\fIASN1_TYPE_cmp()\fR may not return zero if two types are equivalent but have
|
||||
\&\fBASN1_TYPE_cmp()\fR may not return zero if two types are equivalent but have
|
||||
different encodings. For example the single content octet of the boolean \s-1TRUE\s0
|
||||
value under \s-1BER\s0 can have any non-zero encoding but \fIASN1_TYPE_cmp()\fR will
|
||||
value under \s-1BER\s0 can have any non-zero encoding but \fBASN1_TYPE_cmp()\fR will
|
||||
only return zero if the values are the same.
|
||||
.PP
|
||||
If either or both of the parameters passed to \fIASN1_TYPE_cmp()\fR is \s-1NULL\s0 the
|
||||
If either or both of the parameters passed to \fBASN1_TYPE_cmp()\fR is \s-1NULL\s0 the
|
||||
return value is non-zero. Technically if both parameters are \s-1NULL\s0 the two
|
||||
types could be absent \s-1OPTIONAL\s0 fields and so should match, however passing
|
||||
\&\s-1NULL\s0 values could also indicate a programming error (for example an
|
||||
|
@ -209,18 +213,18 @@ unparseable type which returns \s-1NULL\s0) for types which do \fBnot\fR match.
|
|||
applications should handle the case of two absent values separately.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_TYPE_get()\fR returns the type of the \s-1ASN1_TYPE\s0 argument.
|
||||
\&\fBASN1_TYPE_get()\fR returns the type of the \s-1ASN1_TYPE\s0 argument.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_set()\fR does not return a value.
|
||||
\&\fBASN1_TYPE_set()\fR does not return a value.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_set1()\fR returns 1 for success and 0 for failure.
|
||||
\&\fBASN1_TYPE_set1()\fR returns 1 for success and 0 for failure.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_cmp()\fR returns 0 if the types are identical and non-zero otherwise.
|
||||
\&\fBASN1_TYPE_cmp()\fR returns 0 if the types are identical and non-zero otherwise.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_unpack_sequence()\fR returns a pointer to an \s-1ASN.1\s0 structure or
|
||||
\&\fBASN1_TYPE_unpack_sequence()\fR returns a pointer to an \s-1ASN.1\s0 structure or
|
||||
\&\s-1NULL\s0 on failure.
|
||||
.PP
|
||||
\&\fIASN1_TYPE_pack_sequence()\fR return an \s-1ASN1_TYPE\s0 structure if it succeeds or
|
||||
\&\fBASN1_TYPE_pack_sequence()\fR return an \s-1ASN1_TYPE\s0 structure if it succeeds or
|
||||
\&\s-1NULL\s0 on failure.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASN1_generate_nconf.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASN1_generate_nconf.3,v 1.19 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASN1_generate_nconf 3"
|
||||
.TH ASN1_generate_nconf 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASN1_generate_nconf 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -186,34 +190,34 @@ are acceptable.
|
|||
Encode the \fB\s-1NULL\s0\fR type, the \fBvalue\fR string must not be present.
|
||||
.IP "\fB\s-1INTEGER\s0\fR, \fB\s-1INT\s0\fR" 4
|
||||
.IX Item "INTEGER, INT"
|
||||
Encodes an \s-1ASN1 \s0\fB\s-1INTEGER\s0\fR type. The \fBvalue\fR string represents
|
||||
Encodes an \s-1ASN1\s0 \fB\s-1INTEGER\s0\fR type. The \fBvalue\fR string represents
|
||||
the value of the integer, it can be prefaced by a minus sign and
|
||||
is normally interpreted as a decimal value unless the prefix \fB0x\fR
|
||||
is included.
|
||||
.IP "\fB\s-1ENUMERATED\s0\fR, \fB\s-1ENUM\s0\fR" 4
|
||||
.IX Item "ENUMERATED, ENUM"
|
||||
Encodes the \s-1ASN1 \s0\fB\s-1ENUMERATED\s0\fR type, it is otherwise identical to
|
||||
Encodes the \s-1ASN1\s0 \fB\s-1ENUMERATED\s0\fR type, it is otherwise identical to
|
||||
\&\fB\s-1INTEGER\s0\fR.
|
||||
.IP "\fB\s-1OBJECT\s0\fR, \fB\s-1OID\s0\fR" 4
|
||||
.IX Item "OBJECT, OID"
|
||||
Encodes an \s-1ASN1 \s0\fB\s-1OBJECT IDENTIFIER\s0\fR, the \fBvalue\fR string can be
|
||||
Encodes an \s-1ASN1\s0 \fB\s-1OBJECT IDENTIFIER\s0\fR, the \fBvalue\fR string can be
|
||||
a short name, a long name or numerical format.
|
||||
.IP "\fB\s-1UTCTIME\s0\fR, \fB\s-1UTC\s0\fR" 4
|
||||
.IX Item "UTCTIME, UTC"
|
||||
Encodes an \s-1ASN1 \s0\fBUTCTime\fR structure, the value should be in
|
||||
Encodes an \s-1ASN1\s0 \fBUTCTime\fR structure, the value should be in
|
||||
the format \fB\s-1YYMMDDHHMMSSZ\s0\fR.
|
||||
.IP "\fB\s-1GENERALIZEDTIME\s0\fR, \fB\s-1GENTIME\s0\fR" 4
|
||||
.IX Item "GENERALIZEDTIME, GENTIME"
|
||||
Encodes an \s-1ASN1 \s0\fBGeneralizedTime\fR structure, the value should be in
|
||||
Encodes an \s-1ASN1\s0 \fBGeneralizedTime\fR structure, the value should be in
|
||||
the format \fB\s-1YYYYMMDDHHMMSSZ\s0\fR.
|
||||
.IP "\fB\s-1OCTETSTRING\s0\fR, \fB\s-1OCT\s0\fR" 4
|
||||
.IX Item "OCTETSTRING, OCT"
|
||||
Encodes an \s-1ASN1 \s0\fB\s-1OCTET STRING\s0\fR. \fBvalue\fR represents the contents
|
||||
Encodes an \s-1ASN1\s0 \fB\s-1OCTET STRING\s0\fR. \fBvalue\fR represents the contents
|
||||
of this structure, the format strings \fB\s-1ASCII\s0\fR and \fB\s-1HEX\s0\fR can be
|
||||
used to specify the format of \fBvalue\fR.
|
||||
.IP "\fB\s-1BITSTRING\s0\fR, \fB\s-1BITSTR\s0\fR" 4
|
||||
.IX Item "BITSTRING, BITSTR"
|
||||
Encodes an \s-1ASN1 \s0\fB\s-1BIT STRING\s0\fR. \fBvalue\fR represents the contents
|
||||
Encodes an \s-1ASN1\s0 \fB\s-1BIT STRING\s0\fR. \fBvalue\fR represents the contents
|
||||
of this structure, the format strings \fB\s-1ASCII\s0\fR, \fB\s-1HEX\s0\fR and \fB\s-1BITLIST\s0\fR
|
||||
can be used to specify the format of \fBvalue\fR.
|
||||
.Sp
|
||||
|
@ -225,7 +229,7 @@ These encode the corresponding string types. \fBvalue\fR represents the
|
|||
contents of this structure. The format can be \fB\s-1ASCII\s0\fR or \fB\s-1UTF8\s0\fR.
|
||||
.IP "\fB\s-1SEQUENCE\s0\fR, \fB\s-1SEQ\s0\fR, \fB\s-1SET\s0\fR" 4
|
||||
.IX Item "SEQUENCE, SEQ, SET"
|
||||
Formats the result as an \s-1ASN1 \s0\fB\s-1SEQUENCE\s0\fR or \fB\s-1SET\s0\fR type. \fBvalue\fR
|
||||
Formats the result as an \s-1ASN1\s0 \fB\s-1SEQUENCE\s0\fR or \fB\s-1SET\s0\fR type. \fBvalue\fR
|
||||
should be a section name which will contain the contents. The
|
||||
field names in the section are ignored and the values are in the
|
||||
generated string format. If \fBvalue\fR is absent then an empty \s-1SEQUENCE\s0
|
||||
|
@ -264,6 +268,12 @@ specified then the value string must be a valid \fB\s-1UTF8\s0\fR string. For \f
|
|||
output must be a set of hex digits. \fB\s-1BITLIST\s0\fR (which is only valid for a \s-1BIT
|
||||
STRING\s0) is a comma separated list of the indices of the set bits, all other
|
||||
bits are zero.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fBASN1_generate_nconf()\fR and \fBASN1_generate_v3()\fR return the encoded
|
||||
data as an \fB\s-1ASN1_TYPE\s0\fR structure or \fB\s-1NULL\s0\fR if an error occurred.
|
||||
.PP
|
||||
The error codes that can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "EXAMPLES"
|
||||
.IX Header "EXAMPLES"
|
||||
A simple IA5String:
|
||||
|
@ -362,18 +372,12 @@ structure:
|
|||
\&
|
||||
\& e=INTEGER:0x010001
|
||||
.Ve
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASN1_generate_nconf()\fR and \fIASN1_generate_v3()\fR return the encoded
|
||||
data as an \fB\s-1ASN1_TYPE\s0\fR structure or \fB\s-1NULL\s0\fR if an error occurred.
|
||||
.PP
|
||||
The error codes that can be obtained by \fIERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2002\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2002\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASYNC_WAIT_CTX_new.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASYNC_WAIT_CTX_new.3,v 1.3 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASYNC_WAIT_CTX_new 3"
|
||||
.TH ASYNC_WAIT_CTX_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASYNC_WAIT_CTX_new 3 "2019-03-12" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -167,25 +171,25 @@ libcrypto, -lcrypto
|
|||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
For an overview of how asynchronous operations are implemented in OpenSSL see
|
||||
\&\fIASYNC_start_job\fR\|(3). An \s-1ASYNC_WAIT_CTX\s0 object represents an asynchronous
|
||||
\&\fBASYNC_start_job\fR\|(3). An \s-1ASYNC_WAIT_CTX\s0 object represents an asynchronous
|
||||
\&\*(L"session\*(R", i.e. a related set of crypto operations. For example in \s-1SSL\s0 terms
|
||||
this would have a one-to-one correspondence with an \s-1SSL\s0 connection.
|
||||
.PP
|
||||
Application code must create an \s-1ASYNC_WAIT_CTX\s0 using the \fIASYNC_WAIT_CTX_new()\fR
|
||||
function prior to calling \fIASYNC_start_job()\fR (see \fIASYNC_start_job\fR\|(3)). When
|
||||
Application code must create an \s-1ASYNC_WAIT_CTX\s0 using the \fBASYNC_WAIT_CTX_new()\fR
|
||||
function prior to calling \fBASYNC_start_job()\fR (see \fBASYNC_start_job\fR\|(3)). When
|
||||
the job is started it is associated with the \s-1ASYNC_WAIT_CTX\s0 for the duration of
|
||||
that job. An \s-1ASYNC_WAIT_CTX\s0 should only be used for one \s-1ASYNC_JOB\s0 at any one
|
||||
time, but can be reused after an \s-1ASYNC_JOB\s0 has finished for a subsequent
|
||||
\&\s-1ASYNC_JOB.\s0 When the session is complete (e.g. the \s-1SSL\s0 connection is closed),
|
||||
application code cleans up with \fIASYNC_WAIT_CTX_free()\fR.
|
||||
application code cleans up with \fBASYNC_WAIT_CTX_free()\fR.
|
||||
.PP
|
||||
ASYNC_WAIT_CTXs can have \*(L"wait\*(R" file descriptors associated with them. Calling
|
||||
\&\fIASYNC_WAIT_CTX_get_all_fds()\fR and passing in a pointer to an \s-1ASYNC_WAIT_CTX\s0 in
|
||||
\&\fBASYNC_WAIT_CTX_get_all_fds()\fR and passing in a pointer to an \s-1ASYNC_WAIT_CTX\s0 in
|
||||
the \fBctx\fR parameter will return the wait file descriptors associated with that
|
||||
job in \fB*fd\fR. The number of file descriptors returned will be stored in
|
||||
\&\fB*numfds\fR. It is the caller's responsibility to ensure that sufficient memory
|
||||
has been allocated in \fB*fd\fR to receive all the file descriptors. Calling
|
||||
\&\fIASYNC_WAIT_CTX_get_all_fds()\fR with a \s-1NULL \s0\fBfd\fR value will return no file
|
||||
\&\fBASYNC_WAIT_CTX_get_all_fds()\fR with a \s-1NULL\s0 \fBfd\fR value will return no file
|
||||
descriptors but will still populate \fB*numfds\fR. Therefore application code is
|
||||
typically expected to call this function twice: once to get the number of fds,
|
||||
and then again when sufficient memory has been allocated. If only one
|
||||
|
@ -193,13 +197,13 @@ asynchronous engine is being used then normally this call will only ever return
|
|||
one fd. If multiple asynchronous engines are being used then more could be
|
||||
returned.
|
||||
.PP
|
||||
The function \fIASYNC_WAIT_CTX_get_changed_fds()\fR can be used to detect if any fds
|
||||
have changed since the last call time \fIASYNC_start_job()\fR returned an \s-1ASYNC_PAUSE\s0
|
||||
The function \fBASYNC_WAIT_CTX_get_changed_fds()\fR can be used to detect if any fds
|
||||
have changed since the last call time \fBASYNC_start_job()\fR returned an \s-1ASYNC_PAUSE\s0
|
||||
result (or since the \s-1ASYNC_WAIT_CTX\s0 was created if no \s-1ASYNC_PAUSE\s0 result has
|
||||
been received). The \fBnumaddfds\fR and \fBnumdelfds\fR parameters will be populated
|
||||
with the number of fds added or deleted respectively. \fB*addfd\fR and \fB*delfd\fR
|
||||
will be populated with the list of added and deleted fds respectively. Similarly
|
||||
to \fIASYNC_WAIT_CTX_get_all_fds()\fR either of these can be \s-1NULL,\s0 but if they are not
|
||||
to \fBASYNC_WAIT_CTX_get_all_fds()\fR either of these can be \s-1NULL,\s0 but if they are not
|
||||
\&\s-1NULL\s0 then the caller is responsible for ensuring sufficient memory is allocated.
|
||||
.PP
|
||||
Implementors of async aware code (e.g. engines) are encouraged to return a
|
||||
|
@ -214,25 +218,25 @@ application will have to periodically \*(L"poll\*(R" the job by attempting to re
|
|||
to see if it is ready to continue.
|
||||
.PP
|
||||
Async aware code (e.g. engines) can get the current \s-1ASYNC_WAIT_CTX\s0 from the job
|
||||
via \fIASYNC_get_wait_ctx\fR\|(3) and provide a file descriptor to use for waiting
|
||||
on by calling \fIASYNC_WAIT_CTX_set_wait_fd()\fR. Typically this would be done by an
|
||||
engine immediately prior to calling \fIASYNC_pause_job()\fR and not by end user code.
|
||||
via \fBASYNC_get_wait_ctx\fR\|(3) and provide a file descriptor to use for waiting
|
||||
on by calling \fBASYNC_WAIT_CTX_set_wait_fd()\fR. Typically this would be done by an
|
||||
engine immediately prior to calling \fBASYNC_pause_job()\fR and not by end user code.
|
||||
An existing association with a file descriptor can be obtained using
|
||||
\&\fIASYNC_WAIT_CTX_get_fd()\fR and cleared using \fIASYNC_WAIT_CTX_clear_fd()\fR. Both of
|
||||
\&\fBASYNC_WAIT_CTX_get_fd()\fR and cleared using \fBASYNC_WAIT_CTX_clear_fd()\fR. Both of
|
||||
these functions requires a \fBkey\fR value which is unique to the async aware
|
||||
code. This could be any unique value but a good candidate might be the
|
||||
\&\fB\s-1ENGINE\s0 *\fR for the engine. The \fBcustom_data\fR parameter can be any value, and
|
||||
will be returned in a subsequent call to \fIASYNC_WAIT_CTX_get_fd()\fR. The
|
||||
\&\fIASYNC_WAIT_CTX_set_wait_fd()\fR function also expects a pointer to a \*(L"cleanup\*(R"
|
||||
will be returned in a subsequent call to \fBASYNC_WAIT_CTX_get_fd()\fR. The
|
||||
\&\fBASYNC_WAIT_CTX_set_wait_fd()\fR function also expects a pointer to a \*(L"cleanup\*(R"
|
||||
routine. This can be \s-1NULL\s0 but if provided will automatically get called when
|
||||
the \s-1ASYNC_WAIT_CTX\s0 is freed, and gives the engine the opportunity to close the
|
||||
fd or any other resources. Note: The \*(L"cleanup\*(R" routine does not get called if
|
||||
the fd is cleared directly via a call to \fIASYNC_WAIT_CTX_clear_fd()\fR.
|
||||
the fd is cleared directly via a call to \fBASYNC_WAIT_CTX_clear_fd()\fR.
|
||||
.PP
|
||||
An example of typical usage might be an async capable engine. User code would
|
||||
initiate cryptographic operations. The engine would initiate those operations
|
||||
asynchronously and then call \fIASYNC_WAIT_CTX_set_wait_fd()\fR followed by
|
||||
\&\fIASYNC_pause_job()\fR to return control to the user code. The user code can then
|
||||
asynchronously and then call \fBASYNC_WAIT_CTX_set_wait_fd()\fR followed by
|
||||
\&\fBASYNC_pause_job()\fR to return control to the user code. The user code can then
|
||||
perform other tasks or wait for the job to be ready by calling \*(L"select\*(R" or other
|
||||
similar function on the wait file descriptor. The engine can signal to the user
|
||||
code that the job should be resumed by making the wait file descriptor
|
||||
|
@ -240,7 +244,7 @@ code that the job should be resumed by making the wait file descriptor
|
|||
file descriptor.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIASYNC_WAIT_CTX_new()\fR returns a pointer to the newly allocated \s-1ASYNC_WAIT_CTX\s0 or
|
||||
\&\fBASYNC_WAIT_CTX_new()\fR returns a pointer to the newly allocated \s-1ASYNC_WAIT_CTX\s0 or
|
||||
\&\s-1NULL\s0 on error.
|
||||
.PP
|
||||
ASYNC_WAIT_CTX_set_wait_fd, ASYNC_WAIT_CTX_get_fd, ASYNC_WAIT_CTX_get_all_fds,
|
||||
|
@ -256,13 +260,13 @@ it is defined as an application developer's responsibility to include
|
|||
windows.h prior to async.h.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIcrypto\fR\|(7), \fIASYNC_start_job\fR\|(3)
|
||||
\&\fBcrypto\fR\|(7), \fBASYNC_start_job\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
ASYNC_WAIT_CTX_new, ASYNC_WAIT_CTX_free, ASYNC_WAIT_CTX_set_wait_fd,
|
||||
ASYNC_WAIT_CTX_get_fd, ASYNC_WAIT_CTX_get_all_fds,
|
||||
ASYNC_WAIT_CTX_get_changed_fds, ASYNC_WAIT_CTX_clear_fd were first added to
|
||||
OpenSSL 1.1.0.
|
||||
\&\fBASYNC_WAIT_CTX_new()\fR, \fBASYNC_WAIT_CTX_free()\fR, \fBASYNC_WAIT_CTX_set_wait_fd()\fR,
|
||||
\&\fBASYNC_WAIT_CTX_get_fd()\fR, \fBASYNC_WAIT_CTX_get_all_fds()\fR,
|
||||
\&\fBASYNC_WAIT_CTX_get_changed_fds()\fR and \fBASYNC_WAIT_CTX_clear_fd()\fR
|
||||
were added in OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: ASYNC_start_job.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: ASYNC_start_job.3,v 1.3 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "ASYNC_start_job 3"
|
||||
.TH ASYNC_start_job 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH ASYNC_start_job 3 "2019-03-12" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -173,12 +177,12 @@ The creation of an \s-1ASYNC_JOB\s0 is a relatively expensive operation. Therefo
|
|||
efficiency reasons, jobs can be created up front and reused many times. They are
|
||||
held in a pool until they are needed, at which point they are removed from the
|
||||
pool, used, and then returned to the pool when the job completes. If the user
|
||||
application is multi-threaded, then \fIASYNC_init_thread()\fR may be called for each
|
||||
application is multi-threaded, then \fBASYNC_init_thread()\fR may be called for each
|
||||
thread that will initiate asynchronous jobs. Before
|
||||
user code exits per-thread resources need to be cleaned up. This will normally
|
||||
occur automatically (see \fIOPENSSL_init_crypto\fR\|(3)) but may be explicitly
|
||||
initiated by using \fIASYNC_cleanup_thread()\fR. No asynchronous jobs must be
|
||||
outstanding for the thread when \fIASYNC_cleanup_thread()\fR is called. Failing to
|
||||
occur automatically (see \fBOPENSSL_init_crypto\fR\|(3)) but may be explicitly
|
||||
initiated by using \fBASYNC_cleanup_thread()\fR. No asynchronous jobs must be
|
||||
outstanding for the thread when \fBASYNC_cleanup_thread()\fR is called. Failing to
|
||||
ensure this will result in memory leaks.
|
||||
.PP
|
||||
The \fBmax_size\fR argument limits the number of ASYNC_JOBs that will be held in
|
||||
|
@ -186,14 +190,14 @@ the pool. If \fBmax_size\fR is set to 0 then no upper limit is set. When an
|
|||
\&\s-1ASYNC_JOB\s0 is needed but there are none available in the pool already then one
|
||||
will be automatically created, as long as the total of ASYNC_JOBs managed by the
|
||||
pool does not exceed \fBmax_size\fR. When the pool is first initialised
|
||||
\&\fBinit_size\fR ASYNC_JOBs will be created immediately. If \fIASYNC_init_thread()\fR is
|
||||
\&\fBinit_size\fR ASYNC_JOBs will be created immediately. If \fBASYNC_init_thread()\fR is
|
||||
not called before the pool is first used then it will be called automatically
|
||||
with a \fBmax_size\fR of 0 (no upper limit) and an \fBinit_size\fR of 0 (no ASYNC_JOBs
|
||||
created up front).
|
||||
.PP
|
||||
An asynchronous job is started by calling the \fIASYNC_start_job()\fR function.
|
||||
Initially \fB*job\fR should be \s-1NULL. \s0\fBctx\fR should point to an \s-1ASYNC_WAIT_CTX\s0
|
||||
object created through the \fIASYNC_WAIT_CTX_new\fR\|(3) function. \fBret\fR should
|
||||
An asynchronous job is started by calling the \fBASYNC_start_job()\fR function.
|
||||
Initially \fB*job\fR should be \s-1NULL.\s0 \fBctx\fR should point to an \s-1ASYNC_WAIT_CTX\s0
|
||||
object created through the \fBASYNC_WAIT_CTX_new\fR\|(3) function. \fBret\fR should
|
||||
point to a location where the return value of the asynchronous function should
|
||||
be stored on completion of the job. \fBfunc\fR represents the function that should
|
||||
be started asynchronously. The data pointed to by \fBargs\fR and of size \fBsize\fR
|
||||
|
@ -202,7 +206,7 @@ ASYNC_start_job will return one of the following values:
|
|||
.IP "\fB\s-1ASYNC_ERR\s0\fR" 4
|
||||
.IX Item "ASYNC_ERR"
|
||||
An error occurred trying to start the job. Check the OpenSSL error queue (e.g.
|
||||
see \fIERR_print_errors\fR\|(3)) for more details.
|
||||
see \fBERR_print_errors\fR\|(3)) for more details.
|
||||
.IP "\fB\s-1ASYNC_NO_JOBS\s0\fR" 4
|
||||
.IX Item "ASYNC_NO_JOBS"
|
||||
There are no jobs currently available in the pool. This call can be retried
|
||||
|
@ -210,11 +214,11 @@ again at a later time.
|
|||
.IP "\fB\s-1ASYNC_PAUSE\s0\fR" 4
|
||||
.IX Item "ASYNC_PAUSE"
|
||||
The job was successfully started but was \*(L"paused\*(R" before it completed (see
|
||||
\&\fIASYNC_pause_job()\fR below). A handle to the job is placed in \fB*job\fR. Other work
|
||||
\&\fBASYNC_pause_job()\fR below). A handle to the job is placed in \fB*job\fR. Other work
|
||||
can be performed (if desired) and the job restarted at a later time. To restart
|
||||
a job call \fIASYNC_start_job()\fR again passing the job handle in \fB*job\fR. The
|
||||
a job call \fBASYNC_start_job()\fR again passing the job handle in \fB*job\fR. The
|
||||
\&\fBfunc\fR, \fBargs\fR and \fBsize\fR parameters will be ignored when restarting a job.
|
||||
When restarting a job \fIASYNC_start_job()\fR \fBmust\fR be called from the same thread
|
||||
When restarting a job \fBASYNC_start_job()\fR \fBmust\fR be called from the same thread
|
||||
that the job was originally started from.
|
||||
.IP "\fB\s-1ASYNC_FINISH\s0\fR" 4
|
||||
.IX Item "ASYNC_FINISH"
|
||||
|
@ -222,20 +226,20 @@ The job completed. \fB*job\fR will be \s-1NULL\s0 and the return value from \fBf
|
|||
be placed in \fB*ret\fR.
|
||||
.PP
|
||||
At any one time there can be a maximum of one job actively running per thread
|
||||
(you can have many that are paused). \fIASYNC_get_current_job()\fR can be used to get
|
||||
(you can have many that are paused). \fBASYNC_get_current_job()\fR can be used to get
|
||||
a pointer to the currently executing \s-1ASYNC_JOB.\s0 If no job is currently executing
|
||||
then this will return \s-1NULL.\s0
|
||||
.PP
|
||||
If executing within the context of a job (i.e. having been called directly or
|
||||
indirectly by the function \*(L"func\*(R" passed as an argument to \fIASYNC_start_job()\fR)
|
||||
then \fIASYNC_pause_job()\fR will immediately return control to the calling
|
||||
application with \s-1ASYNC_PAUSE\s0 returned from the \fIASYNC_start_job()\fR call. A
|
||||
indirectly by the function \*(L"func\*(R" passed as an argument to \fBASYNC_start_job()\fR)
|
||||
then \fBASYNC_pause_job()\fR will immediately return control to the calling
|
||||
application with \s-1ASYNC_PAUSE\s0 returned from the \fBASYNC_start_job()\fR call. A
|
||||
subsequent call to ASYNC_start_job passing in the relevant \s-1ASYNC_JOB\s0 in the
|
||||
\&\fB*job\fR parameter will resume execution from the \fIASYNC_pause_job()\fR call. If
|
||||
\&\fIASYNC_pause_job()\fR is called whilst not within the context of a job then no
|
||||
action is taken and \fIASYNC_pause_job()\fR returns immediately.
|
||||
\&\fB*job\fR parameter will resume execution from the \fBASYNC_pause_job()\fR call. If
|
||||
\&\fBASYNC_pause_job()\fR is called whilst not within the context of a job then no
|
||||
action is taken and \fBASYNC_pause_job()\fR returns immediately.
|
||||
.PP
|
||||
\&\fIASYNC_get_wait_ctx()\fR can be used to get a pointer to the \s-1ASYNC_WAIT_CTX\s0
|
||||
\&\fBASYNC_get_wait_ctx()\fR can be used to get a pointer to the \s-1ASYNC_WAIT_CTX\s0
|
||||
for the \fBjob\fR. ASYNC_WAIT_CTXs can have a \*(L"wait\*(R" file descriptor associated
|
||||
with them. Applications can wait for the file descriptor to be ready for \*(L"read\*(R"
|
||||
using a system function call such as select or poll (being ready for \*(L"read\*(R"
|
||||
|
@ -245,30 +249,30 @@ attempting to restart it to see if it is ready to continue.
|
|||
.PP
|
||||
An example of typical usage might be an async capable engine. User code would
|
||||
initiate cryptographic operations. The engine would initiate those operations
|
||||
asynchronously and then call \fIASYNC_WAIT_CTX_set_wait_fd\fR\|(3) followed by
|
||||
\&\fIASYNC_pause_job()\fR to return control to the user code. The user code can then
|
||||
asynchronously and then call \fBASYNC_WAIT_CTX_set_wait_fd\fR\|(3) followed by
|
||||
\&\fBASYNC_pause_job()\fR to return control to the user code. The user code can then
|
||||
perform other tasks or wait for the job to be ready by calling \*(L"select\*(R" or other
|
||||
similar function on the wait file descriptor. The engine can signal to the user
|
||||
code that the job should be resumed by making the wait file descriptor
|
||||
\&\*(L"readable\*(R". Once resumed the engine should clear the wake signal on the wait
|
||||
file descriptor.
|
||||
.PP
|
||||
The \fIASYNC_block_pause()\fR function will prevent the currently active job from
|
||||
The \fBASYNC_block_pause()\fR function will prevent the currently active job from
|
||||
pausing. The block will remain in place until a subsequent call to
|
||||
\&\fIASYNC_unblock_pause()\fR. These functions can be nested, e.g. if you call
|
||||
\&\fIASYNC_block_pause()\fR twice then you must call \fIASYNC_unblock_pause()\fR twice in
|
||||
\&\fBASYNC_unblock_pause()\fR. These functions can be nested, e.g. if you call
|
||||
\&\fBASYNC_block_pause()\fR twice then you must call \fBASYNC_unblock_pause()\fR twice in
|
||||
order to re-enable pausing. If these functions are called while there is no
|
||||
currently active job then they have no effect. This functionality can be useful
|
||||
to avoid deadlock scenarios. For example during the execution of an \s-1ASYNC_JOB\s0 an
|
||||
application acquires a lock. It then calls some cryptographic function which
|
||||
invokes \fIASYNC_pause_job()\fR. This returns control back to the code that created
|
||||
invokes \fBASYNC_pause_job()\fR. This returns control back to the code that created
|
||||
the \s-1ASYNC_JOB.\s0 If that code then attempts to acquire the same lock before
|
||||
resuming the original job then a deadlock can occur. By calling
|
||||
\&\fIASYNC_block_pause()\fR immediately after acquiring the lock and
|
||||
\&\fIASYNC_unblock_pause()\fR immediately before releasing it then this situation cannot
|
||||
\&\fBASYNC_block_pause()\fR immediately after acquiring the lock and
|
||||
\&\fBASYNC_unblock_pause()\fR immediately before releasing it then this situation cannot
|
||||
occur.
|
||||
.PP
|
||||
Some platforms cannot support async operations. The \fIASYNC_is_capable()\fR function
|
||||
Some platforms cannot support async operations. The \fBASYNC_is_capable()\fR function
|
||||
can be used to detect whether the current platform is async capable or not.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
|
@ -284,9 +288,9 @@ returned.
|
|||
ASYNC_get_current_job returns a pointer to the currently executing \s-1ASYNC_JOB\s0 or
|
||||
\&\s-1NULL\s0 if not within the context of a job.
|
||||
.PP
|
||||
\&\fIASYNC_get_wait_ctx()\fR returns a pointer to the \s-1ASYNC_WAIT_CTX\s0 for the job.
|
||||
\&\fBASYNC_get_wait_ctx()\fR returns a pointer to the \s-1ASYNC_WAIT_CTX\s0 for the job.
|
||||
.PP
|
||||
\&\fIASYNC_is_capable()\fR returns 1 if the current platform is async capable or 0
|
||||
\&\fBASYNC_is_capable()\fR returns 1 if the current platform is async capable or 0
|
||||
otherwise.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
|
@ -439,13 +443,13 @@ The expected output from executing the above example program is:
|
|||
.Ve
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIcrypto\fR\|(7), \fIERR_print_errors\fR\|(3)
|
||||
\&\fBcrypto\fR\|(7), \fBERR_print_errors\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
ASYNC_init_thread, ASYNC_cleanup_thread,
|
||||
ASYNC_start_job, ASYNC_pause_job, ASYNC_get_current_job, \fIASYNC_get_wait_ctx()\fR,
|
||||
\&\fIASYNC_block_pause()\fR, \fIASYNC_unblock_pause()\fR and \fIASYNC_is_capable()\fR were first
|
||||
added to OpenSSL 1.1.0.
|
||||
ASYNC_start_job, ASYNC_pause_job, ASYNC_get_current_job, \fBASYNC_get_wait_ctx()\fR,
|
||||
\&\fBASYNC_block_pause()\fR, \fBASYNC_unblock_pause()\fR and \fBASYNC_is_capable()\fR were first
|
||||
added in OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2015\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BF_encrypt.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BF_encrypt.3,v 1.3 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BF_encrypt 3"
|
||||
.TH BF_encrypt 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BF_encrypt 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -172,59 +176,59 @@ by Counterpane (see http://www.counterpane.com/blowfish.html ).
|
|||
Blowfish is a block cipher that operates on 64 bit (8 byte) blocks of data.
|
||||
It uses a variable size key, but typically, 128 bit (16 byte) keys are
|
||||
considered good for strong encryption. Blowfish can be used in the same
|
||||
modes as \s-1DES \s0(see \fIdes_modes\fR\|(7)). Blowfish is currently one
|
||||
modes as \s-1DES\s0 (see \fBdes_modes\fR\|(7)). Blowfish is currently one
|
||||
of the faster block ciphers. It is quite a bit faster than \s-1DES,\s0 and much
|
||||
faster than \s-1IDEA\s0 or \s-1RC2.\s0
|
||||
.PP
|
||||
Blowfish consists of a key setup phase and the actual encryption or decryption
|
||||
phase.
|
||||
.PP
|
||||
\&\fIBF_set_key()\fR sets up the \fB\s-1BF_KEY\s0\fR \fBkey\fR using the \fBlen\fR bytes long key
|
||||
\&\fBBF_set_key()\fR sets up the \fB\s-1BF_KEY\s0\fR \fBkey\fR using the \fBlen\fR bytes long key
|
||||
at \fBdata\fR.
|
||||
.PP
|
||||
\&\fIBF_ecb_encrypt()\fR is the basic Blowfish encryption and decryption function.
|
||||
\&\fBBF_ecb_encrypt()\fR is the basic Blowfish encryption and decryption function.
|
||||
It encrypts or decrypts the first 64 bits of \fBin\fR using the key \fBkey\fR,
|
||||
putting the result in \fBout\fR. \fBenc\fR decides if encryption (\fB\s-1BF_ENCRYPT\s0\fR)
|
||||
or decryption (\fB\s-1BF_DECRYPT\s0\fR) shall be performed. The vector pointed at by
|
||||
\&\fBin\fR and \fBout\fR must be 64 bits in length, no less. If they are larger,
|
||||
everything after the first 64 bits is ignored.
|
||||
.PP
|
||||
The mode functions \fIBF_cbc_encrypt()\fR, \fIBF_cfb64_encrypt()\fR and \fIBF_ofb64_encrypt()\fR
|
||||
The mode functions \fBBF_cbc_encrypt()\fR, \fBBF_cfb64_encrypt()\fR and \fBBF_ofb64_encrypt()\fR
|
||||
all operate on variable length data. They all take an initialization vector
|
||||
\&\fBivec\fR which needs to be passed along into the next call of the same function
|
||||
for the same message. \fBivec\fR may be initialized with anything, but the
|
||||
recipient needs to know what it was initialized with, or it won't be able
|
||||
to decrypt. Some programs and protocols simplify this, like \s-1SSH,\s0 where
|
||||
\&\fBivec\fR is simply initialized to zero.
|
||||
\&\fIBF_cbc_encrypt()\fR operates on data that is a multiple of 8 bytes long, while
|
||||
\&\fIBF_cfb64_encrypt()\fR and \fIBF_ofb64_encrypt()\fR are used to encrypt an variable
|
||||
\&\fBBF_cbc_encrypt()\fR operates on data that is a multiple of 8 bytes long, while
|
||||
\&\fBBF_cfb64_encrypt()\fR and \fBBF_ofb64_encrypt()\fR are used to encrypt an variable
|
||||
number of bytes (the amount does not have to be an exact multiple of 8). The
|
||||
purpose of the latter two is to simulate stream ciphers, and therefore, they
|
||||
need the parameter \fBnum\fR, which is a pointer to an integer where the current
|
||||
offset in \fBivec\fR is stored between calls. This integer must be initialized
|
||||
to zero when \fBivec\fR is initialized.
|
||||
.PP
|
||||
\&\fIBF_cbc_encrypt()\fR is the Cipher Block Chaining function for Blowfish. It
|
||||
\&\fBBF_cbc_encrypt()\fR is the Cipher Block Chaining function for Blowfish. It
|
||||
encrypts or decrypts the 64 bits chunks of \fBin\fR using the key \fBschedule\fR,
|
||||
putting the result in \fBout\fR. \fBenc\fR decides if encryption (\s-1BF_ENCRYPT\s0) or
|
||||
decryption (\s-1BF_DECRYPT\s0) shall be performed. \fBivec\fR must point at an 8 byte
|
||||
long initialization vector.
|
||||
.PP
|
||||
\&\fIBF_cfb64_encrypt()\fR is the \s-1CFB\s0 mode for Blowfish with 64 bit feedback.
|
||||
\&\fBBF_cfb64_encrypt()\fR is the \s-1CFB\s0 mode for Blowfish with 64 bit feedback.
|
||||
It encrypts or decrypts the bytes in \fBin\fR using the key \fBschedule\fR,
|
||||
putting the result in \fBout\fR. \fBenc\fR decides if encryption (\fB\s-1BF_ENCRYPT\s0\fR)
|
||||
or decryption (\fB\s-1BF_DECRYPT\s0\fR) shall be performed. \fBivec\fR must point at an
|
||||
8 byte long initialization vector. \fBnum\fR must point at an integer which must
|
||||
be initially zero.
|
||||
.PP
|
||||
\&\fIBF_ofb64_encrypt()\fR is the \s-1OFB\s0 mode for Blowfish with 64 bit feedback.
|
||||
It uses the same parameters as \fIBF_cfb64_encrypt()\fR, which must be initialized
|
||||
\&\fBBF_ofb64_encrypt()\fR is the \s-1OFB\s0 mode for Blowfish with 64 bit feedback.
|
||||
It uses the same parameters as \fBBF_cfb64_encrypt()\fR, which must be initialized
|
||||
the same way.
|
||||
.PP
|
||||
\&\fIBF_encrypt()\fR and \fIBF_decrypt()\fR are the lowest level functions for Blowfish
|
||||
\&\fBBF_encrypt()\fR and \fBBF_decrypt()\fR are the lowest level functions for Blowfish
|
||||
encryption. They encrypt/decrypt the first 64 bits of the vector pointed by
|
||||
\&\fBdata\fR, using the key \fBkey\fR. These functions should not be used unless you
|
||||
implement 'modes' of Blowfish. The alternative is to use \fIBF_ecb_encrypt()\fR.
|
||||
implement 'modes' of Blowfish. The alternative is to use \fBBF_ecb_encrypt()\fR.
|
||||
If you still want to use these functions, you should be aware that they take
|
||||
each 32\-bit chunk in host-byte order, which is little-endian on little-endian
|
||||
platforms and big-endian on big-endian ones.
|
||||
|
@ -234,12 +238,12 @@ None of the functions presented here return any value.
|
|||
.SH "NOTE"
|
||||
.IX Header "NOTE"
|
||||
Applications should use the higher level functions
|
||||
\&\fIEVP_EncryptInit\fR\|(3) etc. instead of calling these
|
||||
\&\fBEVP_EncryptInit\fR\|(3) etc. instead of calling these
|
||||
functions directly.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIEVP_EncryptInit\fR\|(3),
|
||||
\&\fIdes_modes\fR\|(7)
|
||||
\&\fBEVP_EncryptInit\fR\|(3),
|
||||
\&\fBdes_modes\fR\|(7)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_ADDR.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_ADDR.3,v 1.3 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_ADDR 3"
|
||||
.TH BIO_ADDR 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_ADDR 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -170,31 +174,31 @@ addresses that OpenSSL deals with, currently transparently
|
|||
supporting \s-1AF_INET, AF_INET6\s0 and \s-1AF_UNIX\s0 according to what's
|
||||
available on the platform at hand.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_new()\fR creates a new unfilled \fB\s-1BIO_ADDR\s0\fR, to be used
|
||||
\&\fBBIO_ADDR_new()\fR creates a new unfilled \fB\s-1BIO_ADDR\s0\fR, to be used
|
||||
with routines that will fill it with information, such as
|
||||
\&\fIBIO_accept_ex()\fR.
|
||||
\&\fBBIO_accept_ex()\fR.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_free()\fR frees a \fB\s-1BIO_ADDR\s0\fR created with \fIBIO_ADDR_new()\fR.
|
||||
\&\fBBIO_ADDR_free()\fR frees a \fB\s-1BIO_ADDR\s0\fR created with \fBBIO_ADDR_new()\fR.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_clear()\fR clears any data held within the provided \fB\s-1BIO_ADDR\s0\fR and sets
|
||||
\&\fBBIO_ADDR_clear()\fR clears any data held within the provided \fB\s-1BIO_ADDR\s0\fR and sets
|
||||
it back to an uninitialised state.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_rawmake()\fR takes a protocol \fBfamily\fR, an byte array of
|
||||
\&\fBBIO_ADDR_rawmake()\fR takes a protocol \fBfamily\fR, an byte array of
|
||||
size \fBwherelen\fR with an address in network byte order pointed at
|
||||
by \fBwhere\fR and a port number in network byte order in \fBport\fR (except
|
||||
for the \fB\s-1AF_UNIX\s0\fR protocol family, where \fBport\fR is meaningless and
|
||||
therefore ignored) and populates the given \fB\s-1BIO_ADDR\s0\fR with them.
|
||||
In case this creates a \fB\s-1AF_UNIX\s0\fR \fB\s-1BIO_ADDR\s0\fR, \fBwherelen\fR is expected
|
||||
to be the length of the path string (not including the terminating
|
||||
\&\s-1NUL,\s0 such as the result of a call to \fIstrlen()\fR).
|
||||
\&\s-1NUL,\s0 such as the result of a call to \fBstrlen()\fR).
|
||||
\&\fIRead on about the addresses in \*(L"\s-1RAW ADDRESSES\*(R"\s0 below\fR.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_family()\fR returns the protocol family of the given
|
||||
\&\fBBIO_ADDR_family()\fR returns the protocol family of the given
|
||||
\&\fB\s-1BIO_ADDR\s0\fR. The possible non-error results are one of the
|
||||
constants \s-1AF_INET, AF_INET6\s0 and \s-1AF_UNIX.\s0 It will also return \s-1AF_UNSPEC\s0 if the
|
||||
\&\s-1BIO_ADDR\s0 has not been initialised.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_rawaddress()\fR will write the raw address of the given
|
||||
\&\fBBIO_ADDR_rawaddress()\fR will write the raw address of the given
|
||||
\&\fB\s-1BIO_ADDR\s0\fR in the area pointed at by \fBp\fR if \fBp\fR is non-NULL,
|
||||
and will set \fB*l\fR to be the amount of bytes the raw address
|
||||
takes up if \fBl\fR is non-NULL.
|
||||
|
@ -203,41 +207,41 @@ with \fBp\fR set to \fB\s-1NULL\s0\fR. The raw address will be in network byte
|
|||
order, most significant byte first.
|
||||
In case this is a \fB\s-1AF_UNIX\s0\fR \fB\s-1BIO_ADDR\s0\fR, \fBl\fR gets the length of the
|
||||
path string (not including the terminating \s-1NUL,\s0 such as the result of
|
||||
a call to \fIstrlen()\fR).
|
||||
a call to \fBstrlen()\fR).
|
||||
\&\fIRead on about the addresses in \*(L"\s-1RAW ADDRESSES\*(R"\s0 below\fR.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_rawport()\fR returns the raw port of the given \fB\s-1BIO_ADDR\s0\fR.
|
||||
\&\fBBIO_ADDR_rawport()\fR returns the raw port of the given \fB\s-1BIO_ADDR\s0\fR.
|
||||
The raw port will be in network byte order.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_hostname_string()\fR returns a character string with the
|
||||
\&\fBBIO_ADDR_hostname_string()\fR returns a character string with the
|
||||
hostname of the given \fB\s-1BIO_ADDR\s0\fR. If \fBnumeric\fR is 1, the string
|
||||
will contain the numerical form of the address. This only works for
|
||||
\&\fB\s-1BIO_ADDR\s0\fR of the protocol families \s-1AF_INET\s0 and \s-1AF_INET6. \s0 The
|
||||
\&\fB\s-1BIO_ADDR\s0\fR of the protocol families \s-1AF_INET\s0 and \s-1AF_INET6.\s0 The
|
||||
returned string has been allocated on the heap and must be freed
|
||||
with \fIOPENSSL_free()\fR.
|
||||
with \fBOPENSSL_free()\fR.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_service_string()\fR returns a character string with the
|
||||
\&\fBBIO_ADDR_service_string()\fR returns a character string with the
|
||||
service name of the port of the given \fB\s-1BIO_ADDR\s0\fR. If \fBnumeric\fR
|
||||
is 1, the string will contain the port number. This only works
|
||||
for \fB\s-1BIO_ADDR\s0\fR of the protocol families \s-1AF_INET\s0 and \s-1AF_INET6. \s0 The
|
||||
for \fB\s-1BIO_ADDR\s0\fR of the protocol families \s-1AF_INET\s0 and \s-1AF_INET6.\s0 The
|
||||
returned string has been allocated on the heap and must be freed
|
||||
with \fIOPENSSL_free()\fR.
|
||||
with \fBOPENSSL_free()\fR.
|
||||
.PP
|
||||
\&\fIBIO_ADDR_path_string()\fR returns a character string with the path
|
||||
\&\fBBIO_ADDR_path_string()\fR returns a character string with the path
|
||||
of the given \fB\s-1BIO_ADDR\s0\fR. This only works for \fB\s-1BIO_ADDR\s0\fR of the
|
||||
protocol family \s-1AF_UNIX. \s0 The returned string has been allocated
|
||||
on the heap and must be freed with \fIOPENSSL_free()\fR.
|
||||
protocol family \s-1AF_UNIX.\s0 The returned string has been allocated
|
||||
on the heap and must be freed with \fBOPENSSL_free()\fR.
|
||||
.SH "RAW ADDRESSES"
|
||||
.IX Header "RAW ADDRESSES"
|
||||
Both \fIBIO_ADDR_rawmake()\fR and \fIBIO_ADDR_rawaddress()\fR take a pointer to a
|
||||
Both \fBBIO_ADDR_rawmake()\fR and \fBBIO_ADDR_rawaddress()\fR take a pointer to a
|
||||
network byte order address of a specific site. Internally, those are
|
||||
treated as a pointer to \fBstruct in_addr\fR (for \fB\s-1AF_INET\s0\fR), \fBstruct
|
||||
in6_addr\fR (for \fB\s-1AF_INET6\s0\fR) or \fBchar *\fR (for \fB\s-1AF_UNIX\s0\fR), all
|
||||
depending on the protocol family the address is for.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
The string producing functions \fIBIO_ADDR_hostname_string()\fR,
|
||||
\&\fIBIO_ADDR_service_string()\fR and \fIBIO_ADDR_path_string()\fR will
|
||||
The string producing functions \fBBIO_ADDR_hostname_string()\fR,
|
||||
\&\fBBIO_ADDR_service_string()\fR and \fBBIO_ADDR_path_string()\fR will
|
||||
return \fB\s-1NULL\s0\fR on error and leave an error indication on the
|
||||
OpenSSL error stack.
|
||||
.PP
|
||||
|
@ -245,7 +249,7 @@ All other functions described here return 0 or \fB\s-1NULL\s0\fR when the
|
|||
information they should return isn't available.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIBIO_connect\fR\|(3), \fIBIO_s_connect\fR\|(3)
|
||||
\&\fBBIO_connect\fR\|(3), \fBBIO_s_connect\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_ADDRINFO.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_ADDRINFO.3,v 1.3 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_ADDRINFO 3"
|
||||
.TH BIO_ADDRINFO 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_ADDRINFO 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -179,47 +183,47 @@ types provided on your platform.
|
|||
\&\fB\s-1BIO_ADDRINFO\s0\fR normally forms a chain of several that can be
|
||||
picked at one by one.
|
||||
.PP
|
||||
\&\fIBIO_lookup_ex()\fR looks up a specified \fBhost\fR and \fBservice\fR, and
|
||||
\&\fBBIO_lookup_ex()\fR looks up a specified \fBhost\fR and \fBservice\fR, and
|
||||
uses \fBlookup_type\fR to determine what the default address should
|
||||
be if \fBhost\fR is \fB\s-1NULL\s0\fR. \fBfamily\fR, \fBsocktype\fR and \fBprotocol\fR are used to
|
||||
determine what protocol family, socket type and protocol should be used for
|
||||
the lookup. \fBfamily\fR can be any of \s-1AF_INET, AF_INET6, AF_UNIX\s0 and
|
||||
\&\s-1AF_UNSPEC. \s0\fBsocktype\fR can be \s-1SOCK_STREAM, SOCK_DGRAM\s0 or 0. Specifying 0
|
||||
\&\s-1AF_UNSPEC.\s0 \fBsocktype\fR can be \s-1SOCK_STREAM, SOCK_DGRAM\s0 or 0. Specifying 0
|
||||
indicates that any type can be used. \fBprotocol\fR specifies a protocol such as
|
||||
\&\s-1IPPROTO_TCP, IPPROTO_UDP\s0 or \s-1IPPORTO_SCTP.\s0 If set to 0 than any protocol can be
|
||||
used. \fBres\fR points at a pointer to hold the start of a \fB\s-1BIO_ADDRINFO\s0\fR
|
||||
chain.
|
||||
.PP
|
||||
For the family \fB\s-1AF_UNIX\s0\fR, \fIBIO_lookup_ex()\fR will ignore the \fBservice\fR
|
||||
For the family \fB\s-1AF_UNIX\s0\fR, \fBBIO_lookup_ex()\fR will ignore the \fBservice\fR
|
||||
parameter and expects the \fBnode\fR parameter to hold the path to the
|
||||
socket file.
|
||||
.PP
|
||||
\&\fIBIO_lookup()\fR does the same as \fIBIO_lookup_ex()\fR but does not provide the ability
|
||||
\&\fBBIO_lookup()\fR does the same as \fBBIO_lookup_ex()\fR but does not provide the ability
|
||||
to select based on the protocol (any protocol may be returned).
|
||||
.PP
|
||||
\&\fIBIO_ADDRINFO_family()\fR returns the family of the given
|
||||
\&\fBBIO_ADDRINFO_family()\fR returns the family of the given
|
||||
\&\fB\s-1BIO_ADDRINFO\s0\fR. The result will be one of the constants
|
||||
\&\s-1AF_INET, AF_INET6\s0 and \s-1AF_UNIX.\s0
|
||||
.PP
|
||||
\&\fIBIO_ADDRINFO_socktype()\fR returns the socket type of the given
|
||||
\&\fBBIO_ADDRINFO_socktype()\fR returns the socket type of the given
|
||||
\&\fB\s-1BIO_ADDRINFO\s0\fR. The result will be one of the constants
|
||||
\&\s-1SOCK_STREAM\s0 and \s-1SOCK_DGRAM.\s0
|
||||
.PP
|
||||
\&\fIBIO_ADDRINFO_protocol()\fR returns the protocol id of the given
|
||||
\&\fBBIO_ADDRINFO_protocol()\fR returns the protocol id of the given
|
||||
\&\fB\s-1BIO_ADDRINFO\s0\fR. The result will be one of the constants
|
||||
\&\s-1IPPROTO_TCP\s0 and \s-1IPPROTO_UDP.\s0
|
||||
.PP
|
||||
\&\fIBIO_ADDRINFO_address()\fR returns the underlying \fB\s-1BIO_ADDR\s0\fR
|
||||
\&\fBBIO_ADDRINFO_address()\fR returns the underlying \fB\s-1BIO_ADDR\s0\fR
|
||||
of the given \fB\s-1BIO_ADDRINFO\s0\fR.
|
||||
.PP
|
||||
\&\fIBIO_ADDRINFO_next()\fR returns the next \fB\s-1BIO_ADDRINFO\s0\fR in the chain
|
||||
\&\fBBIO_ADDRINFO_next()\fR returns the next \fB\s-1BIO_ADDRINFO\s0\fR in the chain
|
||||
from the given one.
|
||||
.PP
|
||||
\&\fIBIO_ADDRINFO_free()\fR frees the chain of \fB\s-1BIO_ADDRINFO\s0\fR starting
|
||||
\&\fBBIO_ADDRINFO_free()\fR frees the chain of \fB\s-1BIO_ADDRINFO\s0\fR starting
|
||||
with the given one.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_lookup_ex()\fR and \fIBIO_lookup()\fR return 1 on success and 0 when an error
|
||||
\&\fBBIO_lookup_ex()\fR and \fBBIO_lookup()\fR return 1 on success and 0 when an error
|
||||
occurred, and will leave an error indication on the OpenSSL error stack in that
|
||||
case.
|
||||
.PP
|
||||
|
@ -227,14 +231,14 @@ All other functions described here return 0 or \fB\s-1NULL\s0\fR when the
|
|||
information they should return isn't available.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
The \fIBIO_lookup_ex()\fR implementation uses the platform provided \fIgetaddrinfo()\fR
|
||||
The \fBBIO_lookup_ex()\fR implementation uses the platform provided \fBgetaddrinfo()\fR
|
||||
function. On Linux it is known that specifying 0 for the protocol will not
|
||||
return any \s-1SCTP\s0 based addresses when calling \fIgetaddrinfo()\fR. Therefore if an \s-1SCTP\s0
|
||||
address is required then the \fBprotocol\fR parameter to \fIBIO_lookup_ex()\fR should be
|
||||
return any \s-1SCTP\s0 based addresses when calling \fBgetaddrinfo()\fR. Therefore if an \s-1SCTP\s0
|
||||
address is required then the \fBprotocol\fR parameter to \fBBIO_lookup_ex()\fR should be
|
||||
explicitly set to \s-1IPPROTO_SCTP.\s0 The same may be true on other platforms.
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
The \fIBIO_lookup_ex()\fR function was added in OpenSSL 1.1.1.
|
||||
The \fBBIO_lookup_ex()\fR function was added in OpenSSL 1.1.1.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2016\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_connect.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_connect.3,v 1.3 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_connect 3"
|
||||
.TH BIO_connect 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_connect 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -155,32 +159,32 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_socket()\fR creates a socket in the domain \fBdomain\fR, of type
|
||||
\&\fBBIO_socket()\fR creates a socket in the domain \fBdomain\fR, of type
|
||||
\&\fBsocktype\fR and \fBprotocol\fR. Socket \fBoptions\fR are currently unused,
|
||||
but is present for future use.
|
||||
.PP
|
||||
\&\fIBIO_bind()\fR binds the source address and service to a socket and
|
||||
may be useful before calling \fIBIO_connect()\fR. The options may include
|
||||
\&\fBBIO_bind()\fR binds the source address and service to a socket and
|
||||
may be useful before calling \fBBIO_connect()\fR. The options may include
|
||||
\&\fB\s-1BIO_SOCK_REUSADDR\s0\fR, which is described in \*(L"\s-1FLAGS\*(R"\s0 below.
|
||||
.PP
|
||||
\&\fIBIO_connect()\fR connects \fBsock\fR to the address and service given by
|
||||
\&\fBBIO_connect()\fR connects \fBsock\fR to the address and service given by
|
||||
\&\fBaddr\fR. Connection \fBoptions\fR may be zero or any combination of
|
||||
\&\fB\s-1BIO_SOCK_KEEPALIVE\s0\fR, \fB\s-1BIO_SOCK_NONBLOCK\s0\fR and \fB\s-1BIO_SOCK_NODELAY\s0\fR.
|
||||
The flags are described in \*(L"\s-1FLAGS\*(R"\s0 below.
|
||||
.PP
|
||||
\&\fIBIO_listen()\fR has \fBsock\fR start listening on the address and service
|
||||
\&\fBBIO_listen()\fR has \fBsock\fR start listening on the address and service
|
||||
given by \fBaddr\fR. Connection \fBoptions\fR may be zero or any
|
||||
combination of \fB\s-1BIO_SOCK_KEEPALIVE\s0\fR, \fB\s-1BIO_SOCK_NONBLOCK\s0\fR,
|
||||
\&\fB\s-1BIO_SOCK_NODELAY\s0\fR, \fB\s-1BIO_SOCK_REUSEADDR\s0\fR and \fB\s-1BIO_SOCK_V6_ONLY\s0\fR.
|
||||
The flags are described in \*(L"\s-1FLAGS\*(R"\s0 below.
|
||||
.PP
|
||||
\&\fIBIO_accept_ex()\fR waits for an incoming connections on the given
|
||||
\&\fBBIO_accept_ex()\fR waits for an incoming connections on the given
|
||||
socket \fBaccept_sock\fR. When it gets a connection, the address and
|
||||
port of the peer gets stored in \fBpeer\fR if that one is non-NULL.
|
||||
Accept \fBoptions\fR may be zero or \fB\s-1BIO_SOCK_NONBLOCK\s0\fR, and is applied
|
||||
on the accepted socket. The flags are described in \*(L"\s-1FLAGS\*(R"\s0 below.
|
||||
.PP
|
||||
\&\fIBIO_closesocket()\fR closes \fBsock\fR.
|
||||
\&\fBBIO_closesocket()\fR closes \fBsock\fR.
|
||||
.SH "FLAGS"
|
||||
.IX Header "FLAGS"
|
||||
.IP "\s-1BIO_SOCK_KEEPALIVE\s0" 4
|
||||
|
@ -211,29 +215,29 @@ These flags are bit flags, so they are to be combined with the
|
|||
.Ve
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_socket()\fR returns the socket number on success or \fB\s-1INVALID_SOCKET\s0\fR
|
||||
\&\fBBIO_socket()\fR returns the socket number on success or \fB\s-1INVALID_SOCKET\s0\fR
|
||||
(\-1) on error. When an error has occurred, the OpenSSL error stack
|
||||
will hold the error data and errno has the system error.
|
||||
.PP
|
||||
\&\fIBIO_bind()\fR, \fIBIO_connect()\fR and \fIBIO_listen()\fR return 1 on success or 0 on error.
|
||||
\&\fBBIO_bind()\fR, \fBBIO_connect()\fR and \fBBIO_listen()\fR return 1 on success or 0 on error.
|
||||
When an error has occurred, the OpenSSL error stack will hold the error
|
||||
data and errno has the system error.
|
||||
.PP
|
||||
\&\fIBIO_accept_ex()\fR returns the accepted socket on success or
|
||||
\&\fBBIO_accept_ex()\fR returns the accepted socket on success or
|
||||
\&\fB\s-1INVALID_SOCKET\s0\fR (\-1) on error. When an error has occurred, the
|
||||
OpenSSL error stack will hold the error data and errno has the system
|
||||
error.
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBIO_gethostname()\fR, \fIBIO_get_port()\fR, \fIBIO_get_host_ip()\fR,
|
||||
\&\fIBIO_get_accept_socket()\fR and \fIBIO_accept()\fR were deprecated in
|
||||
OpenSSL 1.1.0. Use the functions described above instead.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\s-1\fIBIO_ADDR\s0\fR\|(3)
|
||||
\&\s-1\fBBIO_ADDR\s0\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fBBIO_gethostname()\fR, \fBBIO_get_port()\fR, \fBBIO_get_host_ip()\fR,
|
||||
\&\fBBIO_get_accept_socket()\fR and \fBBIO_accept()\fR were deprecated in OpenSSL 1.1.0.
|
||||
Use the functions described above instead.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2016\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2016\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_ctrl.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_ctrl.3,v 1.19 2019/06/09 18:44:30 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_ctrl 3"
|
||||
.TH BIO_ctrl 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_ctrl 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -173,90 +177,90 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_ctrl()\fR, \fIBIO_callback_ctrl()\fR, \fIBIO_ptr_ctrl()\fR and \fIBIO_int_ctrl()\fR
|
||||
are \s-1BIO \s0\*(L"control\*(R" operations taking arguments of various types.
|
||||
\&\fBBIO_ctrl()\fR, \fBBIO_callback_ctrl()\fR, \fBBIO_ptr_ctrl()\fR and \fBBIO_int_ctrl()\fR
|
||||
are \s-1BIO\s0 \*(L"control\*(R" operations taking arguments of various types.
|
||||
These functions are not normally called directly, various macros
|
||||
are used instead. The standard macros are described below, macros
|
||||
specific to a particular type of \s-1BIO\s0 are described in the specific
|
||||
BIOs manual page as well as any special features of the standard
|
||||
calls.
|
||||
.PP
|
||||
\&\fIBIO_reset()\fR typically resets a \s-1BIO\s0 to some initial state, in the case
|
||||
\&\fBBIO_reset()\fR typically resets a \s-1BIO\s0 to some initial state, in the case
|
||||
of file related BIOs for example it rewinds the file pointer to the
|
||||
start of the file.
|
||||
.PP
|
||||
\&\fIBIO_seek()\fR resets a file related \s-1BIO\s0's (that is file descriptor and
|
||||
\&\fBBIO_seek()\fR resets a file related \s-1BIO\s0's (that is file descriptor and
|
||||
\&\s-1FILE\s0 BIOs) file position pointer to \fBofs\fR bytes from start of file.
|
||||
.PP
|
||||
\&\fIBIO_tell()\fR returns the current file position of a file related \s-1BIO.\s0
|
||||
\&\fBBIO_tell()\fR returns the current file position of a file related \s-1BIO.\s0
|
||||
.PP
|
||||
\&\fIBIO_flush()\fR normally writes out any internally buffered data, in some
|
||||
\&\fBBIO_flush()\fR normally writes out any internally buffered data, in some
|
||||
cases it is used to signal \s-1EOF\s0 and that no more data will be written.
|
||||
.PP
|
||||
\&\fIBIO_eof()\fR returns 1 if the \s-1BIO\s0 has read \s-1EOF,\s0 the precise meaning of
|
||||
\&\fBBIO_eof()\fR returns 1 if the \s-1BIO\s0 has read \s-1EOF,\s0 the precise meaning of
|
||||
\&\*(L"\s-1EOF\*(R"\s0 varies according to the \s-1BIO\s0 type.
|
||||
.PP
|
||||
\&\fIBIO_set_close()\fR sets the \s-1BIO \s0\fBb\fR close flag to \fBflag\fR. \fBflag\fR can
|
||||
\&\fBBIO_set_close()\fR sets the \s-1BIO\s0 \fBb\fR close flag to \fBflag\fR. \fBflag\fR can
|
||||
take the value \s-1BIO_CLOSE\s0 or \s-1BIO_NOCLOSE.\s0 Typically \s-1BIO_CLOSE\s0 is used
|
||||
in a source/sink \s-1BIO\s0 to indicate that the underlying I/O stream should
|
||||
be closed when the \s-1BIO\s0 is freed.
|
||||
.PP
|
||||
\&\fIBIO_get_close()\fR returns the BIOs close flag.
|
||||
\&\fBBIO_get_close()\fR returns the BIOs close flag.
|
||||
.PP
|
||||
\&\fIBIO_pending()\fR, \fIBIO_ctrl_pending()\fR, \fIBIO_wpending()\fR and \fIBIO_ctrl_wpending()\fR
|
||||
\&\fBBIO_pending()\fR, \fBBIO_ctrl_pending()\fR, \fBBIO_wpending()\fR and \fBBIO_ctrl_wpending()\fR
|
||||
return the number of pending characters in the BIOs read and write buffers.
|
||||
Not all BIOs support these calls. \fIBIO_ctrl_pending()\fR and \fIBIO_ctrl_wpending()\fR
|
||||
return a size_t type and are functions, \fIBIO_pending()\fR and \fIBIO_wpending()\fR are
|
||||
macros which call \fIBIO_ctrl()\fR.
|
||||
Not all BIOs support these calls. \fBBIO_ctrl_pending()\fR and \fBBIO_ctrl_wpending()\fR
|
||||
return a size_t type and are functions, \fBBIO_pending()\fR and \fBBIO_wpending()\fR are
|
||||
macros which call \fBBIO_ctrl()\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_reset()\fR normally returns 1 for success and 0 or \-1 for failure. File
|
||||
\&\fBBIO_reset()\fR normally returns 1 for success and 0 or \-1 for failure. File
|
||||
BIOs are an exception, they return 0 for success and \-1 for failure.
|
||||
.PP
|
||||
\&\fIBIO_seek()\fR and \fIBIO_tell()\fR both return the current file position on success
|
||||
and \-1 for failure, except file BIOs which for \fIBIO_seek()\fR always return 0
|
||||
\&\fBBIO_seek()\fR and \fBBIO_tell()\fR both return the current file position on success
|
||||
and \-1 for failure, except file BIOs which for \fBBIO_seek()\fR always return 0
|
||||
for success and \-1 for failure.
|
||||
.PP
|
||||
\&\fIBIO_flush()\fR returns 1 for success and 0 or \-1 for failure.
|
||||
\&\fBBIO_flush()\fR returns 1 for success and 0 or \-1 for failure.
|
||||
.PP
|
||||
\&\fIBIO_eof()\fR returns 1 if \s-1EOF\s0 has been reached 0 otherwise.
|
||||
\&\fBBIO_eof()\fR returns 1 if \s-1EOF\s0 has been reached 0 otherwise.
|
||||
.PP
|
||||
\&\fIBIO_set_close()\fR always returns 1.
|
||||
\&\fBBIO_set_close()\fR always returns 1.
|
||||
.PP
|
||||
\&\fIBIO_get_close()\fR returns the close flag value: \s-1BIO_CLOSE\s0 or \s-1BIO_NOCLOSE.\s0
|
||||
\&\fBBIO_get_close()\fR returns the close flag value: \s-1BIO_CLOSE\s0 or \s-1BIO_NOCLOSE.\s0
|
||||
.PP
|
||||
\&\fIBIO_pending()\fR, \fIBIO_ctrl_pending()\fR, \fIBIO_wpending()\fR and \fIBIO_ctrl_wpending()\fR
|
||||
\&\fBBIO_pending()\fR, \fBBIO_ctrl_pending()\fR, \fBBIO_wpending()\fR and \fBBIO_ctrl_wpending()\fR
|
||||
return the amount of pending data.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
\&\fIBIO_flush()\fR, because it can write data may return 0 or \-1 indicating
|
||||
that the call should be retried later in a similar manner to \fIBIO_write_ex()\fR.
|
||||
The \fIBIO_should_retry()\fR call should be used and appropriate action taken
|
||||
\&\fBBIO_flush()\fR, because it can write data may return 0 or \-1 indicating
|
||||
that the call should be retried later in a similar manner to \fBBIO_write_ex()\fR.
|
||||
The \fBBIO_should_retry()\fR call should be used and appropriate action taken
|
||||
is the call fails.
|
||||
.PP
|
||||
The return values of \fIBIO_pending()\fR and \fIBIO_wpending()\fR may not reliably
|
||||
The return values of \fBBIO_pending()\fR and \fBBIO_wpending()\fR may not reliably
|
||||
determine the amount of pending data in all cases. For example in the
|
||||
case of a file \s-1BIO\s0 some data may be available in the \s-1FILE\s0 structures
|
||||
internal buffers but it is not possible to determine this in a
|
||||
portably way. For other types of \s-1BIO\s0 they may not be supported.
|
||||
.PP
|
||||
Filter BIOs if they do not internally handle a particular \fIBIO_ctrl()\fR
|
||||
Filter BIOs if they do not internally handle a particular \fBBIO_ctrl()\fR
|
||||
operation usually pass the operation to the next \s-1BIO\s0 in the chain.
|
||||
This often means there is no need to locate the required \s-1BIO\s0 for
|
||||
a particular operation, it can be called on a chain and it will
|
||||
be automatically passed to the relevant \s-1BIO.\s0 However this can cause
|
||||
unexpected results: for example no current filter BIOs implement
|
||||
\&\fIBIO_seek()\fR, but this may still succeed if the chain ends in a \s-1FILE\s0
|
||||
\&\fBBIO_seek()\fR, but this may still succeed if the chain ends in a \s-1FILE\s0
|
||||
or file descriptor \s-1BIO.\s0
|
||||
.PP
|
||||
Source/sink BIOs return an 0 if they do not recognize the \fIBIO_ctrl()\fR
|
||||
Source/sink BIOs return an 0 if they do not recognize the \fBBIO_ctrl()\fR
|
||||
operation.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
Some of the return values are ambiguous and care should be taken. In
|
||||
particular a return value of 0 can be returned if an operation is not
|
||||
supported, if an error occurred, if \s-1EOF\s0 has not been reached and in
|
||||
the case of \fIBIO_seek()\fR on a file \s-1BIO\s0 for a successful operation.
|
||||
the case of \fBBIO_seek()\fR on a file \s-1BIO\s0 for a successful operation.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_f_base64.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_f_base64.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_f_base64 3"
|
||||
.TH BIO_f_base64 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_f_base64 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -150,17 +154,17 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_f_base64()\fR returns the base64 \s-1BIO\s0 method. This is a filter
|
||||
\&\fBBIO_f_base64()\fR returns the base64 \s-1BIO\s0 method. This is a filter
|
||||
\&\s-1BIO\s0 that base64 encodes any data written through it and decodes
|
||||
any data read through it.
|
||||
.PP
|
||||
Base64 BIOs do not support \fIBIO_gets()\fR or \fIBIO_puts()\fR.
|
||||
Base64 BIOs do not support \fBBIO_gets()\fR or \fBBIO_puts()\fR.
|
||||
.PP
|
||||
\&\fIBIO_flush()\fR on a base64 \s-1BIO\s0 that is being written through is
|
||||
\&\fBBIO_flush()\fR on a base64 \s-1BIO\s0 that is being written through is
|
||||
used to signal that no more data is to be encoded: this is used
|
||||
to flush the final block through the \s-1BIO.\s0
|
||||
.PP
|
||||
The flag \s-1BIO_FLAGS_BASE64_NO_NL\s0 can be set with \fIBIO_set_flags()\fR
|
||||
The flag \s-1BIO_FLAGS_BASE64_NO_NL\s0 can be set with \fBBIO_set_flags()\fR
|
||||
to encode the data all on one line or expect the data to be all
|
||||
on one line.
|
||||
.SH "NOTES"
|
||||
|
@ -169,7 +173,7 @@ Because of the format of base64 encoding the end of the encoded
|
|||
block cannot always be reliably determined.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_f_base64()\fR returns the base64 \s-1BIO\s0 method.
|
||||
\&\fBBIO_f_base64()\fR returns the base64 \s-1BIO\s0 method.
|
||||
.SH "EXAMPLES"
|
||||
.IX Header "EXAMPLES"
|
||||
Base64 encode the string \*(L"Hello World\en\*(R" and write the result
|
||||
|
@ -212,7 +216,7 @@ The ambiguity of \s-1EOF\s0 in base64 encoded data can cause additional
|
|||
data following the base64 encoded block to be misinterpreted.
|
||||
.PP
|
||||
There should be some way of specifying a test that the \s-1BIO\s0 can perform
|
||||
to reliably determine \s-1EOF \s0(for example a \s-1MIME\s0 boundary).
|
||||
to reliably determine \s-1EOF\s0 (for example a \s-1MIME\s0 boundary).
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_f_buffer.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_f_buffer.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_f_buffer 3"
|
||||
.TH BIO_f_buffer 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_f_buffer 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -161,58 +165,58 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_f_buffer()\fR returns the buffering \s-1BIO\s0 method.
|
||||
\&\fBBIO_f_buffer()\fR returns the buffering \s-1BIO\s0 method.
|
||||
.PP
|
||||
Data written to a buffering \s-1BIO\s0 is buffered and periodically written
|
||||
to the next \s-1BIO\s0 in the chain. Data read from a buffering \s-1BIO\s0 comes from
|
||||
an internal buffer which is filled from the next \s-1BIO\s0 in the chain.
|
||||
Both \fIBIO_gets()\fR and \fIBIO_puts()\fR are supported.
|
||||
Both \fBBIO_gets()\fR and \fBBIO_puts()\fR are supported.
|
||||
.PP
|
||||
Calling \fIBIO_reset()\fR on a buffering \s-1BIO\s0 clears any buffered data.
|
||||
Calling \fBBIO_reset()\fR on a buffering \s-1BIO\s0 clears any buffered data.
|
||||
.PP
|
||||
\&\fIBIO_get_buffer_num_lines()\fR returns the number of lines currently buffered.
|
||||
\&\fBBIO_get_buffer_num_lines()\fR returns the number of lines currently buffered.
|
||||
.PP
|
||||
\&\fIBIO_set_read_buffer_size()\fR, \fIBIO_set_write_buffer_size()\fR and \fIBIO_set_buffer_size()\fR
|
||||
\&\fBBIO_set_read_buffer_size()\fR, \fBBIO_set_write_buffer_size()\fR and \fBBIO_set_buffer_size()\fR
|
||||
set the read, write or both read and write buffer sizes to \fBsize\fR. The initial
|
||||
buffer size is \s-1DEFAULT_BUFFER_SIZE,\s0 currently 4096. Any attempt to reduce the
|
||||
buffer size below \s-1DEFAULT_BUFFER_SIZE\s0 is ignored. Any buffered data is cleared
|
||||
when the buffer is resized.
|
||||
.PP
|
||||
\&\fIBIO_set_buffer_read_data()\fR clears the read buffer and fills it with \fBnum\fR
|
||||
\&\fBBIO_set_buffer_read_data()\fR clears the read buffer and fills it with \fBnum\fR
|
||||
bytes of \fBbuf\fR. If \fBnum\fR is larger than the current buffer size the buffer
|
||||
is expanded.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
These functions, other than \fIBIO_f_buffer()\fR, are implemented as macros.
|
||||
These functions, other than \fBBIO_f_buffer()\fR, are implemented as macros.
|
||||
.PP
|
||||
Buffering BIOs implement \fIBIO_gets()\fR by using \fIBIO_read_ex()\fR operations on the
|
||||
Buffering BIOs implement \fBBIO_gets()\fR by using \fBBIO_read_ex()\fR operations on the
|
||||
next \s-1BIO\s0 in the chain. By prepending a buffering \s-1BIO\s0 to a chain it is therefore
|
||||
possible to provide \fIBIO_gets()\fR functionality if the following BIOs do not
|
||||
possible to provide \fBBIO_gets()\fR functionality if the following BIOs do not
|
||||
support it (for example \s-1SSL\s0 BIOs).
|
||||
.PP
|
||||
Data is only written to the next \s-1BIO\s0 in the chain when the write buffer fills
|
||||
or when \fIBIO_flush()\fR is called. It is therefore important to call \fIBIO_flush()\fR
|
||||
or when \fBBIO_flush()\fR is called. It is therefore important to call \fBBIO_flush()\fR
|
||||
whenever any pending data should be written such as when removing a buffering
|
||||
\&\s-1BIO\s0 using \fIBIO_pop()\fR. \fIBIO_flush()\fR may need to be retried if the ultimate
|
||||
\&\s-1BIO\s0 using \fBBIO_pop()\fR. \fBBIO_flush()\fR may need to be retried if the ultimate
|
||||
source/sink \s-1BIO\s0 is non blocking.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_f_buffer()\fR returns the buffering \s-1BIO\s0 method.
|
||||
\&\fBBIO_f_buffer()\fR returns the buffering \s-1BIO\s0 method.
|
||||
.PP
|
||||
\&\fIBIO_get_buffer_num_lines()\fR returns the number of lines buffered (may be 0).
|
||||
\&\fBBIO_get_buffer_num_lines()\fR returns the number of lines buffered (may be 0).
|
||||
.PP
|
||||
\&\fIBIO_set_read_buffer_size()\fR, \fIBIO_set_write_buffer_size()\fR and \fIBIO_set_buffer_size()\fR
|
||||
\&\fBBIO_set_read_buffer_size()\fR, \fBBIO_set_write_buffer_size()\fR and \fBBIO_set_buffer_size()\fR
|
||||
return 1 if the buffer was successfully resized or 0 for failure.
|
||||
.PP
|
||||
\&\fIBIO_set_buffer_read_data()\fR returns 1 if the data was set correctly or 0 if
|
||||
\&\fBBIO_set_buffer_read_data()\fR returns 1 if the data was set correctly or 0 if
|
||||
there was an error.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIbio\fR\|(7),
|
||||
\&\fIBIO_reset\fR\|(3),
|
||||
\&\fIBIO_flush\fR\|(3),
|
||||
\&\fIBIO_pop\fR\|(3),
|
||||
\&\fIBIO_ctrl\fR\|(3).
|
||||
\&\fBbio\fR\|(7),
|
||||
\&\fBBIO_reset\fR\|(3),
|
||||
\&\fBBIO_flush\fR\|(3),
|
||||
\&\fBBIO_pop\fR\|(3),
|
||||
\&\fBBIO_ctrl\fR\|(3).
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_f_cipher.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_f_cipher.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_f_cipher 3"
|
||||
.TH BIO_f_cipher 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_f_cipher 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -154,53 +158,53 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_f_cipher()\fR returns the cipher \s-1BIO\s0 method. This is a filter
|
||||
\&\fBBIO_f_cipher()\fR returns the cipher \s-1BIO\s0 method. This is a filter
|
||||
\&\s-1BIO\s0 that encrypts any data written through it, and decrypts any data
|
||||
read from it. It is a \s-1BIO\s0 wrapper for the cipher routines
|
||||
\&\fIEVP_CipherInit()\fR, \fIEVP_CipherUpdate()\fR and \fIEVP_CipherFinal()\fR.
|
||||
\&\fBEVP_CipherInit()\fR, \fBEVP_CipherUpdate()\fR and \fBEVP_CipherFinal()\fR.
|
||||
.PP
|
||||
Cipher BIOs do not support \fIBIO_gets()\fR or \fIBIO_puts()\fR.
|
||||
Cipher BIOs do not support \fBBIO_gets()\fR or \fBBIO_puts()\fR.
|
||||
.PP
|
||||
\&\fIBIO_flush()\fR on an encryption \s-1BIO\s0 that is being written through is
|
||||
\&\fBBIO_flush()\fR on an encryption \s-1BIO\s0 that is being written through is
|
||||
used to signal that no more data is to be encrypted: this is used
|
||||
to flush and possibly pad the final block through the \s-1BIO.\s0
|
||||
.PP
|
||||
\&\fIBIO_set_cipher()\fR sets the cipher of \s-1BIO \s0\fBb\fR to \fBcipher\fR using key \fBkey\fR
|
||||
and \s-1IV \s0\fBiv\fR. \fBenc\fR should be set to 1 for encryption and zero for
|
||||
\&\fBBIO_set_cipher()\fR sets the cipher of \s-1BIO\s0 \fBb\fR to \fBcipher\fR using key \fBkey\fR
|
||||
and \s-1IV\s0 \fBiv\fR. \fBenc\fR should be set to 1 for encryption and zero for
|
||||
decryption.
|
||||
.PP
|
||||
When reading from an encryption \s-1BIO\s0 the final block is automatically
|
||||
decrypted and checked when \s-1EOF\s0 is detected. \fIBIO_get_cipher_status()\fR
|
||||
is a \fIBIO_ctrl()\fR macro which can be called to determine whether the
|
||||
decrypted and checked when \s-1EOF\s0 is detected. \fBBIO_get_cipher_status()\fR
|
||||
is a \fBBIO_ctrl()\fR macro which can be called to determine whether the
|
||||
decryption operation was successful.
|
||||
.PP
|
||||
\&\fIBIO_get_cipher_ctx()\fR is a \fIBIO_ctrl()\fR macro which retrieves the internal
|
||||
\&\fBBIO_get_cipher_ctx()\fR is a \fBBIO_ctrl()\fR macro which retrieves the internal
|
||||
\&\s-1BIO\s0 cipher context. The retrieved context can be used in conjunction
|
||||
with the standard cipher routines to set it up. This is useful when
|
||||
\&\fIBIO_set_cipher()\fR is not flexible enough for the applications needs.
|
||||
\&\fBBIO_set_cipher()\fR is not flexible enough for the applications needs.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
When encrypting \fIBIO_flush()\fR \fBmust\fR be called to flush the final block
|
||||
When encrypting \fBBIO_flush()\fR \fBmust\fR be called to flush the final block
|
||||
through the \s-1BIO.\s0 If it is not then the final block will fail a subsequent
|
||||
decrypt.
|
||||
.PP
|
||||
When decrypting an error on the final block is signaled by a zero
|
||||
return value from the read operation. A successful decrypt followed
|
||||
by \s-1EOF\s0 will also return zero for the final read. \fIBIO_get_cipher_status()\fR
|
||||
by \s-1EOF\s0 will also return zero for the final read. \fBBIO_get_cipher_status()\fR
|
||||
should be called to determine if the decrypt was successful.
|
||||
.PP
|
||||
As always, if \fIBIO_gets()\fR or \fIBIO_puts()\fR support is needed then it can
|
||||
As always, if \fBBIO_gets()\fR or \fBBIO_puts()\fR support is needed then it can
|
||||
be achieved by preceding the cipher \s-1BIO\s0 with a buffering \s-1BIO.\s0
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_f_cipher()\fR returns the cipher \s-1BIO\s0 method.
|
||||
\&\fBBIO_f_cipher()\fR returns the cipher \s-1BIO\s0 method.
|
||||
.PP
|
||||
\&\fIBIO_set_cipher()\fR does not return a value.
|
||||
\&\fBBIO_set_cipher()\fR does not return a value.
|
||||
.PP
|
||||
\&\fIBIO_get_cipher_status()\fR returns 1 for a successful decrypt and 0
|
||||
\&\fBBIO_get_cipher_status()\fR returns 1 for a successful decrypt and 0
|
||||
for failure.
|
||||
.PP
|
||||
\&\fIBIO_get_cipher_ctx()\fR currently always returns 1.
|
||||
\&\fBBIO_get_cipher_ctx()\fR currently always returns 1.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_f_md.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_f_md.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_f_md 3"
|
||||
.TH BIO_f_md 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_f_md 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -153,55 +157,55 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_f_md()\fR returns the message digest \s-1BIO\s0 method. This is a filter
|
||||
\&\fBBIO_f_md()\fR returns the message digest \s-1BIO\s0 method. This is a filter
|
||||
\&\s-1BIO\s0 that digests any data passed through it, it is a \s-1BIO\s0 wrapper
|
||||
for the digest routines \fIEVP_DigestInit()\fR, \fIEVP_DigestUpdate()\fR
|
||||
and \fIEVP_DigestFinal()\fR.
|
||||
for the digest routines \fBEVP_DigestInit()\fR, \fBEVP_DigestUpdate()\fR
|
||||
and \fBEVP_DigestFinal()\fR.
|
||||
.PP
|
||||
Any data written or read through a digest \s-1BIO\s0 using \fIBIO_read_ex()\fR and
|
||||
\&\fIBIO_write_ex()\fR is digested.
|
||||
Any data written or read through a digest \s-1BIO\s0 using \fBBIO_read_ex()\fR and
|
||||
\&\fBBIO_write_ex()\fR is digested.
|
||||
.PP
|
||||
\&\fIBIO_gets()\fR, if its \fBsize\fR parameter is large enough finishes the
|
||||
digest calculation and returns the digest value. \fIBIO_puts()\fR is
|
||||
\&\fBBIO_gets()\fR, if its \fBsize\fR parameter is large enough finishes the
|
||||
digest calculation and returns the digest value. \fBBIO_puts()\fR is
|
||||
not supported.
|
||||
.PP
|
||||
\&\fIBIO_reset()\fR reinitialises a digest \s-1BIO.\s0
|
||||
\&\fBBIO_reset()\fR reinitialises a digest \s-1BIO.\s0
|
||||
.PP
|
||||
\&\fIBIO_set_md()\fR sets the message digest of \s-1BIO \s0\fBb\fR to \fBmd\fR: this
|
||||
\&\fBBIO_set_md()\fR sets the message digest of \s-1BIO\s0 \fBb\fR to \fBmd\fR: this
|
||||
must be called to initialize a digest \s-1BIO\s0 before any data is
|
||||
passed through it. It is a \fIBIO_ctrl()\fR macro.
|
||||
passed through it. It is a \fBBIO_ctrl()\fR macro.
|
||||
.PP
|
||||
\&\fIBIO_get_md()\fR places the a pointer to the digest BIOs digest method
|
||||
in \fBmdp\fR, it is a \fIBIO_ctrl()\fR macro.
|
||||
\&\fBBIO_get_md()\fR places the a pointer to the digest BIOs digest method
|
||||
in \fBmdp\fR, it is a \fBBIO_ctrl()\fR macro.
|
||||
.PP
|
||||
\&\fIBIO_get_md_ctx()\fR returns the digest BIOs context into \fBmdcp\fR.
|
||||
\&\fBBIO_get_md_ctx()\fR returns the digest BIOs context into \fBmdcp\fR.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
The context returned by \fIBIO_get_md_ctx()\fR can be used in calls
|
||||
to \fIEVP_DigestFinal()\fR and also the signature routines \fIEVP_SignFinal()\fR
|
||||
and \fIEVP_VerifyFinal()\fR.
|
||||
The context returned by \fBBIO_get_md_ctx()\fR can be used in calls
|
||||
to \fBEVP_DigestFinal()\fR and also the signature routines \fBEVP_SignFinal()\fR
|
||||
and \fBEVP_VerifyFinal()\fR.
|
||||
.PP
|
||||
The context returned by \fIBIO_get_md_ctx()\fR is an internal context
|
||||
The context returned by \fBBIO_get_md_ctx()\fR is an internal context
|
||||
structure. Changes made to this context will affect the digest
|
||||
\&\s-1BIO\s0 itself and the context pointer will become invalid when the digest
|
||||
\&\s-1BIO\s0 is freed.
|
||||
.PP
|
||||
After the digest has been retrieved from a digest \s-1BIO\s0 it must be
|
||||
reinitialized by calling \fIBIO_reset()\fR, or \fIBIO_set_md()\fR before any more
|
||||
reinitialized by calling \fBBIO_reset()\fR, or \fBBIO_set_md()\fR before any more
|
||||
data is passed through it.
|
||||
.PP
|
||||
If an application needs to call \fIBIO_gets()\fR or \fIBIO_puts()\fR through
|
||||
If an application needs to call \fBBIO_gets()\fR or \fBBIO_puts()\fR through
|
||||
a chain containing digest BIOs then this can be done by prepending
|
||||
a buffering \s-1BIO.\s0
|
||||
.PP
|
||||
Calling \fIBIO_get_md_ctx()\fR will return the context and initialize the \s-1BIO\s0
|
||||
Calling \fBBIO_get_md_ctx()\fR will return the context and initialize the \s-1BIO\s0
|
||||
state. This allows applications to initialize the context externally
|
||||
if the standard calls such as \fIBIO_set_md()\fR are not sufficiently flexible.
|
||||
if the standard calls such as \fBBIO_set_md()\fR are not sufficiently flexible.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_f_md()\fR returns the digest \s-1BIO\s0 method.
|
||||
\&\fBBIO_f_md()\fR returns the digest \s-1BIO\s0 method.
|
||||
.PP
|
||||
\&\fIBIO_set_md()\fR, \fIBIO_get_md()\fR and \fIBIO_md_ctx()\fR return 1 for success and
|
||||
\&\fBBIO_set_md()\fR, \fBBIO_get_md()\fR and \fBBIO_md_ctx()\fR return 1 for success and
|
||||
0 for failure.
|
||||
.SH "EXAMPLES"
|
||||
.IX Header "EXAMPLES"
|
||||
|
@ -276,14 +280,14 @@ outputs them. This could be used with the examples above.
|
|||
.Ve
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
The lack of support for \fIBIO_puts()\fR and the non standard behaviour of
|
||||
\&\fIBIO_gets()\fR could be regarded as anomalous. It could be argued that \fIBIO_gets()\fR
|
||||
and \fIBIO_puts()\fR should be passed to the next \s-1BIO\s0 in the chain and digest
|
||||
The lack of support for \fBBIO_puts()\fR and the non standard behaviour of
|
||||
\&\fBBIO_gets()\fR could be regarded as anomalous. It could be argued that \fBBIO_gets()\fR
|
||||
and \fBBIO_puts()\fR should be passed to the next \s-1BIO\s0 in the chain and digest
|
||||
the data passed through and that digests should be retrieved using a
|
||||
separate \fIBIO_ctrl()\fR call.
|
||||
separate \fBBIO_ctrl()\fR call.
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
Before OpenSSL 1.0.0., the call to \fIBIO_get_md_ctx()\fR would only work if the
|
||||
Before OpenSSL 1.0.0., the call to \fBBIO_get_md_ctx()\fR would only work if the
|
||||
\&\s-1BIO\s0 was initialized first.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_f_null.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_f_null.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_f_null 3"
|
||||
.TH BIO_f_null 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_f_null 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -149,7 +153,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_f_null()\fR returns the null filter \s-1BIO\s0 method. This is a filter \s-1BIO\s0
|
||||
\&\fBBIO_f_null()\fR returns the null filter \s-1BIO\s0 method. This is a filter \s-1BIO\s0
|
||||
that does nothing.
|
||||
.PP
|
||||
All requests to a null filter \s-1BIO\s0 are passed through to the next \s-1BIO\s0 in
|
||||
|
@ -160,7 +164,7 @@ behaves just as though the \s-1BIO\s0 was not there.
|
|||
As may be apparent a null filter \s-1BIO\s0 is not particularly useful.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_f_null()\fR returns the null filter \s-1BIO\s0 method.
|
||||
\&\fBBIO_f_null()\fR returns the null filter \s-1BIO\s0 method.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_f_ssl.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_f_ssl.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_f_ssl 3"
|
||||
.TH BIO_f_ssl 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_f_ssl 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -170,71 +174,71 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_f_ssl()\fR returns the \s-1SSL BIO\s0 method. This is a filter \s-1BIO\s0 which
|
||||
is a wrapper round the OpenSSL \s-1SSL\s0 routines adding a \s-1BIO \s0\*(L"flavour\*(R" to
|
||||
\&\fBBIO_f_ssl()\fR returns the \s-1SSL BIO\s0 method. This is a filter \s-1BIO\s0 which
|
||||
is a wrapper round the OpenSSL \s-1SSL\s0 routines adding a \s-1BIO\s0 \*(L"flavour\*(R" to
|
||||
\&\s-1SSL I/O.\s0
|
||||
.PP
|
||||
I/O performed on an \s-1SSL BIO\s0 communicates using the \s-1SSL\s0 protocol with
|
||||
the SSLs read and write BIOs. If an \s-1SSL\s0 connection is not established
|
||||
then an attempt is made to establish one on the first I/O call.
|
||||
.PP
|
||||
If a \s-1BIO\s0 is appended to an \s-1SSL BIO\s0 using \fIBIO_push()\fR it is automatically
|
||||
If a \s-1BIO\s0 is appended to an \s-1SSL BIO\s0 using \fBBIO_push()\fR it is automatically
|
||||
used as the \s-1SSL\s0 BIOs read and write BIOs.
|
||||
.PP
|
||||
Calling \fIBIO_reset()\fR on an \s-1SSL BIO\s0 closes down any current \s-1SSL\s0 connection
|
||||
by calling \fISSL_shutdown()\fR. \fIBIO_reset()\fR is then sent to the next \s-1BIO\s0 in
|
||||
Calling \fBBIO_reset()\fR on an \s-1SSL BIO\s0 closes down any current \s-1SSL\s0 connection
|
||||
by calling \fBSSL_shutdown()\fR. \fBBIO_reset()\fR is then sent to the next \s-1BIO\s0 in
|
||||
the chain: this will typically disconnect the underlying transport.
|
||||
The \s-1SSL BIO\s0 is then reset to the initial accept or connect state.
|
||||
.PP
|
||||
If the close flag is set when an \s-1SSL BIO\s0 is freed then the internal
|
||||
\&\s-1SSL\s0 structure is also freed using \fISSL_free()\fR.
|
||||
\&\s-1SSL\s0 structure is also freed using \fBSSL_free()\fR.
|
||||
.PP
|
||||
\&\fIBIO_set_ssl()\fR sets the internal \s-1SSL\s0 pointer of \s-1BIO \s0\fBb\fR to \fBssl\fR using
|
||||
\&\fBBIO_set_ssl()\fR sets the internal \s-1SSL\s0 pointer of \s-1BIO\s0 \fBb\fR to \fBssl\fR using
|
||||
the close flag \fBc\fR.
|
||||
.PP
|
||||
\&\fIBIO_get_ssl()\fR retrieves the \s-1SSL\s0 pointer of \s-1BIO \s0\fBb\fR, it can then be
|
||||
\&\fBBIO_get_ssl()\fR retrieves the \s-1SSL\s0 pointer of \s-1BIO\s0 \fBb\fR, it can then be
|
||||
manipulated using the standard \s-1SSL\s0 library functions.
|
||||
.PP
|
||||
\&\fIBIO_set_ssl_mode()\fR sets the \s-1SSL BIO\s0 mode to \fBclient\fR. If \fBclient\fR
|
||||
\&\fBBIO_set_ssl_mode()\fR sets the \s-1SSL BIO\s0 mode to \fBclient\fR. If \fBclient\fR
|
||||
is 1 client mode is set. If \fBclient\fR is 0 server mode is set.
|
||||
.PP
|
||||
\&\fIBIO_set_ssl_renegotiate_bytes()\fR sets the renegotiate byte count
|
||||
\&\fBBIO_set_ssl_renegotiate_bytes()\fR sets the renegotiate byte count
|
||||
to \fBnum\fR. When set after every \fBnum\fR bytes of I/O (read and write)
|
||||
the \s-1SSL\s0 session is automatically renegotiated. \fBnum\fR must be at
|
||||
least 512 bytes.
|
||||
.PP
|
||||
\&\fIBIO_set_ssl_renegotiate_timeout()\fR sets the renegotiate timeout to
|
||||
\&\fBBIO_set_ssl_renegotiate_timeout()\fR sets the renegotiate timeout to
|
||||
\&\fBseconds\fR. When the renegotiate timeout elapses the session is
|
||||
automatically renegotiated.
|
||||
.PP
|
||||
\&\fIBIO_get_num_renegotiates()\fR returns the total number of session
|
||||
\&\fBBIO_get_num_renegotiates()\fR returns the total number of session
|
||||
renegotiations due to I/O or timeout.
|
||||
.PP
|
||||
\&\fIBIO_new_ssl()\fR allocates an \s-1SSL BIO\s0 using \s-1SSL_CTX \s0\fBctx\fR and using
|
||||
\&\fBBIO_new_ssl()\fR allocates an \s-1SSL BIO\s0 using \s-1SSL_CTX\s0 \fBctx\fR and using
|
||||
client mode if \fBclient\fR is non zero.
|
||||
.PP
|
||||
\&\fIBIO_new_ssl_connect()\fR creates a new \s-1BIO\s0 chain consisting of an
|
||||
\&\s-1SSL BIO \s0(using \fBctx\fR) followed by a connect \s-1BIO.\s0
|
||||
\&\fBBIO_new_ssl_connect()\fR creates a new \s-1BIO\s0 chain consisting of an
|
||||
\&\s-1SSL BIO\s0 (using \fBctx\fR) followed by a connect \s-1BIO.\s0
|
||||
.PP
|
||||
\&\fIBIO_new_buffer_ssl_connect()\fR creates a new \s-1BIO\s0 chain consisting
|
||||
of a buffering \s-1BIO,\s0 an \s-1SSL BIO \s0(using \fBctx\fR) and a connect
|
||||
\&\fBBIO_new_buffer_ssl_connect()\fR creates a new \s-1BIO\s0 chain consisting
|
||||
of a buffering \s-1BIO,\s0 an \s-1SSL BIO\s0 (using \fBctx\fR) and a connect
|
||||
\&\s-1BIO.\s0
|
||||
.PP
|
||||
\&\fIBIO_ssl_copy_session_id()\fR copies an \s-1SSL\s0 session id between
|
||||
\&\fBBIO_ssl_copy_session_id()\fR copies an \s-1SSL\s0 session id between
|
||||
\&\s-1BIO\s0 chains \fBfrom\fR and \fBto\fR. It does this by locating the
|
||||
\&\s-1SSL\s0 BIOs in each chain and calling \fISSL_copy_session_id()\fR on
|
||||
\&\s-1SSL\s0 BIOs in each chain and calling \fBSSL_copy_session_id()\fR on
|
||||
the internal \s-1SSL\s0 pointer.
|
||||
.PP
|
||||
\&\fIBIO_ssl_shutdown()\fR closes down an \s-1SSL\s0 connection on \s-1BIO\s0
|
||||
\&\fBBIO_ssl_shutdown()\fR closes down an \s-1SSL\s0 connection on \s-1BIO\s0
|
||||
chain \fBbio\fR. It does this by locating the \s-1SSL BIO\s0 in the
|
||||
chain and calling \fISSL_shutdown()\fR on its internal \s-1SSL\s0
|
||||
chain and calling \fBSSL_shutdown()\fR on its internal \s-1SSL\s0
|
||||
pointer.
|
||||
.PP
|
||||
\&\fIBIO_do_handshake()\fR attempts to complete an \s-1SSL\s0 handshake on the
|
||||
\&\fBBIO_do_handshake()\fR attempts to complete an \s-1SSL\s0 handshake on the
|
||||
supplied \s-1BIO\s0 and establish the \s-1SSL\s0 connection. It returns 1
|
||||
if the connection was established successfully. A zero or negative
|
||||
value is returned if the connection could not be established, the
|
||||
call \fIBIO_should_retry()\fR should be used for non blocking connect BIOs
|
||||
call \fBBIO_should_retry()\fR should be used for non blocking connect BIOs
|
||||
to determine if the call should be retried. If an \s-1SSL\s0 connection has
|
||||
already been established this call has no effect.
|
||||
.SH "NOTES"
|
||||
|
@ -242,7 +246,7 @@ already been established this call has no effect.
|
|||
\&\s-1SSL\s0 BIOs are exceptional in that if the underlying transport
|
||||
is non blocking they can still request a retry in exceptional
|
||||
circumstances. Specifically this will happen if a session
|
||||
renegotiation takes place during a \fIBIO_read_ex()\fR operation, one
|
||||
renegotiation takes place during a \fBBIO_read_ex()\fR operation, one
|
||||
case where this happens is when step up occurs.
|
||||
.PP
|
||||
The \s-1SSL\s0 flag \s-1SSL_AUTO_RETRY\s0 can be
|
||||
|
@ -250,23 +254,23 @@ set to disable this behaviour. That is when this flag is set
|
|||
an \s-1SSL BIO\s0 using a blocking transport will never request a
|
||||
retry.
|
||||
.PP
|
||||
Since unknown \fIBIO_ctrl()\fR operations are sent through filter
|
||||
BIOs the servers name and port can be set using \fIBIO_set_host()\fR
|
||||
on the \s-1BIO\s0 returned by \fIBIO_new_ssl_connect()\fR without having
|
||||
Since unknown \fBBIO_ctrl()\fR operations are sent through filter
|
||||
BIOs the servers name and port can be set using \fBBIO_set_host()\fR
|
||||
on the \s-1BIO\s0 returned by \fBBIO_new_ssl_connect()\fR without having
|
||||
to locate the connect \s-1BIO\s0 first.
|
||||
.PP
|
||||
Applications do not have to call \fIBIO_do_handshake()\fR but may wish
|
||||
Applications do not have to call \fBBIO_do_handshake()\fR but may wish
|
||||
to do so to separate the handshake process from other I/O
|
||||
processing.
|
||||
.PP
|
||||
\&\fIBIO_set_ssl()\fR, \fIBIO_get_ssl()\fR, \fIBIO_set_ssl_mode()\fR,
|
||||
\&\fIBIO_set_ssl_renegotiate_bytes()\fR, \fIBIO_set_ssl_renegotiate_timeout()\fR,
|
||||
\&\fIBIO_get_num_renegotiates()\fR, and \fIBIO_do_handshake()\fR are implemented as macros.
|
||||
\&\fBBIO_set_ssl()\fR, \fBBIO_get_ssl()\fR, \fBBIO_set_ssl_mode()\fR,
|
||||
\&\fBBIO_set_ssl_renegotiate_bytes()\fR, \fBBIO_set_ssl_renegotiate_timeout()\fR,
|
||||
\&\fBBIO_get_num_renegotiates()\fR, and \fBBIO_do_handshake()\fR are implemented as macros.
|
||||
.SH "EXAMPLE"
|
||||
.IX Header "EXAMPLE"
|
||||
This \s-1SSL/TLS\s0 client example, attempts to retrieve a page from an
|
||||
\&\s-1SSL/TLS\s0 web server. The I/O routines are identical to those of the
|
||||
unencrypted example in \fIBIO_s_connect\fR\|(3).
|
||||
unencrypted example in \fBBIO_s_connect\fR\|(3).
|
||||
.PP
|
||||
.Vb 5
|
||||
\& BIO *sbio, *out;
|
||||
|
@ -409,22 +413,22 @@ a client and also echoes the request to standard output.
|
|||
.Ve
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_f_ssl()\fR returns the \s-1SSL \s0\fB\s-1BIO_METHOD\s0\fR structure.
|
||||
\&\fBBIO_f_ssl()\fR returns the \s-1SSL\s0 \fB\s-1BIO_METHOD\s0\fR structure.
|
||||
.PP
|
||||
\&\fIBIO_set_ssl()\fR, \fIBIO_get_ssl()\fR, \fIBIO_set_ssl_mode()\fR, \fIBIO_set_ssl_renegotiate_bytes()\fR,
|
||||
\&\fIBIO_set_ssl_renegotiate_timeout()\fR and \fIBIO_get_num_renegotiates()\fR return 1 on
|
||||
\&\fBBIO_set_ssl()\fR, \fBBIO_get_ssl()\fR, \fBBIO_set_ssl_mode()\fR, \fBBIO_set_ssl_renegotiate_bytes()\fR,
|
||||
\&\fBBIO_set_ssl_renegotiate_timeout()\fR and \fBBIO_get_num_renegotiates()\fR return 1 on
|
||||
success or a value which is less than or equal to 0 if an error occurred.
|
||||
.PP
|
||||
\&\fIBIO_new_ssl()\fR, \fIBIO_new_ssl_connect()\fR and \fIBIO_new_buffer_ssl_connect()\fR return
|
||||
\&\fBBIO_new_ssl()\fR, \fBBIO_new_ssl_connect()\fR and \fBBIO_new_buffer_ssl_connect()\fR return
|
||||
a valid \fB\s-1BIO\s0\fR structure on success or \fB\s-1NULL\s0\fR if an error occurred.
|
||||
.PP
|
||||
\&\fIBIO_ssl_copy_session_id()\fR returns 1 on success or 0 on error.
|
||||
\&\fBBIO_ssl_copy_session_id()\fR returns 1 on success or 0 on error.
|
||||
.PP
|
||||
\&\fIBIO_do_handshake()\fR returns 1 if the connection was established successfully.
|
||||
\&\fBBIO_do_handshake()\fR returns 1 if the connection was established successfully.
|
||||
A zero or negative value is returned if the connection could not be established.
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
In OpenSSL before 1.0.0 the \fIBIO_pop()\fR call was handled incorrectly,
|
||||
In OpenSSL before 1.0.0 the \fBBIO_pop()\fR call was handled incorrectly,
|
||||
the I/O \s-1BIO\s0 reference count was incorrectly incremented (instead of
|
||||
decremented) and dissociated with the \s-1SSL BIO\s0 even if the \s-1SSL BIO\s0 was not
|
||||
explicitly being popped (e.g. a pop higher up the chain). Applications which
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_find_type.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_find_type.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_find_type 3"
|
||||
.TH BIO_find_type 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_find_type 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -151,11 +155,11 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fIBIO_find_type()\fR searches for a \s-1BIO\s0 of a given type in a chain, starting
|
||||
at \s-1BIO \s0\fBb\fR. If \fBtype\fR is a specific type (such as \fB\s-1BIO_TYPE_MEM\s0\fR) then a search
|
||||
The \fBBIO_find_type()\fR searches for a \s-1BIO\s0 of a given type in a chain, starting
|
||||
at \s-1BIO\s0 \fBb\fR. If \fBtype\fR is a specific type (such as \fB\s-1BIO_TYPE_MEM\s0\fR) then a search
|
||||
is made for a \s-1BIO\s0 of that type. If \fBtype\fR is a general type (such as
|
||||
\&\fB\s-1BIO_TYPE_SOURCE_SINK\s0\fR) then the next matching \s-1BIO\s0 of the given general type is
|
||||
searched for. \fIBIO_find_type()\fR returns the next matching \s-1BIO\s0 or \s-1NULL\s0 if none is
|
||||
searched for. \fBBIO_find_type()\fR returns the next matching \s-1BIO\s0 or \s-1NULL\s0 if none is
|
||||
found.
|
||||
.PP
|
||||
The following general types are defined:
|
||||
|
@ -163,18 +167,18 @@ The following general types are defined:
|
|||
.PP
|
||||
For a list of the specific types, see the \fBopenssl/bio.h\fR header file.
|
||||
.PP
|
||||
\&\fIBIO_next()\fR returns the next \s-1BIO\s0 in a chain. It can be used to traverse all BIOs
|
||||
in a chain or used in conjunction with \fIBIO_find_type()\fR to find all BIOs of a
|
||||
\&\fBBIO_next()\fR returns the next \s-1BIO\s0 in a chain. It can be used to traverse all BIOs
|
||||
in a chain or used in conjunction with \fBBIO_find_type()\fR to find all BIOs of a
|
||||
certain type.
|
||||
.PP
|
||||
\&\fIBIO_method_type()\fR returns the type of a \s-1BIO.\s0
|
||||
\&\fBBIO_method_type()\fR returns the type of a \s-1BIO.\s0
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_find_type()\fR returns a matching \s-1BIO\s0 or \s-1NULL\s0 for no match.
|
||||
\&\fBBIO_find_type()\fR returns a matching \s-1BIO\s0 or \s-1NULL\s0 for no match.
|
||||
.PP
|
||||
\&\fIBIO_next()\fR returns the next \s-1BIO\s0 in a chain.
|
||||
\&\fBBIO_next()\fR returns the next \s-1BIO\s0 in a chain.
|
||||
.PP
|
||||
\&\fIBIO_method_type()\fR returns the type of the \s-1BIO \s0\fBb\fR.
|
||||
\&\fBBIO_method_type()\fR returns the type of the \s-1BIO\s0 \fBb\fR.
|
||||
.SH "EXAMPLE"
|
||||
.IX Header "EXAMPLE"
|
||||
Traverse a chain looking for digest BIOs:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_get_data.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_get_data.3,v 1.3 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_get_data 3"
|
||||
.TH BIO_get_data 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_get_data 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -157,29 +161,29 @@ libcrypto, -lcrypto
|
|||
.IX Header "DESCRIPTION"
|
||||
These functions are mainly useful when implementing a custom \s-1BIO.\s0
|
||||
.PP
|
||||
The \fIBIO_set_data()\fR function associates the custom data pointed to by \fBptr\fR with
|
||||
the \s-1BIO.\s0 This data can subsequently be retrieved via a call to \fIBIO_get_data()\fR.
|
||||
The \fBBIO_set_data()\fR function associates the custom data pointed to by \fBptr\fR with
|
||||
the \s-1BIO.\s0 This data can subsequently be retrieved via a call to \fBBIO_get_data()\fR.
|
||||
This can be used by custom BIOs for storing implementation specific information.
|
||||
.PP
|
||||
The \fIBIO_set_init()\fR function sets the value of the \s-1BIO\s0's \*(L"init\*(R" flag to indicate
|
||||
The \fBBIO_set_init()\fR function sets the value of the \s-1BIO\s0's \*(L"init\*(R" flag to indicate
|
||||
whether initialisation has been completed for this \s-1BIO\s0 or not. A non-zero value
|
||||
indicates that initialisation is complete, whilst zero indicates that it is not.
|
||||
Often initialisation will complete during initial construction of the \s-1BIO.\s0 For
|
||||
some BIOs however, initialisation may not complete until after additional steps
|
||||
have occurred (for example through calling custom ctrls). The \fIBIO_get_init()\fR
|
||||
have occurred (for example through calling custom ctrls). The \fBBIO_get_init()\fR
|
||||
function returns the value of the \*(L"init\*(R" flag.
|
||||
.PP
|
||||
The \fIBIO_set_shutdown()\fR and \fIBIO_get_shutdown()\fR functions set and get the state of
|
||||
The \fBBIO_set_shutdown()\fR and \fBBIO_get_shutdown()\fR functions set and get the state of
|
||||
this \s-1BIO\s0's shutdown (i.e. \s-1BIO_CLOSE\s0) flag. If set then the underlying resource
|
||||
is also closed when the \s-1BIO\s0 is freed.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_get_data()\fR returns a pointer to the implementation specific custom data
|
||||
\&\fBBIO_get_data()\fR returns a pointer to the implementation specific custom data
|
||||
associated with this \s-1BIO,\s0 or \s-1NULL\s0 if none has been set.
|
||||
.PP
|
||||
\&\fIBIO_get_init()\fR returns the state of the \s-1BIO\s0's init flag.
|
||||
\&\fBBIO_get_init()\fR returns the state of the \s-1BIO\s0's init flag.
|
||||
.PP
|
||||
\&\fIBIO_get_shutdown()\fR returns the stat of the \s-1BIO\s0's shutdown (i.e. \s-1BIO_CLOSE\s0) flag.
|
||||
\&\fBBIO_get_shutdown()\fR returns the stat of the \s-1BIO\s0's shutdown (i.e. \s-1BIO_CLOSE\s0) flag.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
bio, BIO_meth_new
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_get_ex_new_index.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_get_ex_new_index.3,v 1.3 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_get_ex_new_index 3"
|
||||
.TH BIO_get_ex_new_index 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_get_ex_new_index 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -169,29 +173,29 @@ libcrypto, -lcrypto
|
|||
.IX Header "DESCRIPTION"
|
||||
In the description here, \fI\s-1TYPE\s0\fR is used a placeholder
|
||||
for any of the OpenSSL datatypes listed in
|
||||
\&\fICRYPTO_get_ex_new_index\fR\|(3).
|
||||
\&\fBCRYPTO_get_ex_new_index\fR\|(3).
|
||||
.PP
|
||||
These functions handle application-specific data for OpenSSL data
|
||||
structures.
|
||||
.PP
|
||||
\&\fITYPE_get_new_ex_index()\fR is a macro that calls \fICRYPTO_get_ex_new_index()\fR
|
||||
\&\fBTYPE_get_new_ex_index()\fR is a macro that calls \fBCRYPTO_get_ex_new_index()\fR
|
||||
with the correct \fBindex\fR value.
|
||||
.PP
|
||||
\&\fITYPE_set_ex_data()\fR is a function that calls \fICRYPTO_set_ex_data()\fR with
|
||||
\&\fBTYPE_set_ex_data()\fR is a function that calls \fBCRYPTO_set_ex_data()\fR with
|
||||
an offset into the opaque exdata part of the \s-1TYPE\s0 object.
|
||||
.PP
|
||||
\&\fITYPE_get_ex_data()\fR is a function that calls \fICRYPTO_get_ex_data()\fR with
|
||||
\&\fBTYPE_get_ex_data()\fR is a function that calls \fBCRYPTO_get_ex_data()\fR with
|
||||
an offset into the opaque exdata part of the \s-1TYPE\s0 object.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fITYPE_get_new_ex_index()\fR returns a new index on success or \-1 on error.
|
||||
\&\fBTYPE_get_new_ex_index()\fR returns a new index on success or \-1 on error.
|
||||
.PP
|
||||
\&\fITYPE_set_ex_data()\fR returns 1 on success or 0 on error.
|
||||
\&\fBTYPE_set_ex_data()\fR returns 1 on success or 0 on error.
|
||||
.PP
|
||||
\&\fITYPE_get_ex_data()\fR returns the application data or \s-1NULL\s0 if an error occurred.
|
||||
\&\fBTYPE_get_ex_data()\fR returns the application data or \s-1NULL\s0 if an error occurred.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fICRYPTO_get_ex_new_index\fR\|(3).
|
||||
\&\fBCRYPTO_get_ex_new_index\fR\|(3).
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2015\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_meth_new.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_meth_new.3,v 1.3 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_meth_new 3"
|
||||
.TH BIO_meth_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_meth_new 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -199,9 +203,9 @@ The \fB\s-1BIO_METHOD\s0\fR type is a structure used for the implementation of n
|
|||
types. It provides a set of functions used by OpenSSL for the implementation
|
||||
of the various \s-1BIO\s0 capabilities. See the bio page for more information.
|
||||
.PP
|
||||
\&\fIBIO_meth_new()\fR creates a new \fB\s-1BIO_METHOD\s0\fR structure. It should be given a
|
||||
\&\fBBIO_meth_new()\fR creates a new \fB\s-1BIO_METHOD\s0\fR structure. It should be given a
|
||||
unique integer \fBtype\fR and a string that represents its \fBname\fR.
|
||||
Use \fIBIO_get_new_index()\fR to get the value for \fBtype\fR.
|
||||
Use \fBBIO_get_new_index()\fR to get the value for \fBtype\fR.
|
||||
.PP
|
||||
The set of
|
||||
standard OpenSSL provided \s-1BIO\s0 types is provided in \fBbio.h\fR. Some examples
|
||||
|
@ -212,66 +216,66 @@ based BIOs (e.g. socket, fd, connect, accept etc) should additionally have the
|
|||
\&\*(L"descriptor\*(R" bit set (\fB\s-1BIO_TYPE_DESCRIPTOR\s0\fR). See the BIO_find_type page for
|
||||
more information.
|
||||
.PP
|
||||
\&\fIBIO_meth_free()\fR destroys a \fB\s-1BIO_METHOD\s0\fR structure and frees up any memory
|
||||
\&\fBBIO_meth_free()\fR destroys a \fB\s-1BIO_METHOD\s0\fR structure and frees up any memory
|
||||
associated with it.
|
||||
.PP
|
||||
\&\fIBIO_meth_get_write_ex()\fR and \fIBIO_meth_set_write_ex()\fR get and set the function
|
||||
\&\fBBIO_meth_get_write_ex()\fR and \fBBIO_meth_set_write_ex()\fR get and set the function
|
||||
used for writing arbitrary length data to the \s-1BIO\s0 respectively. This function
|
||||
will be called in response to the application calling \fIBIO_write_ex()\fR or
|
||||
\&\fIBIO_write()\fR. The parameters for the function have the same meaning as for
|
||||
\&\fIBIO_write_ex()\fR. Older code may call \fIBIO_meth_get_write()\fR and
|
||||
\&\fIBIO_meth_set_write()\fR instead. Applications should not call both
|
||||
\&\fIBIO_meth_set_write_ex()\fR and \fIBIO_meth_set_write()\fR or call \fIBIO_meth_get_write()\fR
|
||||
when the function was set with \fIBIO_meth_set_write_ex()\fR.
|
||||
will be called in response to the application calling \fBBIO_write_ex()\fR or
|
||||
\&\fBBIO_write()\fR. The parameters for the function have the same meaning as for
|
||||
\&\fBBIO_write_ex()\fR. Older code may call \fBBIO_meth_get_write()\fR and
|
||||
\&\fBBIO_meth_set_write()\fR instead. Applications should not call both
|
||||
\&\fBBIO_meth_set_write_ex()\fR and \fBBIO_meth_set_write()\fR or call \fBBIO_meth_get_write()\fR
|
||||
when the function was set with \fBBIO_meth_set_write_ex()\fR.
|
||||
.PP
|
||||
\&\fIBIO_meth_get_read_ex()\fR and \fIBIO_meth_set_read_ex()\fR get and set the function used
|
||||
\&\fBBIO_meth_get_read_ex()\fR and \fBBIO_meth_set_read_ex()\fR get and set the function used
|
||||
for reading arbitrary length data from the \s-1BIO\s0 respectively. This function will
|
||||
be called in response to the application calling \fIBIO_read_ex()\fR or \fIBIO_read()\fR.
|
||||
The parameters for the function have the same meaning as for \fIBIO_read_ex()\fR.
|
||||
Older code may call \fIBIO_meth_get_read()\fR and \fIBIO_meth_set_read()\fR instead.
|
||||
Applications should not call both \fIBIO_meth_set_read_ex()\fR and \fIBIO_meth_set_read()\fR
|
||||
or call \fIBIO_meth_get_read()\fR when the function was set with
|
||||
\&\fIBIO_meth_set_read_ex()\fR.
|
||||
be called in response to the application calling \fBBIO_read_ex()\fR or \fBBIO_read()\fR.
|
||||
The parameters for the function have the same meaning as for \fBBIO_read_ex()\fR.
|
||||
Older code may call \fBBIO_meth_get_read()\fR and \fBBIO_meth_set_read()\fR instead.
|
||||
Applications should not call both \fBBIO_meth_set_read_ex()\fR and \fBBIO_meth_set_read()\fR
|
||||
or call \fBBIO_meth_get_read()\fR when the function was set with
|
||||
\&\fBBIO_meth_set_read_ex()\fR.
|
||||
.PP
|
||||
\&\fIBIO_meth_get_puts()\fR and \fIBIO_meth_set_puts()\fR get and set the function used for
|
||||
\&\fBBIO_meth_get_puts()\fR and \fBBIO_meth_set_puts()\fR get and set the function used for
|
||||
writing a \s-1NULL\s0 terminated string to the \s-1BIO\s0 respectively. This function will be
|
||||
called in response to the application calling \fIBIO_puts()\fR. The parameters for
|
||||
the function have the same meaning as for \fIBIO_puts()\fR.
|
||||
called in response to the application calling \fBBIO_puts()\fR. The parameters for
|
||||
the function have the same meaning as for \fBBIO_puts()\fR.
|
||||
.PP
|
||||
\&\fIBIO_meth_get_gets()\fR and \fIBIO_meth_set_gets()\fR get and set the function typically
|
||||
used for reading a line of data from the \s-1BIO\s0 respectively (see the \fIBIO_gets\fR\|(3)
|
||||
\&\fBBIO_meth_get_gets()\fR and \fBBIO_meth_set_gets()\fR get and set the function typically
|
||||
used for reading a line of data from the \s-1BIO\s0 respectively (see the \fBBIO_gets\fR\|(3)
|
||||
page for more information). This function will be called in response to the
|
||||
application calling \fIBIO_gets()\fR. The parameters for the function have the same
|
||||
meaning as for \fIBIO_gets()\fR.
|
||||
application calling \fBBIO_gets()\fR. The parameters for the function have the same
|
||||
meaning as for \fBBIO_gets()\fR.
|
||||
.PP
|
||||
\&\fIBIO_meth_get_ctrl()\fR and \fIBIO_meth_set_ctrl()\fR get and set the function used for
|
||||
\&\fBBIO_meth_get_ctrl()\fR and \fBBIO_meth_set_ctrl()\fR get and set the function used for
|
||||
processing ctrl messages in the \s-1BIO\s0 respectively. See the BIO_ctrl page for
|
||||
more information. This function will be called in response to the application
|
||||
calling \fIBIO_ctrl()\fR. The parameters for the function have the same meaning as for
|
||||
\&\fIBIO_ctrl()\fR.
|
||||
calling \fBBIO_ctrl()\fR. The parameters for the function have the same meaning as for
|
||||
\&\fBBIO_ctrl()\fR.
|
||||
.PP
|
||||
\&\fIBIO_meth_get_create()\fR and \fIBIO_meth_set_create()\fR get and set the function used
|
||||
\&\fBBIO_meth_get_create()\fR and \fBBIO_meth_set_create()\fR get and set the function used
|
||||
for creating a new instance of the \s-1BIO\s0 respectively. This function will be
|
||||
called in response to the application calling \fIBIO_new()\fR and passing
|
||||
in a pointer to the current \s-1BIO_METHOD.\s0 The \fIBIO_new()\fR function will allocate the
|
||||
called in response to the application calling \fBBIO_new()\fR and passing
|
||||
in a pointer to the current \s-1BIO_METHOD.\s0 The \fBBIO_new()\fR function will allocate the
|
||||
memory for the new \s-1BIO,\s0 and a pointer to this newly allocated structure will
|
||||
be passed as a parameter to the function.
|
||||
.PP
|
||||
\&\fIBIO_meth_get_destroy()\fR and \fIBIO_meth_set_destroy()\fR get and set the function used
|
||||
\&\fBBIO_meth_get_destroy()\fR and \fBBIO_meth_set_destroy()\fR get and set the function used
|
||||
for destroying an instance of a \s-1BIO\s0 respectively. This function will be
|
||||
called in response to the application calling \fIBIO_free()\fR. A pointer to the \s-1BIO\s0
|
||||
called in response to the application calling \fBBIO_free()\fR. A pointer to the \s-1BIO\s0
|
||||
to be destroyed is passed as a parameter. The destroy function should be used
|
||||
for \s-1BIO\s0 specific clean up. The memory for the \s-1BIO\s0 itself should not be freed by
|
||||
this function.
|
||||
.PP
|
||||
\&\fIBIO_meth_get_callback_ctrl()\fR and \fIBIO_meth_set_callback_ctrl()\fR get and set the
|
||||
\&\fBBIO_meth_get_callback_ctrl()\fR and \fBBIO_meth_set_callback_ctrl()\fR get and set the
|
||||
function used for processing callback ctrl messages in the \s-1BIO\s0 respectively. See
|
||||
the \fIBIO_callback_ctrl\fR\|(3) page for more information. This function will be called
|
||||
in response to the application calling \fIBIO_callback_ctrl()\fR. The parameters for
|
||||
the function have the same meaning as for \fIBIO_callback_ctrl()\fR.
|
||||
the \fBBIO_callback_ctrl\fR\|(3) page for more information. This function will be called
|
||||
in response to the application calling \fBBIO_callback_ctrl()\fR. The parameters for
|
||||
the function have the same meaning as for \fBBIO_callback_ctrl()\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_get_new_index()\fR returns the new \s-1BIO\s0 type value or \-1 if an error occurred.
|
||||
\&\fBBIO_get_new_index()\fR returns the new \s-1BIO\s0 type value or \-1 if an error occurred.
|
||||
.PP
|
||||
BIO_meth_new(int type, const char *name) returns a valid \fB\s-1BIO_METHOD\s0\fR or \s-1NULL\s0
|
||||
if an error occurred.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_new.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_new.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_new 3"
|
||||
.TH BIO_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_new 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -154,38 +158,38 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fIBIO_new()\fR function returns a new \s-1BIO\s0 using method \fBtype\fR.
|
||||
The \fBBIO_new()\fR function returns a new \s-1BIO\s0 using method \fBtype\fR.
|
||||
.PP
|
||||
\&\fIBIO_up_ref()\fR increments the reference count associated with the \s-1BIO\s0 object.
|
||||
\&\fBBIO_up_ref()\fR increments the reference count associated with the \s-1BIO\s0 object.
|
||||
.PP
|
||||
\&\fIBIO_free()\fR frees up a single \s-1BIO,\s0 \fIBIO_vfree()\fR also frees up a single \s-1BIO\s0
|
||||
\&\fBBIO_free()\fR frees up a single \s-1BIO,\s0 \fBBIO_vfree()\fR also frees up a single \s-1BIO\s0
|
||||
but it does not return a value.
|
||||
If \fBa\fR is \s-1NULL\s0 nothing is done.
|
||||
Calling \fIBIO_free()\fR may also have some effect
|
||||
Calling \fBBIO_free()\fR may also have some effect
|
||||
on the underlying I/O structure, for example it may close the file being
|
||||
referred to under certain circumstances. For more details see the individual
|
||||
\&\s-1BIO_METHOD\s0 descriptions.
|
||||
.PP
|
||||
\&\fIBIO_free_all()\fR frees up an entire \s-1BIO\s0 chain, it does not halt if an error
|
||||
\&\fBBIO_free_all()\fR frees up an entire \s-1BIO\s0 chain, it does not halt if an error
|
||||
occurs freeing up an individual \s-1BIO\s0 in the chain.
|
||||
If \fBa\fR is \s-1NULL\s0 nothing is done.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_new()\fR returns a newly created \s-1BIO\s0 or \s-1NULL\s0 if the call fails.
|
||||
\&\fBBIO_new()\fR returns a newly created \s-1BIO\s0 or \s-1NULL\s0 if the call fails.
|
||||
.PP
|
||||
\&\fIBIO_up_ref()\fR and \fIBIO_free()\fR return 1 for success and 0 for failure.
|
||||
\&\fBBIO_up_ref()\fR and \fBBIO_free()\fR return 1 for success and 0 for failure.
|
||||
.PP
|
||||
\&\fIBIO_free_all()\fR and \fIBIO_vfree()\fR do not return values.
|
||||
\&\fBBIO_free_all()\fR and \fBBIO_vfree()\fR do not return values.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
If \fIBIO_free()\fR is called on a \s-1BIO\s0 chain it will only free one \s-1BIO\s0 resulting
|
||||
If \fBBIO_free()\fR is called on a \s-1BIO\s0 chain it will only free one \s-1BIO\s0 resulting
|
||||
in a memory leak.
|
||||
.PP
|
||||
Calling \fIBIO_free_all()\fR on a single \s-1BIO\s0 has the same effect as calling \fIBIO_free()\fR
|
||||
Calling \fBBIO_free_all()\fR on a single \s-1BIO\s0 has the same effect as calling \fBBIO_free()\fR
|
||||
on it other than the discarded return value.
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBIO_set()\fR was removed in OpenSSL 1.1.0 as \s-1BIO\s0 type is now opaque.
|
||||
\&\fBBIO_set()\fR was removed in OpenSSL 1.1.0 as \s-1BIO\s0 type is now opaque.
|
||||
.SH "EXAMPLE"
|
||||
.IX Header "EXAMPLE"
|
||||
Create a memory \s-1BIO:\s0
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_new_CMS.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_new_CMS.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_new_CMS 3"
|
||||
.TH BIO_new_CMS 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_new_CMS 3 "2019-03-12" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -149,7 +153,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_new_CMS()\fR returns a streaming filter \s-1BIO\s0 chain based on \fBcms\fR. The output
|
||||
\&\fBBIO_new_CMS()\fR returns a streaming filter \s-1BIO\s0 chain based on \fBcms\fR. The output
|
||||
of the filter is written to \fBout\fR. Any data written to the chain is
|
||||
automatically translated to a \s-1BER\s0 format \s-1CMS\s0 structure of the appropriate type.
|
||||
.SH "NOTES"
|
||||
|
@ -157,15 +161,15 @@ automatically translated to a \s-1BER\s0 format \s-1CMS\s0 structure of the appr
|
|||
The chain returned by this function behaves like a standard filter \s-1BIO.\s0 It
|
||||
supports non blocking I/O. Content is processed and streamed on the fly and not
|
||||
all held in memory at once: so it is possible to encode very large structures.
|
||||
After all content has been written through the chain \fIBIO_flush()\fR must be called
|
||||
After all content has been written through the chain \fBBIO_flush()\fR must be called
|
||||
to finalise the structure.
|
||||
.PP
|
||||
The \fB\s-1CMS_STREAM\s0\fR flag must be included in the corresponding \fBflags\fR
|
||||
parameter of the \fBcms\fR creation function.
|
||||
.PP
|
||||
If an application wishes to write additional data to \fBout\fR BIOs should be
|
||||
removed from the chain using \fIBIO_pop()\fR and freed with \fIBIO_free()\fR until \fBout\fR
|
||||
is reached. If no additional data needs to be written \fIBIO_free_all()\fR can be
|
||||
removed from the chain using \fBBIO_pop()\fR and freed with \fBBIO_free()\fR until \fBout\fR
|
||||
is reached. If no additional data needs to be written \fBBIO_free_all()\fR can be
|
||||
called to free up the whole chain.
|
||||
.PP
|
||||
Any content written through the filter is used verbatim: no canonical
|
||||
|
@ -178,22 +182,22 @@ structures.
|
|||
.PP
|
||||
Large numbers of small writes through the chain should be avoided as this will
|
||||
produce an output consisting of lots of \s-1OCTET STRING\s0 structures. Prepending
|
||||
a \fIBIO_f_buffer()\fR buffering \s-1BIO\s0 will prevent this.
|
||||
a \fBBIO_f_buffer()\fR buffering \s-1BIO\s0 will prevent this.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
There is currently no corresponding inverse \s-1BIO:\s0 i.e. one which can decode
|
||||
a \s-1CMS\s0 structure on the fly.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_new_CMS()\fR returns a \s-1BIO\s0 chain when successful or \s-1NULL\s0 if an error
|
||||
occurred. The error can be obtained from \fIERR_get_error\fR\|(3).
|
||||
\&\fBBIO_new_CMS()\fR returns a \s-1BIO\s0 chain when successful or \s-1NULL\s0 if an error
|
||||
occurred. The error can be obtained from \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fICMS_sign\fR\|(3),
|
||||
\&\fICMS_encrypt\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBCMS_sign\fR\|(3),
|
||||
\&\fBCMS_encrypt\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBIO_new_CMS()\fR was added to OpenSSL 1.0.0
|
||||
The \fBBIO_new_CMS()\fR function was added in OpenSSL 1.0.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2008\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_parse_hostserv.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_parse_hostserv.3,v 1.3 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_parse_hostserv 3"
|
||||
.TH BIO_parse_hostserv 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_parse_hostserv 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -155,14 +159,14 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_parse_hostserv()\fR will parse the information given in \fBhostserv\fR,
|
||||
\&\fBBIO_parse_hostserv()\fR will parse the information given in \fBhostserv\fR,
|
||||
create strings with the host name and service name and give those
|
||||
back via \fBhost\fR and \fBservice\fR. Those will need to be freed after
|
||||
they are used. \fBhostserv_prio\fR helps determine if \fBhostserv\fR shall
|
||||
be interpreted primarily as a host name or a service name in ambiguous
|
||||
cases.
|
||||
.PP
|
||||
The syntax the \fIBIO_parse_hostserv()\fR recognises is:
|
||||
The syntax the \fBBIO_parse_hostserv()\fR recognises is:
|
||||
.PP
|
||||
.Vb 7
|
||||
\& host + \*(Aq:\*(Aq + service
|
||||
|
@ -200,10 +204,10 @@ and \fBhostserv_prio\fR, as follows:
|
|||
.Ve
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_parse_hostserv()\fR returns 1 on success or 0 on error.
|
||||
\&\fBBIO_parse_hostserv()\fR returns 1 on success or 0 on error.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\s-1\fIBIO_ADDRINFO\s0\fR\|(3)
|
||||
\&\s-1\fBBIO_ADDRINFO\s0\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2016\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_printf.3,v 1.2 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_printf.3,v 1.3 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_printf 3"
|
||||
.TH BIO_printf 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_printf 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -154,24 +158,24 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_printf()\fR is similar to the standard C \fIprintf()\fR function, except that
|
||||
the output is sent to the specified \s-1BIO, \s0\fBbio\fR, rather than standard
|
||||
\&\fBBIO_printf()\fR is similar to the standard C \fBprintf()\fR function, except that
|
||||
the output is sent to the specified \s-1BIO,\s0 \fBbio\fR, rather than standard
|
||||
output. All common format specifiers are supported.
|
||||
.PP
|
||||
\&\fIBIO_vprintf()\fR is similar to the \fIvprintf()\fR function found on many platforms,
|
||||
the output is sent to the specified \s-1BIO, \s0\fBbio\fR, rather than standard
|
||||
\&\fBBIO_vprintf()\fR is similar to the \fBvprintf()\fR function found on many platforms,
|
||||
the output is sent to the specified \s-1BIO,\s0 \fBbio\fR, rather than standard
|
||||
output. All common format specifiers are supported. The argument
|
||||
list \fBargs\fR is a stdarg argument list.
|
||||
.PP
|
||||
\&\fIBIO_snprintf()\fR is for platforms that do not have the common \fIsnprintf()\fR
|
||||
function. It is like \fIsprintf()\fR except that the size parameter, \fBn\fR,
|
||||
\&\fBBIO_snprintf()\fR is for platforms that do not have the common \fBsnprintf()\fR
|
||||
function. It is like \fBsprintf()\fR except that the size parameter, \fBn\fR,
|
||||
specifies the size of the output buffer.
|
||||
.PP
|
||||
\&\fIBIO_vsnprintf()\fR is to \fIBIO_snprintf()\fR as \fIBIO_vprintf()\fR is to \fIBIO_printf()\fR.
|
||||
\&\fBBIO_vsnprintf()\fR is to \fBBIO_snprintf()\fR as \fBBIO_vprintf()\fR is to \fBBIO_printf()\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
All functions return the number of bytes written, or \-1 on error.
|
||||
For \fIBIO_snprintf()\fR and \fIBIO_vsnprintf()\fR this includes when the output
|
||||
For \fBBIO_snprintf()\fR and \fBBIO_vsnprintf()\fR this includes when the output
|
||||
buffer is too small.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_push.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_push.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_push 3"
|
||||
.TH BIO_push 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_push 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -151,26 +155,32 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
The \fIBIO_push()\fR function appends the \s-1BIO \s0\fBappend\fR to \fBb\fR, it returns
|
||||
The \fBBIO_push()\fR function appends the \s-1BIO\s0 \fBappend\fR to \fBb\fR, it returns
|
||||
\&\fBb\fR.
|
||||
.PP
|
||||
\&\fIBIO_pop()\fR removes the \s-1BIO \s0\fBb\fR from a chain and returns the next \s-1BIO\s0
|
||||
\&\fBBIO_pop()\fR removes the \s-1BIO\s0 \fBb\fR from a chain and returns the next \s-1BIO\s0
|
||||
in the chain, or \s-1NULL\s0 if there is no next \s-1BIO.\s0 The removed \s-1BIO\s0 then
|
||||
becomes a single \s-1BIO\s0 with no association with the original chain,
|
||||
it can thus be freed or attached to a different chain.
|
||||
.PP
|
||||
\&\fIBIO_set_next()\fR replaces the existing next \s-1BIO\s0 in a chain with the \s-1BIO\s0 pointed to
|
||||
\&\fBBIO_set_next()\fR replaces the existing next \s-1BIO\s0 in a chain with the \s-1BIO\s0 pointed to
|
||||
by \fBnext\fR. The new chain may include some of the same BIOs from the old chain
|
||||
or it may be completely different.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
The names of these functions are perhaps a little misleading. \fIBIO_push()\fR
|
||||
joins two \s-1BIO\s0 chains whereas \fIBIO_pop()\fR deletes a single \s-1BIO\s0 from a chain,
|
||||
The names of these functions are perhaps a little misleading. \fBBIO_push()\fR
|
||||
joins two \s-1BIO\s0 chains whereas \fBBIO_pop()\fR deletes a single \s-1BIO\s0 from a chain,
|
||||
the deleted \s-1BIO\s0 does not need to be at the end of a chain.
|
||||
.PP
|
||||
The process of calling \fIBIO_push()\fR and \fIBIO_pop()\fR on a \s-1BIO\s0 may have additional
|
||||
The process of calling \fBBIO_push()\fR and \fBBIO_pop()\fR on a \s-1BIO\s0 may have additional
|
||||
consequences (a control call is made to the affected BIOs) any effects will
|
||||
be noted in the descriptions of individual BIOs.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fBBIO_push()\fR returns the end of the chain, \fBb\fR.
|
||||
.PP
|
||||
\&\fBBIO_pop()\fR returns the next \s-1BIO\s0 in the chain, or \s-1NULL\s0 if there is no next
|
||||
\&\s-1BIO.\s0
|
||||
.SH "EXAMPLES"
|
||||
.IX Header "EXAMPLES"
|
||||
For these examples suppose \fBmd1\fR and \fBmd2\fR are digest BIOs, \fBb64\fR is
|
||||
|
@ -202,21 +212,15 @@ by \fBmd1\fR and \fBmd2\fR. If the call:
|
|||
.PP
|
||||
The call will return \fBb64\fR and the new chain will be \fBmd1\-b64\-f\fR data can
|
||||
be written to \fBmd1\fR as before.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_push()\fR returns the end of the chain, \fBb\fR.
|
||||
.PP
|
||||
\&\fIBIO_pop()\fR returns the next \s-1BIO\s0 in the chain, or \s-1NULL\s0 if there is no next
|
||||
\&\s-1BIO.\s0
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
bio
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
The \fIBIO_set_next()\fR function was added in OpenSSL 1.1.0.
|
||||
The \fBBIO_set_next()\fR function was added in OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2000\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_read.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_read.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_read 3"
|
||||
.TH BIO_read 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_read 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -156,37 +160,37 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_read_ex()\fR attempts to read \fBdlen\fR bytes from \s-1BIO \s0\fBb\fR and places the data
|
||||
\&\fBBIO_read_ex()\fR attempts to read \fBdlen\fR bytes from \s-1BIO\s0 \fBb\fR and places the data
|
||||
in \fBdata\fR. If any bytes were successfully read then the number of bytes read is
|
||||
stored in \fB*readbytes\fR.
|
||||
.PP
|
||||
\&\fIBIO_write_ex()\fR attempts to write \fBdlen\fR bytes from \fBdata\fR to \s-1BIO \s0\fBb\fR. If
|
||||
\&\fBBIO_write_ex()\fR attempts to write \fBdlen\fR bytes from \fBdata\fR to \s-1BIO\s0 \fBb\fR. If
|
||||
successful then the number of bytes written is stored in \fB*written\fR.
|
||||
.PP
|
||||
\&\fIBIO_read()\fR attempts to read \fBlen\fR bytes from \s-1BIO \s0\fBb\fR and places
|
||||
\&\fBBIO_read()\fR attempts to read \fBlen\fR bytes from \s-1BIO\s0 \fBb\fR and places
|
||||
the data in \fBbuf\fR.
|
||||
.PP
|
||||
\&\fIBIO_gets()\fR performs the BIOs \*(L"gets\*(R" operation and places the data
|
||||
\&\fBBIO_gets()\fR performs the BIOs \*(L"gets\*(R" operation and places the data
|
||||
in \fBbuf\fR. Usually this operation will attempt to read a line of data
|
||||
from the \s-1BIO\s0 of maximum length \fBsize\-1\fR. There are exceptions to this,
|
||||
however; for example, \fIBIO_gets()\fR on a digest \s-1BIO\s0 will calculate and
|
||||
return the digest and other BIOs may not support \fIBIO_gets()\fR at all.
|
||||
however; for example, \fBBIO_gets()\fR on a digest \s-1BIO\s0 will calculate and
|
||||
return the digest and other BIOs may not support \fBBIO_gets()\fR at all.
|
||||
The returned string is always NUL-terminated and the '\en' is preserved
|
||||
if present in the input data.
|
||||
.PP
|
||||
\&\fIBIO_write()\fR attempts to write \fBlen\fR bytes from \fBbuf\fR to \s-1BIO \s0\fBb\fR.
|
||||
\&\fBBIO_write()\fR attempts to write \fBlen\fR bytes from \fBbuf\fR to \s-1BIO\s0 \fBb\fR.
|
||||
.PP
|
||||
\&\fIBIO_puts()\fR attempts to write a NUL-terminated string \fBbuf\fR to \s-1BIO \s0\fBb\fR.
|
||||
\&\fBBIO_puts()\fR attempts to write a NUL-terminated string \fBbuf\fR to \s-1BIO\s0 \fBb\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_read_ex()\fR and \fIBIO_write_ex()\fR return 1 if data was successfully read or
|
||||
\&\fBBIO_read_ex()\fR and \fBBIO_write_ex()\fR return 1 if data was successfully read or
|
||||
written, and 0 otherwise.
|
||||
.PP
|
||||
All other functions return either the amount of data successfully read or
|
||||
written (if the return value is positive) or that no data was successfully
|
||||
read or written if the result is 0 or \-1. If the return value is \-2 then
|
||||
the operation is not implemented in the specific \s-1BIO\s0 type. The trailing
|
||||
\&\s-1NUL\s0 is not included in the length returned by \fIBIO_gets()\fR.
|
||||
\&\s-1NUL\s0 is not included in the length returned by \fBBIO_gets()\fR.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
A 0 or \-1 return is not necessarily an indication of an error. In
|
||||
|
@ -195,27 +199,27 @@ it may merely be an indication that no data is currently available and that
|
|||
the application should retry the operation later.
|
||||
.PP
|
||||
One technique sometimes used with blocking sockets is to use a system call
|
||||
(such as \fIselect()\fR, \fIpoll()\fR or equivalent) to determine when data is available
|
||||
and then call \fIread()\fR to read the data. The equivalent with BIOs (that is call
|
||||
\&\fIselect()\fR on the underlying I/O structure and then call \fIBIO_read()\fR to
|
||||
read the data) should \fBnot\fR be used because a single call to \fIBIO_read()\fR
|
||||
(such as \fBselect()\fR, \fBpoll()\fR or equivalent) to determine when data is available
|
||||
and then call \fBread()\fR to read the data. The equivalent with BIOs (that is call
|
||||
\&\fBselect()\fR on the underlying I/O structure and then call \fBBIO_read()\fR to
|
||||
read the data) should \fBnot\fR be used because a single call to \fBBIO_read()\fR
|
||||
can cause several reads (and writes in the case of \s-1SSL\s0 BIOs) on the underlying
|
||||
I/O structure and may block as a result. Instead \fIselect()\fR (or equivalent)
|
||||
I/O structure and may block as a result. Instead \fBselect()\fR (or equivalent)
|
||||
should be combined with non blocking I/O so successive reads will request
|
||||
a retry instead of blocking.
|
||||
.PP
|
||||
See \fIBIO_should_retry\fR\|(3) for details of how to
|
||||
See \fBBIO_should_retry\fR\|(3) for details of how to
|
||||
determine the cause of a retry and other I/O issues.
|
||||
.PP
|
||||
If the \fIBIO_gets()\fR function is not supported by a \s-1BIO\s0 then it possible to
|
||||
work around this by adding a buffering \s-1BIO \s0\fIBIO_f_buffer\fR\|(3)
|
||||
If the \fBBIO_gets()\fR function is not supported by a \s-1BIO\s0 then it possible to
|
||||
work around this by adding a buffering \s-1BIO\s0 \fBBIO_f_buffer\fR\|(3)
|
||||
to the chain.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIBIO_should_retry\fR\|(3)
|
||||
\&\fBBIO_should_retry\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBIO_gets()\fR on 1.1.0 and older when called on \fIBIO_fd()\fR based \s-1BIO\s0 does not
|
||||
\&\fBBIO_gets()\fR on 1.1.0 and older when called on \fBBIO_fd()\fR based \s-1BIO\s0 does not
|
||||
keep the '\en' at the end of the line in the buffer.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_s_accept.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_s_accept.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_s_accept 3"
|
||||
.TH BIO_s_accept 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_s_accept 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -174,7 +178,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_s_accept()\fR returns the accept \s-1BIO\s0 method. This is a wrapper
|
||||
\&\fBBIO_s_accept()\fR returns the accept \s-1BIO\s0 method. This is a wrapper
|
||||
round the platform's \s-1TCP/IP\s0 socket accept routines.
|
||||
.PP
|
||||
Using accept BIOs, \s-1TCP/IP\s0 connections can be accepted and data
|
||||
|
@ -186,50 +190,50 @@ on the underlying connection. If no connection is established
|
|||
and the port (see below) is set up properly then the \s-1BIO\s0
|
||||
waits for an incoming connection.
|
||||
.PP
|
||||
Accept BIOs support \fIBIO_puts()\fR but not \fIBIO_gets()\fR.
|
||||
Accept BIOs support \fBBIO_puts()\fR but not \fBBIO_gets()\fR.
|
||||
.PP
|
||||
If the close flag is set on an accept \s-1BIO\s0 then any active
|
||||
connection on that chain is shutdown and the socket closed when
|
||||
the \s-1BIO\s0 is freed.
|
||||
.PP
|
||||
Calling \fIBIO_reset()\fR on an accept \s-1BIO\s0 will close any active
|
||||
Calling \fBBIO_reset()\fR on an accept \s-1BIO\s0 will close any active
|
||||
connection and reset the \s-1BIO\s0 into a state where it awaits another
|
||||
incoming connection.
|
||||
.PP
|
||||
\&\fIBIO_get_fd()\fR and \fIBIO_set_fd()\fR can be called to retrieve or set
|
||||
the accept socket. See \fIBIO_s_fd\fR\|(3)
|
||||
\&\fBBIO_get_fd()\fR and \fBBIO_set_fd()\fR can be called to retrieve or set
|
||||
the accept socket. See \fBBIO_s_fd\fR\|(3)
|
||||
.PP
|
||||
\&\fIBIO_set_accept_name()\fR uses the string \fBname\fR to set the accept
|
||||
\&\fBBIO_set_accept_name()\fR uses the string \fBname\fR to set the accept
|
||||
name. The name is represented as a string of the form \*(L"host:port\*(R",
|
||||
where \*(L"host\*(R" is the interface to use and \*(L"port\*(R" is the port.
|
||||
The host can be \*(L"*\*(R" or empty which is interpreted as meaning
|
||||
any interface. If the host is an IPv6 address, it has to be
|
||||
enclosed in brackets, for example \*(L"[::1]:https\*(R". \*(L"port\*(R" has the
|
||||
same syntax as the port specified in \fIBIO_set_conn_port()\fR for
|
||||
same syntax as the port specified in \fBBIO_set_conn_port()\fR for
|
||||
connect BIOs, that is it can be a numerical port string or a
|
||||
string to lookup using \fIgetservbyname()\fR and a string table.
|
||||
string to lookup using \fBgetservbyname()\fR and a string table.
|
||||
.PP
|
||||
\&\fIBIO_set_accept_port()\fR uses the string \fBport\fR to set the accept
|
||||
\&\fBBIO_set_accept_port()\fR uses the string \fBport\fR to set the accept
|
||||
port. \*(L"port\*(R" has the same syntax as the port specified in
|
||||
\&\fIBIO_set_conn_port()\fR for connect BIOs, that is it can be a numerical
|
||||
port string or a string to lookup using \fIgetservbyname()\fR and a string
|
||||
\&\fBBIO_set_conn_port()\fR for connect BIOs, that is it can be a numerical
|
||||
port string or a string to lookup using \fBgetservbyname()\fR and a string
|
||||
table.
|
||||
.PP
|
||||
\&\fIBIO_new_accept()\fR combines \fIBIO_new()\fR and \fIBIO_set_accept_name()\fR into
|
||||
\&\fBBIO_new_accept()\fR combines \fBBIO_new()\fR and \fBBIO_set_accept_name()\fR into
|
||||
a single call: that is it creates a new accept \s-1BIO\s0 with port
|
||||
\&\fBhost_port\fR.
|
||||
.PP
|
||||
\&\fIBIO_set_nbio_accept()\fR sets the accept socket to blocking mode
|
||||
\&\fBBIO_set_nbio_accept()\fR sets the accept socket to blocking mode
|
||||
(the default) if \fBn\fR is 0 or non blocking mode if \fBn\fR is 1.
|
||||
.PP
|
||||
\&\fIBIO_set_accept_bios()\fR can be used to set a chain of BIOs which
|
||||
\&\fBBIO_set_accept_bios()\fR can be used to set a chain of BIOs which
|
||||
will be duplicated and prepended to the chain when an incoming
|
||||
connection is received. This is useful if, for example, a
|
||||
buffering or \s-1SSL BIO\s0 is required for each connection. The
|
||||
chain of BIOs must not be freed after this call, they will
|
||||
be automatically freed when the accept \s-1BIO\s0 is freed.
|
||||
.PP
|
||||
\&\fIBIO_set_bind_mode()\fR and \fIBIO_get_bind_mode()\fR set and retrieve
|
||||
\&\fBBIO_set_bind_mode()\fR and \fBBIO_get_bind_mode()\fR set and retrieve
|
||||
the current bind mode. If \fB\s-1BIO_BIND_NORMAL\s0\fR (the default) is set
|
||||
then another socket cannot be bound to the same port. If
|
||||
\&\fB\s-1BIO_BIND_REUSEADDR\s0\fR is set then other sockets can bind to the
|
||||
|
@ -238,10 +242,10 @@ attempt is first made to use \s-1BIO_BIN_NORMAL,\s0 if this fails
|
|||
and the port is not in use then a second attempt is made
|
||||
using \fB\s-1BIO_BIND_REUSEADDR\s0\fR.
|
||||
.PP
|
||||
\&\fIBIO_do_accept()\fR serves two functions. When it is first
|
||||
\&\fBBIO_do_accept()\fR serves two functions. When it is first
|
||||
called, after the accept \s-1BIO\s0 has been setup, it will attempt
|
||||
to create the accept socket and bind an address to it. Second
|
||||
and subsequent calls to \fIBIO_do_accept()\fR will await an incoming
|
||||
and subsequent calls to \fBBIO_do_accept()\fR will await an incoming
|
||||
connection, or request a retry in non blocking mode.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
|
@ -256,7 +260,7 @@ accept\->socket. This effectively means that attempting I/O on
|
|||
an initial accept socket will await an incoming connection then
|
||||
perform I/O on it.
|
||||
.PP
|
||||
If any additional BIOs have been set using \fIBIO_set_accept_bios()\fR
|
||||
If any additional BIOs have been set using \fBBIO_set_accept_bios()\fR
|
||||
then they are placed between the socket and the accept \s-1BIO,\s0
|
||||
that is the chain will be accept\->otherbios\->socket.
|
||||
.PP
|
||||
|
@ -273,43 +277,43 @@ After this call \fBconnection\fR will contain a \s-1BIO\s0 for the recently
|
|||
established connection and \fBaccept\fR will now be a single \s-1BIO\s0
|
||||
again which can be used to await further incoming connections.
|
||||
If no further connections will be accepted the \fBaccept\fR can
|
||||
be freed using \fIBIO_free()\fR.
|
||||
be freed using \fBBIO_free()\fR.
|
||||
.PP
|
||||
If only a single connection will be processed it is possible to
|
||||
perform I/O using the accept \s-1BIO\s0 itself. This is often undesirable
|
||||
however because the accept \s-1BIO\s0 will still accept additional incoming
|
||||
connections. This can be resolved by using \fIBIO_pop()\fR (see above)
|
||||
connections. This can be resolved by using \fBBIO_pop()\fR (see above)
|
||||
and freeing up the accept \s-1BIO\s0 after the initial connection.
|
||||
.PP
|
||||
If the underlying accept socket is non-blocking and \fIBIO_do_accept()\fR is
|
||||
If the underlying accept socket is non-blocking and \fBBIO_do_accept()\fR is
|
||||
called to await an incoming connection it is possible for
|
||||
\&\fIBIO_should_io_special()\fR with the reason \s-1BIO_RR_ACCEPT.\s0 If this happens
|
||||
\&\fBBIO_should_io_special()\fR with the reason \s-1BIO_RR_ACCEPT.\s0 If this happens
|
||||
then it is an indication that an accept attempt would block: the application
|
||||
should take appropriate action to wait until the underlying socket has
|
||||
accepted a connection and retry the call.
|
||||
.PP
|
||||
\&\fIBIO_set_accept_name()\fR, \fIBIO_get_accept_name()\fR, \fIBIO_set_accept_port()\fR,
|
||||
\&\fIBIO_get_accept_port()\fR, \fIBIO_set_nbio_accept()\fR, \fIBIO_set_accept_bios()\fR,
|
||||
\&\fIBIO_get_peer_name()\fR, \fIBIO_get_peer_port()\fR,
|
||||
\&\fIBIO_get_accept_ip_family()\fR, \fIBIO_set_accept_ip_family()\fR,
|
||||
\&\fIBIO_set_bind_mode()\fR, \fIBIO_get_bind_mode()\fR and \fIBIO_do_accept()\fR are macros.
|
||||
\&\fBBIO_set_accept_name()\fR, \fBBIO_get_accept_name()\fR, \fBBIO_set_accept_port()\fR,
|
||||
\&\fBBIO_get_accept_port()\fR, \fBBIO_set_nbio_accept()\fR, \fBBIO_set_accept_bios()\fR,
|
||||
\&\fBBIO_get_peer_name()\fR, \fBBIO_get_peer_port()\fR,
|
||||
\&\fBBIO_get_accept_ip_family()\fR, \fBBIO_set_accept_ip_family()\fR,
|
||||
\&\fBBIO_set_bind_mode()\fR, \fBBIO_get_bind_mode()\fR and \fBBIO_do_accept()\fR are macros.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_do_accept()\fR,
|
||||
\&\fIBIO_set_accept_name()\fR, \fIBIO_set_accept_port()\fR, \fIBIO_set_nbio_accept()\fR,
|
||||
\&\fIBIO_set_accept_bios()\fR, \fIBIO_set_accept_ip_family()\fR, and \fIBIO_set_bind_mode()\fR
|
||||
\&\fBBIO_do_accept()\fR,
|
||||
\&\fBBIO_set_accept_name()\fR, \fBBIO_set_accept_port()\fR, \fBBIO_set_nbio_accept()\fR,
|
||||
\&\fBBIO_set_accept_bios()\fR, \fBBIO_set_accept_ip_family()\fR, and \fBBIO_set_bind_mode()\fR
|
||||
return 1 for success and 0 or \-1 for failure.
|
||||
.PP
|
||||
\&\fIBIO_get_accept_name()\fR returns the accept name or \s-1NULL\s0 on error.
|
||||
\&\fIBIO_get_peer_name()\fR returns the peer name or \s-1NULL\s0 on error.
|
||||
\&\fBBIO_get_accept_name()\fR returns the accept name or \s-1NULL\s0 on error.
|
||||
\&\fBBIO_get_peer_name()\fR returns the peer name or \s-1NULL\s0 on error.
|
||||
.PP
|
||||
\&\fIBIO_get_accept_port()\fR returns the accept port as a string or \s-1NULL\s0 on error.
|
||||
\&\fIBIO_get_peer_port()\fR returns the peer port as a string or \s-1NULL\s0 on error.
|
||||
\&\fIBIO_get_accept_ip_family()\fR returns the \s-1IP\s0 family or \-1 on error.
|
||||
\&\fBBIO_get_accept_port()\fR returns the accept port as a string or \s-1NULL\s0 on error.
|
||||
\&\fBBIO_get_peer_port()\fR returns the peer port as a string or \s-1NULL\s0 on error.
|
||||
\&\fBBIO_get_accept_ip_family()\fR returns the \s-1IP\s0 family or \-1 on error.
|
||||
.PP
|
||||
\&\fIBIO_get_bind_mode()\fR returns the set of \fB\s-1BIO_BIND\s0\fR flags, or \-1 on failure.
|
||||
\&\fBBIO_get_bind_mode()\fR returns the set of \fB\s-1BIO_BIND\s0\fR flags, or \-1 on failure.
|
||||
.PP
|
||||
\&\fIBIO_new_accept()\fR returns a \s-1BIO\s0 or \s-1NULL\s0 on error.
|
||||
\&\fBBIO_new_accept()\fR returns a \s-1BIO\s0 or \s-1NULL\s0 on error.
|
||||
.SH "EXAMPLE"
|
||||
.IX Header "EXAMPLE"
|
||||
This example accepts two connections on port 4444, sends messages
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_s_bio.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_s_bio.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_s_bio 3"
|
||||
.TH BIO_s_bio 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_s_bio 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -167,7 +171,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_s_bio()\fR returns the method for a \s-1BIO\s0 pair. A \s-1BIO\s0 pair is a pair of source/sink
|
||||
\&\fBBIO_s_bio()\fR returns the method for a \s-1BIO\s0 pair. A \s-1BIO\s0 pair is a pair of source/sink
|
||||
BIOs where data written to either half of the pair is buffered and can be read from
|
||||
the other half. Both halves must usually by handled by the same application thread
|
||||
since no locking is done on the internal data structures.
|
||||
|
@ -180,47 +184,47 @@ One typical use of \s-1BIO\s0 pairs is to place \s-1TLS/SSL I/O\s0 under applica
|
|||
can be used when the application wishes to use a non standard transport for
|
||||
\&\s-1TLS/SSL\s0 or the normal socket routines are inappropriate.
|
||||
.PP
|
||||
Calls to \fIBIO_read_ex()\fR will read data from the buffer or request a retry if no
|
||||
Calls to \fBBIO_read_ex()\fR will read data from the buffer or request a retry if no
|
||||
data is available.
|
||||
.PP
|
||||
Calls to \fIBIO_write_ex()\fR will place data in the buffer or request a retry if the
|
||||
Calls to \fBBIO_write_ex()\fR will place data in the buffer or request a retry if the
|
||||
buffer is full.
|
||||
.PP
|
||||
The standard calls \fIBIO_ctrl_pending()\fR and \fIBIO_ctrl_wpending()\fR can be used to
|
||||
The standard calls \fBBIO_ctrl_pending()\fR and \fBBIO_ctrl_wpending()\fR can be used to
|
||||
determine the amount of pending data in the read or write buffer.
|
||||
.PP
|
||||
\&\fIBIO_reset()\fR clears any data in the write buffer.
|
||||
\&\fBBIO_reset()\fR clears any data in the write buffer.
|
||||
.PP
|
||||
\&\fIBIO_make_bio_pair()\fR joins two separate BIOs into a connected pair.
|
||||
\&\fBBIO_make_bio_pair()\fR joins two separate BIOs into a connected pair.
|
||||
.PP
|
||||
\&\fIBIO_destroy_pair()\fR destroys the association between two connected BIOs. Freeing
|
||||
\&\fBBIO_destroy_pair()\fR destroys the association between two connected BIOs. Freeing
|
||||
up any half of the pair will automatically destroy the association.
|
||||
.PP
|
||||
\&\fIBIO_shutdown_wr()\fR is used to close down a \s-1BIO \s0\fBb\fR. After this call no further
|
||||
writes on \s-1BIO \s0\fBb\fR are allowed (they will return an error). Reads on the other
|
||||
\&\fBBIO_shutdown_wr()\fR is used to close down a \s-1BIO\s0 \fBb\fR. After this call no further
|
||||
writes on \s-1BIO\s0 \fBb\fR are allowed (they will return an error). Reads on the other
|
||||
half of the pair will return any pending data or \s-1EOF\s0 when all pending data has
|
||||
been read.
|
||||
.PP
|
||||
\&\fIBIO_set_write_buf_size()\fR sets the write buffer size of \s-1BIO \s0\fBb\fR to \fBsize\fR.
|
||||
\&\fBBIO_set_write_buf_size()\fR sets the write buffer size of \s-1BIO\s0 \fBb\fR to \fBsize\fR.
|
||||
If the size is not initialized a default value is used. This is currently
|
||||
17K, sufficient for a maximum size \s-1TLS\s0 record.
|
||||
.PP
|
||||
\&\fIBIO_get_write_buf_size()\fR returns the size of the write buffer.
|
||||
\&\fBBIO_get_write_buf_size()\fR returns the size of the write buffer.
|
||||
.PP
|
||||
\&\fIBIO_new_bio_pair()\fR combines the calls to \fIBIO_new()\fR, \fIBIO_make_bio_pair()\fR and
|
||||
\&\fIBIO_set_write_buf_size()\fR to create a connected pair of BIOs \fBbio1\fR, \fBbio2\fR
|
||||
\&\fBBIO_new_bio_pair()\fR combines the calls to \fBBIO_new()\fR, \fBBIO_make_bio_pair()\fR and
|
||||
\&\fBBIO_set_write_buf_size()\fR to create a connected pair of BIOs \fBbio1\fR, \fBbio2\fR
|
||||
with write buffer sizes \fBwritebuf1\fR and \fBwritebuf2\fR. If either size is
|
||||
zero then the default size is used. \fIBIO_new_bio_pair()\fR does not check whether
|
||||
zero then the default size is used. \fBBIO_new_bio_pair()\fR does not check whether
|
||||
\&\fBbio1\fR or \fBbio2\fR do point to some other \s-1BIO,\s0 the values are overwritten,
|
||||
\&\fIBIO_free()\fR is not called.
|
||||
\&\fBBIO_free()\fR is not called.
|
||||
.PP
|
||||
\&\fIBIO_get_write_guarantee()\fR and \fIBIO_ctrl_get_write_guarantee()\fR return the maximum
|
||||
\&\fBBIO_get_write_guarantee()\fR and \fBBIO_ctrl_get_write_guarantee()\fR return the maximum
|
||||
length of data that can be currently written to the \s-1BIO.\s0 Writes larger than this
|
||||
value will return a value from \fIBIO_write_ex()\fR less than the amount requested or
|
||||
if the buffer is full request a retry. \fIBIO_ctrl_get_write_guarantee()\fR is a
|
||||
function whereas \fIBIO_get_write_guarantee()\fR is a macro.
|
||||
value will return a value from \fBBIO_write_ex()\fR less than the amount requested or
|
||||
if the buffer is full request a retry. \fBBIO_ctrl_get_write_guarantee()\fR is a
|
||||
function whereas \fBBIO_get_write_guarantee()\fR is a macro.
|
||||
.PP
|
||||
\&\fIBIO_get_read_request()\fR and \fIBIO_ctrl_get_read_request()\fR return the
|
||||
\&\fBBIO_get_read_request()\fR and \fBBIO_ctrl_get_read_request()\fR return the
|
||||
amount of data requested, or the buffer size if it is less, if the
|
||||
last read attempt at the other half of the \s-1BIO\s0 pair failed due to an
|
||||
empty buffer. This can be used to determine how much data should be
|
||||
|
@ -229,40 +233,40 @@ in \s-1TLS/SSL\s0 applications where the amount of data read is usually
|
|||
meaningful rather than just a buffer size. After a successful read
|
||||
this call will return zero. It also will return zero once new data
|
||||
has been written satisfying the read request or part of it.
|
||||
Note that \fIBIO_get_read_request()\fR never returns an amount larger
|
||||
than that returned by \fIBIO_get_write_guarantee()\fR.
|
||||
Note that \fBBIO_get_read_request()\fR never returns an amount larger
|
||||
than that returned by \fBBIO_get_write_guarantee()\fR.
|
||||
.PP
|
||||
\&\fIBIO_ctrl_reset_read_request()\fR can also be used to reset the value returned by
|
||||
\&\fIBIO_get_read_request()\fR to zero.
|
||||
\&\fBBIO_ctrl_reset_read_request()\fR can also be used to reset the value returned by
|
||||
\&\fBBIO_get_read_request()\fR to zero.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
Both halves of a \s-1BIO\s0 pair should be freed. That is even if one half is implicit
|
||||
freed due to a \fIBIO_free_all()\fR or \fISSL_free()\fR call the other half needs to be freed.
|
||||
freed due to a \fBBIO_free_all()\fR or \fBSSL_free()\fR call the other half needs to be freed.
|
||||
.PP
|
||||
When used in bidirectional applications (such as \s-1TLS/SSL\s0) care should be taken to
|
||||
flush any data in the write buffer. This can be done by calling \fIBIO_pending()\fR
|
||||
flush any data in the write buffer. This can be done by calling \fBBIO_pending()\fR
|
||||
on the other half of the pair and, if any data is pending, reading it and sending
|
||||
it to the underlying transport. This must be done before any normal processing
|
||||
(such as calling \fIselect()\fR ) due to a request and \fIBIO_should_read()\fR being true.
|
||||
(such as calling \fBselect()\fR ) due to a request and \fBBIO_should_read()\fR being true.
|
||||
.PP
|
||||
To see why this is important consider a case where a request is sent using
|
||||
\&\fIBIO_write_ex()\fR and a response read with \fIBIO_read_ex()\fR, this can occur during an
|
||||
\&\s-1TLS/SSL\s0 handshake for example. \fIBIO_write_ex()\fR will succeed and place data in the
|
||||
write buffer. \fIBIO_read_ex()\fR will initially fail and \fIBIO_should_read()\fR will be
|
||||
\&\fBBIO_write_ex()\fR and a response read with \fBBIO_read_ex()\fR, this can occur during an
|
||||
\&\s-1TLS/SSL\s0 handshake for example. \fBBIO_write_ex()\fR will succeed and place data in the
|
||||
write buffer. \fBBIO_read_ex()\fR will initially fail and \fBBIO_should_read()\fR will be
|
||||
true. If the application then waits for data to be available on the underlying
|
||||
transport before flushing the write buffer it will never succeed because the
|
||||
request was never sent!
|
||||
.PP
|
||||
\&\fIBIO_eof()\fR is true if no data is in the peer \s-1BIO\s0 and the peer \s-1BIO\s0 has been
|
||||
\&\fBBIO_eof()\fR is true if no data is in the peer \s-1BIO\s0 and the peer \s-1BIO\s0 has been
|
||||
shutdown.
|
||||
.PP
|
||||
\&\fIBIO_make_bio_pair()\fR, \fIBIO_destroy_bio_pair()\fR, \fIBIO_shutdown_wr()\fR,
|
||||
\&\fIBIO_set_write_buf_size()\fR, \fIBIO_get_write_buf_size()\fR,
|
||||
\&\fIBIO_get_write_guarantee()\fR, and \fIBIO_get_read_request()\fR are implemented
|
||||
\&\fBBIO_make_bio_pair()\fR, \fBBIO_destroy_bio_pair()\fR, \fBBIO_shutdown_wr()\fR,
|
||||
\&\fBBIO_set_write_buf_size()\fR, \fBBIO_get_write_buf_size()\fR,
|
||||
\&\fBBIO_get_write_guarantee()\fR, and \fBBIO_get_read_request()\fR are implemented
|
||||
as macros.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_new_bio_pair()\fR returns 1 on success, with the new BIOs available in
|
||||
\&\fBBIO_new_bio_pair()\fR returns 1 on success, with the new BIOs available in
|
||||
\&\fBbio1\fR and \fBbio2\fR, or 0 on failure, with \s-1NULL\s0 pointers stored into the
|
||||
locations for \fBbio1\fR and \fBbio2\fR. Check the error stack for more information.
|
||||
.PP
|
||||
|
@ -270,7 +274,7 @@ locations for \fBbio1\fR and \fBbio2\fR. Check the error stack for more informat
|
|||
.SH "EXAMPLE"
|
||||
.IX Header "EXAMPLE"
|
||||
The \s-1BIO\s0 pair can be used to have full control over the network access of an
|
||||
application. The application can call \fIselect()\fR on the socket as required
|
||||
application. The application can call \fBselect()\fR on the socket as required
|
||||
without having to go through the SSL-interface.
|
||||
.PP
|
||||
.Vb 1
|
||||
|
@ -307,21 +311,21 @@ connection, it behaves non-blocking and will return as soon as the write
|
|||
buffer is full or the read buffer is drained. Then the application has to
|
||||
flush the write buffer and/or fill the read buffer.
|
||||
.PP
|
||||
Use the \fIBIO_ctrl_pending()\fR, to find out whether data is buffered in the \s-1BIO\s0
|
||||
and must be transferred to the network. Use \fIBIO_ctrl_get_read_request()\fR to
|
||||
Use the \fBBIO_ctrl_pending()\fR, to find out whether data is buffered in the \s-1BIO\s0
|
||||
and must be transferred to the network. Use \fBBIO_ctrl_get_read_request()\fR to
|
||||
find out, how many bytes must be written into the buffer before the
|
||||
\&\fISSL_operation()\fR can successfully be continued.
|
||||
\&\fBSSL_operation()\fR can successfully be continued.
|
||||
.SH "WARNING"
|
||||
.IX Header "WARNING"
|
||||
As the data is buffered, \fISSL_operation()\fR may return with an \s-1ERROR_SSL_WANT_READ\s0
|
||||
As the data is buffered, \fBSSL_operation()\fR may return with an \s-1ERROR_SSL_WANT_READ\s0
|
||||
condition, but there is still data in the write buffer. An application must
|
||||
not rely on the error value of \fISSL_operation()\fR but must assure that the
|
||||
not rely on the error value of \fBSSL_operation()\fR but must assure that the
|
||||
write buffer is always flushed first. Otherwise a deadlock may occur as
|
||||
the peer might be waiting for the data before being able to continue.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fISSL_set_bio\fR\|(3), \fIssl\fR\|(7), \fIbio\fR\|(7),
|
||||
\&\fIBIO_should_retry\fR\|(3), \fIBIO_read_ex\fR\|(3)
|
||||
\&\fBSSL_set_bio\fR\|(3), \fBssl\fR\|(7), \fBbio\fR\|(7),
|
||||
\&\fBBIO_should_retry\fR\|(3), \fBBIO_read_ex\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_s_connect.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_s_connect.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_s_connect 3"
|
||||
.TH BIO_s_connect 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_s_connect 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -168,7 +172,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_s_connect()\fR returns the connect \s-1BIO\s0 method. This is a wrapper
|
||||
\&\fBBIO_s_connect()\fR returns the connect \s-1BIO\s0 method. This is a wrapper
|
||||
round the platform's \s-1TCP/IP\s0 socket connection routines.
|
||||
.PP
|
||||
Using connect BIOs, \s-1TCP/IP\s0 connections can be made and data
|
||||
|
@ -180,61 +184,61 @@ on the underlying connection. If no connection is established
|
|||
and the port and hostname (see below) is set up properly then
|
||||
a connection is established first.
|
||||
.PP
|
||||
Connect BIOs support \fIBIO_puts()\fR but not \fIBIO_gets()\fR.
|
||||
Connect BIOs support \fBBIO_puts()\fR but not \fBBIO_gets()\fR.
|
||||
.PP
|
||||
If the close flag is set on a connect \s-1BIO\s0 then any active
|
||||
connection is shutdown and the socket closed when the \s-1BIO\s0
|
||||
is freed.
|
||||
.PP
|
||||
Calling \fIBIO_reset()\fR on a connect \s-1BIO\s0 will close any active
|
||||
Calling \fBBIO_reset()\fR on a connect \s-1BIO\s0 will close any active
|
||||
connection and reset the \s-1BIO\s0 into a state where it can connect
|
||||
to the same host again.
|
||||
.PP
|
||||
\&\fIBIO_get_fd()\fR places the underlying socket in \fBc\fR if it is not \s-1NULL,\s0
|
||||
\&\fBBIO_get_fd()\fR places the underlying socket in \fBc\fR if it is not \s-1NULL,\s0
|
||||
it also returns the socket . If \fBc\fR is not \s-1NULL\s0 it should be of
|
||||
type (int *).
|
||||
.PP
|
||||
\&\fIBIO_set_conn_hostname()\fR uses the string \fBname\fR to set the hostname.
|
||||
\&\fBBIO_set_conn_hostname()\fR uses the string \fBname\fR to set the hostname.
|
||||
The hostname can be an \s-1IP\s0 address; if the address is an IPv6 one, it
|
||||
must be enclosed with brackets. The hostname can also include the
|
||||
port in the form hostname:port.
|
||||
.PP
|
||||
\&\fIBIO_set_conn_port()\fR sets the port to \fBport\fR. \fBport\fR can be the
|
||||
\&\fBBIO_set_conn_port()\fR sets the port to \fBport\fR. \fBport\fR can be the
|
||||
numerical form or a string such as \*(L"http\*(R". A string will be looked
|
||||
up first using \fIgetservbyname()\fR on the host platform but if that
|
||||
up first using \fBgetservbyname()\fR on the host platform but if that
|
||||
fails a standard table of port names will be used. This internal
|
||||
list is http, telnet, socks, https, ssl, ftp, and gopher.
|
||||
.PP
|
||||
\&\fIBIO_set_conn_address()\fR sets the address and port information using
|
||||
a \s-1\fIBIO_ADDR\s0\fR\|(3ssl).
|
||||
\&\fBBIO_set_conn_address()\fR sets the address and port information using
|
||||
a \s-1\fBBIO_ADDR\s0\fR\|(3ssl).
|
||||
.PP
|
||||
\&\fIBIO_set_conn_ip_family()\fR sets the \s-1IP\s0 family.
|
||||
\&\fBBIO_set_conn_ip_family()\fR sets the \s-1IP\s0 family.
|
||||
.PP
|
||||
\&\fIBIO_get_conn_hostname()\fR returns the hostname of the connect \s-1BIO\s0 or
|
||||
\&\fBBIO_get_conn_hostname()\fR returns the hostname of the connect \s-1BIO\s0 or
|
||||
\&\s-1NULL\s0 if the \s-1BIO\s0 is initialized but no hostname is set.
|
||||
This return value is an internal pointer which should not be modified.
|
||||
.PP
|
||||
\&\fIBIO_get_conn_port()\fR returns the port as a string.
|
||||
\&\fBBIO_get_conn_port()\fR returns the port as a string.
|
||||
This return value is an internal pointer which should not be modified.
|
||||
.PP
|
||||
\&\fIBIO_get_conn_address()\fR returns the address information as a \s-1BIO_ADDR.\s0
|
||||
\&\fBBIO_get_conn_address()\fR returns the address information as a \s-1BIO_ADDR.\s0
|
||||
This return value is an internal pointer which should not be modified.
|
||||
.PP
|
||||
\&\fIBIO_get_conn_ip_family()\fR returns the \s-1IP\s0 family of the connect \s-1BIO.\s0
|
||||
\&\fBBIO_get_conn_ip_family()\fR returns the \s-1IP\s0 family of the connect \s-1BIO.\s0
|
||||
.PP
|
||||
\&\fIBIO_set_nbio()\fR sets the non blocking I/O flag to \fBn\fR. If \fBn\fR is
|
||||
\&\fBBIO_set_nbio()\fR sets the non blocking I/O flag to \fBn\fR. If \fBn\fR is
|
||||
zero then blocking I/O is set. If \fBn\fR is 1 then non blocking I/O
|
||||
is set. Blocking I/O is the default. The call to \fIBIO_set_nbio()\fR
|
||||
is set. Blocking I/O is the default. The call to \fBBIO_set_nbio()\fR
|
||||
should be made before the connection is established because
|
||||
non blocking I/O is set during the connect process.
|
||||
.PP
|
||||
\&\fIBIO_new_connect()\fR combines \fIBIO_new()\fR and \fIBIO_set_conn_hostname()\fR into
|
||||
\&\fBBIO_new_connect()\fR combines \fBBIO_new()\fR and \fBBIO_set_conn_hostname()\fR into
|
||||
a single call: that is it creates a new connect \s-1BIO\s0 with \fBname\fR.
|
||||
.PP
|
||||
\&\fIBIO_do_connect()\fR attempts to connect the supplied \s-1BIO.\s0 It returns 1
|
||||
\&\fBBIO_do_connect()\fR attempts to connect the supplied \s-1BIO.\s0 It returns 1
|
||||
if the connection was established successfully. A zero or negative
|
||||
value is returned if the connection could not be established, the
|
||||
call \fIBIO_should_retry()\fR should be used for non blocking connect BIOs
|
||||
call \fBBIO_should_retry()\fR should be used for non blocking connect BIOs
|
||||
to determine if the call should be retried.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
|
@ -243,59 +247,59 @@ I/O call is caused by an error condition, although a zero return
|
|||
will normally mean that the connection was closed.
|
||||
.PP
|
||||
If the port name is supplied as part of the host name then this will
|
||||
override any value set with \fIBIO_set_conn_port()\fR. This may be undesirable
|
||||
override any value set with \fBBIO_set_conn_port()\fR. This may be undesirable
|
||||
if the application does not wish to allow connection to arbitrary
|
||||
ports. This can be avoided by checking for the presence of the ':'
|
||||
character in the passed hostname and either indicating an error or
|
||||
truncating the string at that point.
|
||||
.PP
|
||||
The values returned by \fIBIO_get_conn_hostname()\fR, \fIBIO_get_conn_address()\fR,
|
||||
and \fIBIO_get_conn_port()\fR are updated when a connection attempt is made.
|
||||
The values returned by \fBBIO_get_conn_hostname()\fR, \fBBIO_get_conn_address()\fR,
|
||||
and \fBBIO_get_conn_port()\fR are updated when a connection attempt is made.
|
||||
Before any connection attempt the values returned are those set by the
|
||||
application itself.
|
||||
.PP
|
||||
Applications do not have to call \fIBIO_do_connect()\fR but may wish to do
|
||||
Applications do not have to call \fBBIO_do_connect()\fR but may wish to do
|
||||
so to separate the connection process from other I/O processing.
|
||||
.PP
|
||||
If non blocking I/O is set then retries will be requested as appropriate.
|
||||
.PP
|
||||
It addition to \fIBIO_should_read()\fR and \fIBIO_should_write()\fR it is also
|
||||
possible for \fIBIO_should_io_special()\fR to be true during the initial
|
||||
It addition to \fBBIO_should_read()\fR and \fBBIO_should_write()\fR it is also
|
||||
possible for \fBBIO_should_io_special()\fR to be true during the initial
|
||||
connection process with the reason \s-1BIO_RR_CONNECT.\s0 If this is returned
|
||||
then this is an indication that a connection attempt would block,
|
||||
the application should then take appropriate action to wait until
|
||||
the underlying socket has connected and retry the call.
|
||||
.PP
|
||||
\&\fIBIO_set_conn_hostname()\fR, \fIBIO_set_conn_port()\fR, \fIBIO_get_conn_hostname()\fR,
|
||||
\&\fIBIO_set_conn_address()\fR, \fIBIO_get_conn_port()\fR, \fIBIO_get_conn_address()\fR,
|
||||
\&\fIBIO_set_conn_ip_family()\fR, \fIBIO_get_conn_ip_family()\fR,
|
||||
\&\fIBIO_set_nbio()\fR, and \fIBIO_do_connect()\fR are macros.
|
||||
\&\fBBIO_set_conn_hostname()\fR, \fBBIO_set_conn_port()\fR, \fBBIO_get_conn_hostname()\fR,
|
||||
\&\fBBIO_set_conn_address()\fR, \fBBIO_get_conn_port()\fR, \fBBIO_get_conn_address()\fR,
|
||||
\&\fBBIO_set_conn_ip_family()\fR, \fBBIO_get_conn_ip_family()\fR,
|
||||
\&\fBBIO_set_nbio()\fR, and \fBBIO_do_connect()\fR are macros.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_s_connect()\fR returns the connect \s-1BIO\s0 method.
|
||||
\&\fBBIO_s_connect()\fR returns the connect \s-1BIO\s0 method.
|
||||
.PP
|
||||
\&\fIBIO_get_fd()\fR returns the socket or \-1 if the \s-1BIO\s0 has not
|
||||
\&\fBBIO_get_fd()\fR returns the socket or \-1 if the \s-1BIO\s0 has not
|
||||
been initialized.
|
||||
.PP
|
||||
\&\fIBIO_set_conn_address()\fR, \fIBIO_set_conn_port()\fR, and \fIBIO_set_conn_ip_family()\fR
|
||||
\&\fBBIO_set_conn_address()\fR, \fBBIO_set_conn_port()\fR, and \fBBIO_set_conn_ip_family()\fR
|
||||
always return 1.
|
||||
.PP
|
||||
\&\fIBIO_set_conn_hostname()\fR returns 1 on success and 0 on failure.
|
||||
\&\fBBIO_set_conn_hostname()\fR returns 1 on success and 0 on failure.
|
||||
.PP
|
||||
\&\fIBIO_get_conn_address()\fR returns the address information or \s-1NULL\s0 if none
|
||||
\&\fBBIO_get_conn_address()\fR returns the address information or \s-1NULL\s0 if none
|
||||
was set.
|
||||
.PP
|
||||
\&\fIBIO_get_conn_hostname()\fR returns the connected hostname or \s-1NULL\s0 if
|
||||
\&\fBBIO_get_conn_hostname()\fR returns the connected hostname or \s-1NULL\s0 if
|
||||
none was set.
|
||||
.PP
|
||||
\&\fIBIO_get_conn_ip_family()\fR returns the address family or \-1 if none was set.
|
||||
\&\fBBIO_get_conn_ip_family()\fR returns the address family or \-1 if none was set.
|
||||
.PP
|
||||
\&\fIBIO_get_conn_port()\fR returns a string representing the connected
|
||||
\&\fBBIO_get_conn_port()\fR returns a string representing the connected
|
||||
port or \s-1NULL\s0 if not set.
|
||||
.PP
|
||||
\&\fIBIO_set_nbio()\fR always returns 1.
|
||||
\&\fBBIO_set_nbio()\fR always returns 1.
|
||||
.PP
|
||||
\&\fIBIO_do_connect()\fR returns 1 if the connection was successfully
|
||||
\&\fBBIO_do_connect()\fR returns 1 if the connection was successfully
|
||||
established and 0 or \-1 if the connection failed.
|
||||
.SH "EXAMPLE"
|
||||
.IX Header "EXAMPLE"
|
||||
|
@ -326,12 +330,12 @@ to retrieve a page and copy the result to standard output.
|
|||
.Ve
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\s-1\fIBIO_ADDR\s0\fR\|(3)
|
||||
\&\s-1\fBBIO_ADDR\s0\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBIO_set_conn_int_port()\fR, \fIBIO_get_conn_int_port()\fR, \fIBIO_set_conn_ip()\fR, and \fIBIO_get_conn_ip()\fR
|
||||
\&\fBBIO_set_conn_int_port()\fR, \fBBIO_get_conn_int_port()\fR, \fBBIO_set_conn_ip()\fR, and \fBBIO_get_conn_ip()\fR
|
||||
were removed in OpenSSL 1.1.0.
|
||||
Use \fIBIO_set_conn_address()\fR and \fIBIO_get_conn_address()\fR instead.
|
||||
Use \fBBIO_set_conn_address()\fR and \fBBIO_get_conn_address()\fR instead.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_s_fd.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_s_fd.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_s_fd 3"
|
||||
.TH BIO_s_fd 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_s_fd 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -154,53 +158,53 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_s_fd()\fR returns the file descriptor \s-1BIO\s0 method. This is a wrapper
|
||||
round the platforms file descriptor routines such as \fIread()\fR and \fIwrite()\fR.
|
||||
\&\fBBIO_s_fd()\fR returns the file descriptor \s-1BIO\s0 method. This is a wrapper
|
||||
round the platforms file descriptor routines such as \fBread()\fR and \fBwrite()\fR.
|
||||
.PP
|
||||
\&\fIBIO_read_ex()\fR and \fIBIO_write_ex()\fR read or write the underlying descriptor.
|
||||
\&\fIBIO_puts()\fR is supported but \fIBIO_gets()\fR is not.
|
||||
\&\fBBIO_read_ex()\fR and \fBBIO_write_ex()\fR read or write the underlying descriptor.
|
||||
\&\fBBIO_puts()\fR is supported but \fBBIO_gets()\fR is not.
|
||||
.PP
|
||||
If the close flag is set then \fIclose()\fR is called on the underlying
|
||||
If the close flag is set then \fBclose()\fR is called on the underlying
|
||||
file descriptor when the \s-1BIO\s0 is freed.
|
||||
.PP
|
||||
\&\fIBIO_reset()\fR attempts to change the file pointer to the start of file
|
||||
\&\fBBIO_reset()\fR attempts to change the file pointer to the start of file
|
||||
such as by using \fBlseek(fd, 0, 0)\fR.
|
||||
.PP
|
||||
\&\fIBIO_seek()\fR sets the file pointer to position \fBofs\fR from start of file
|
||||
\&\fBBIO_seek()\fR sets the file pointer to position \fBofs\fR from start of file
|
||||
such as by using \fBlseek(fd, ofs, 0)\fR.
|
||||
.PP
|
||||
\&\fIBIO_tell()\fR returns the current file position such as by calling
|
||||
\&\fBBIO_tell()\fR returns the current file position such as by calling
|
||||
\&\fBlseek(fd, 0, 1)\fR.
|
||||
.PP
|
||||
\&\fIBIO_set_fd()\fR sets the file descriptor of \s-1BIO \s0\fBb\fR to \fBfd\fR and the close
|
||||
\&\fBBIO_set_fd()\fR sets the file descriptor of \s-1BIO\s0 \fBb\fR to \fBfd\fR and the close
|
||||
flag to \fBc\fR.
|
||||
.PP
|
||||
\&\fIBIO_get_fd()\fR places the file descriptor in \fBc\fR if it is not \s-1NULL,\s0 it also
|
||||
\&\fBBIO_get_fd()\fR places the file descriptor in \fBc\fR if it is not \s-1NULL,\s0 it also
|
||||
returns the file descriptor.
|
||||
.PP
|
||||
\&\fIBIO_new_fd()\fR returns a file descriptor \s-1BIO\s0 using \fBfd\fR and \fBclose_flag\fR.
|
||||
\&\fBBIO_new_fd()\fR returns a file descriptor \s-1BIO\s0 using \fBfd\fR and \fBclose_flag\fR.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
The behaviour of \fIBIO_read_ex()\fR and \fIBIO_write_ex()\fR depends on the behavior of the
|
||||
platforms \fIread()\fR and \fIwrite()\fR calls on the descriptor. If the underlying
|
||||
The behaviour of \fBBIO_read_ex()\fR and \fBBIO_write_ex()\fR depends on the behavior of the
|
||||
platforms \fBread()\fR and \fBwrite()\fR calls on the descriptor. If the underlying
|
||||
file descriptor is in a non blocking mode then the \s-1BIO\s0 will behave in the
|
||||
manner described in the \fIBIO_read_ex\fR\|(3) and \fIBIO_should_retry\fR\|(3)
|
||||
manner described in the \fBBIO_read_ex\fR\|(3) and \fBBIO_should_retry\fR\|(3)
|
||||
manual pages.
|
||||
.PP
|
||||
File descriptor BIOs should not be used for socket I/O. Use socket BIOs
|
||||
instead.
|
||||
.PP
|
||||
\&\fIBIO_set_fd()\fR and \fIBIO_get_fd()\fR are implemented as macros.
|
||||
\&\fBBIO_set_fd()\fR and \fBBIO_get_fd()\fR are implemented as macros.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_s_fd()\fR returns the file descriptor \s-1BIO\s0 method.
|
||||
\&\fBBIO_s_fd()\fR returns the file descriptor \s-1BIO\s0 method.
|
||||
.PP
|
||||
\&\fIBIO_set_fd()\fR always returns 1.
|
||||
\&\fBBIO_set_fd()\fR always returns 1.
|
||||
.PP
|
||||
\&\fIBIO_get_fd()\fR returns the file descriptor or \-1 if the \s-1BIO\s0 has not
|
||||
\&\fBBIO_get_fd()\fR returns the file descriptor or \-1 if the \s-1BIO\s0 has not
|
||||
been initialized.
|
||||
.PP
|
||||
\&\fIBIO_new_fd()\fR returns the newly allocated \s-1BIO\s0 or \s-1NULL\s0 is an error
|
||||
\&\fBBIO_new_fd()\fR returns the newly allocated \s-1BIO\s0 or \s-1NULL\s0 is an error
|
||||
occurred.
|
||||
.SH "EXAMPLE"
|
||||
.IX Header "EXAMPLE"
|
||||
|
@ -215,11 +219,11 @@ This is a file descriptor \s-1BIO\s0 version of \*(L"Hello World\*(R":
|
|||
.Ve
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIBIO_seek\fR\|(3), \fIBIO_tell\fR\|(3),
|
||||
\&\fIBIO_reset\fR\|(3), \fIBIO_read_ex\fR\|(3),
|
||||
\&\fIBIO_write_ex\fR\|(3), \fIBIO_puts\fR\|(3),
|
||||
\&\fIBIO_gets\fR\|(3), \fIBIO_printf\fR\|(3),
|
||||
\&\fIBIO_set_close\fR\|(3), \fIBIO_get_close\fR\|(3)
|
||||
\&\fBBIO_seek\fR\|(3), \fBBIO_tell\fR\|(3),
|
||||
\&\fBBIO_reset\fR\|(3), \fBBIO_read_ex\fR\|(3),
|
||||
\&\fBBIO_write_ex\fR\|(3), \fBBIO_puts\fR\|(3),
|
||||
\&\fBBIO_gets\fR\|(3), \fBBIO_printf\fR\|(3),
|
||||
\&\fBBIO_set_close\fR\|(3), \fBBIO_get_close\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_s_file.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_s_file.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_s_file 3"
|
||||
.TH BIO_s_file 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_s_file 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -161,48 +165,48 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_s_file()\fR returns the \s-1BIO\s0 file method. As its name implies it
|
||||
\&\fBBIO_s_file()\fR returns the \s-1BIO\s0 file method. As its name implies it
|
||||
is a wrapper round the stdio \s-1FILE\s0 structure and it is a
|
||||
source/sink \s-1BIO.\s0
|
||||
.PP
|
||||
Calls to \fIBIO_read_ex()\fR and \fIBIO_write_ex()\fR read and write data to the
|
||||
underlying stream. \fIBIO_gets()\fR and \fIBIO_puts()\fR are supported on file BIOs.
|
||||
Calls to \fBBIO_read_ex()\fR and \fBBIO_write_ex()\fR read and write data to the
|
||||
underlying stream. \fBBIO_gets()\fR and \fBBIO_puts()\fR are supported on file BIOs.
|
||||
.PP
|
||||
\&\fIBIO_flush()\fR on a file \s-1BIO\s0 calls the \fIfflush()\fR function on the wrapped
|
||||
\&\fBBIO_flush()\fR on a file \s-1BIO\s0 calls the \fBfflush()\fR function on the wrapped
|
||||
stream.
|
||||
.PP
|
||||
\&\fIBIO_reset()\fR attempts to change the file pointer to the start of file
|
||||
\&\fBBIO_reset()\fR attempts to change the file pointer to the start of file
|
||||
using fseek(stream, 0, 0).
|
||||
.PP
|
||||
\&\fIBIO_seek()\fR sets the file pointer to position \fBofs\fR from start of file
|
||||
\&\fBBIO_seek()\fR sets the file pointer to position \fBofs\fR from start of file
|
||||
using fseek(stream, ofs, 0).
|
||||
.PP
|
||||
\&\fIBIO_eof()\fR calls \fIfeof()\fR.
|
||||
\&\fBBIO_eof()\fR calls \fBfeof()\fR.
|
||||
.PP
|
||||
Setting the \s-1BIO_CLOSE\s0 flag calls \fIfclose()\fR on the stream when the \s-1BIO\s0
|
||||
Setting the \s-1BIO_CLOSE\s0 flag calls \fBfclose()\fR on the stream when the \s-1BIO\s0
|
||||
is freed.
|
||||
.PP
|
||||
\&\fIBIO_new_file()\fR creates a new file \s-1BIO\s0 with mode \fBmode\fR the meaning
|
||||
of \fBmode\fR is the same as the stdio function \fIfopen()\fR. The \s-1BIO_CLOSE\s0
|
||||
\&\fBBIO_new_file()\fR creates a new file \s-1BIO\s0 with mode \fBmode\fR the meaning
|
||||
of \fBmode\fR is the same as the stdio function \fBfopen()\fR. The \s-1BIO_CLOSE\s0
|
||||
flag is set on the returned \s-1BIO.\s0
|
||||
.PP
|
||||
\&\fIBIO_new_fp()\fR creates a file \s-1BIO\s0 wrapping \fBstream\fR. Flags can be:
|
||||
\&\s-1BIO_CLOSE, BIO_NOCLOSE \s0(the close flag) \s-1BIO_FP_TEXT \s0(sets the underlying
|
||||
\&\fBBIO_new_fp()\fR creates a file \s-1BIO\s0 wrapping \fBstream\fR. Flags can be:
|
||||
\&\s-1BIO_CLOSE, BIO_NOCLOSE\s0 (the close flag) \s-1BIO_FP_TEXT\s0 (sets the underlying
|
||||
stream to text mode, default is binary: this only has any effect under
|
||||
Win32).
|
||||
.PP
|
||||
\&\fIBIO_set_fp()\fR sets the fp of a file \s-1BIO\s0 to \fBfp\fR. \fBflags\fR has the same
|
||||
meaning as in \fIBIO_new_fp()\fR, it is a macro.
|
||||
\&\fBBIO_set_fp()\fR sets the fp of a file \s-1BIO\s0 to \fBfp\fR. \fBflags\fR has the same
|
||||
meaning as in \fBBIO_new_fp()\fR, it is a macro.
|
||||
.PP
|
||||
\&\fIBIO_get_fp()\fR retrieves the fp of a file \s-1BIO,\s0 it is a macro.
|
||||
\&\fBBIO_get_fp()\fR retrieves the fp of a file \s-1BIO,\s0 it is a macro.
|
||||
.PP
|
||||
\&\fIBIO_seek()\fR is a macro that sets the position pointer to \fBoffset\fR bytes
|
||||
\&\fBBIO_seek()\fR is a macro that sets the position pointer to \fBoffset\fR bytes
|
||||
from the start of file.
|
||||
.PP
|
||||
\&\fIBIO_tell()\fR returns the value of the position pointer.
|
||||
\&\fBBIO_tell()\fR returns the value of the position pointer.
|
||||
.PP
|
||||
\&\fIBIO_read_filename()\fR, \fIBIO_write_filename()\fR, \fIBIO_append_filename()\fR and
|
||||
\&\fIBIO_rw_filename()\fR set the file \s-1BIO \s0\fBb\fR to use file \fBname\fR for
|
||||
\&\fBBIO_read_filename()\fR, \fBBIO_write_filename()\fR, \fBBIO_append_filename()\fR and
|
||||
\&\fBBIO_rw_filename()\fR set the file \s-1BIO\s0 \fBb\fR to use file \fBname\fR for
|
||||
reading, writing, append or read write respectively.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
|
@ -215,9 +219,26 @@ in stdio behaviour will be mirrored by the corresponding \s-1BIO.\s0
|
|||
On Windows BIO_new_files reserves for the filename argument to be
|
||||
\&\s-1UTF\-8\s0 encoded. In other words if you have to make it work in multi\-
|
||||
lingual environment, encode file names in \s-1UTF\-8.\s0
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fBBIO_s_file()\fR returns the file \s-1BIO\s0 method.
|
||||
.PP
|
||||
\&\fBBIO_new_file()\fR and \fBBIO_new_fp()\fR return a file \s-1BIO\s0 or \s-1NULL\s0 if an error
|
||||
occurred.
|
||||
.PP
|
||||
\&\fBBIO_set_fp()\fR and \fBBIO_get_fp()\fR return 1 for success or 0 for failure
|
||||
(although the current implementation never return 0).
|
||||
.PP
|
||||
\&\fBBIO_seek()\fR returns the same value as the underlying \fBfseek()\fR function:
|
||||
0 for success or \-1 for failure.
|
||||
.PP
|
||||
\&\fBBIO_tell()\fR returns the current file position.
|
||||
.PP
|
||||
\&\fBBIO_read_filename()\fR, \fBBIO_write_filename()\fR, \fBBIO_append_filename()\fR and
|
||||
\&\fBBIO_rw_filename()\fR return 1 for success or 0 for failure.
|
||||
.SH "EXAMPLES"
|
||||
.IX Header "EXAMPLES"
|
||||
File \s-1BIO \s0\*(L"hello world\*(R":
|
||||
File \s-1BIO\s0 \*(L"hello world\*(R":
|
||||
.PP
|
||||
.Vb 1
|
||||
\& BIO *bio_out;
|
||||
|
@ -264,40 +285,23 @@ Alternative technique:
|
|||
\& BIO_printf(out, "Hello World\en");
|
||||
\& BIO_free(out);
|
||||
.Ve
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_s_file()\fR returns the file \s-1BIO\s0 method.
|
||||
.PP
|
||||
\&\fIBIO_new_file()\fR and \fIBIO_new_fp()\fR return a file \s-1BIO\s0 or \s-1NULL\s0 if an error
|
||||
occurred.
|
||||
.PP
|
||||
\&\fIBIO_set_fp()\fR and \fIBIO_get_fp()\fR return 1 for success or 0 for failure
|
||||
(although the current implementation never return 0).
|
||||
.PP
|
||||
\&\fIBIO_seek()\fR returns the same value as the underlying \fIfseek()\fR function:
|
||||
0 for success or \-1 for failure.
|
||||
.PP
|
||||
\&\fIBIO_tell()\fR returns the current file position.
|
||||
.PP
|
||||
\&\fIBIO_read_filename()\fR, \fIBIO_write_filename()\fR, \fIBIO_append_filename()\fR and
|
||||
\&\fIBIO_rw_filename()\fR return 1 for success or 0 for failure.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
\&\fIBIO_reset()\fR and \fIBIO_seek()\fR are implemented using \fIfseek()\fR on the underlying
|
||||
stream. The return value for \fIfseek()\fR is 0 for success or \-1 if an error
|
||||
\&\fBBIO_reset()\fR and \fBBIO_seek()\fR are implemented using \fBfseek()\fR on the underlying
|
||||
stream. The return value for \fBfseek()\fR is 0 for success or \-1 if an error
|
||||
occurred this differs from other types of \s-1BIO\s0 which will typically return
|
||||
1 for success and a non positive value if an error occurred.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIBIO_seek\fR\|(3), \fIBIO_tell\fR\|(3),
|
||||
\&\fIBIO_reset\fR\|(3), \fIBIO_flush\fR\|(3),
|
||||
\&\fIBIO_read_ex\fR\|(3),
|
||||
\&\fIBIO_write_ex\fR\|(3), \fIBIO_puts\fR\|(3),
|
||||
\&\fIBIO_gets\fR\|(3), \fIBIO_printf\fR\|(3),
|
||||
\&\fIBIO_set_close\fR\|(3), \fIBIO_get_close\fR\|(3)
|
||||
\&\fBBIO_seek\fR\|(3), \fBBIO_tell\fR\|(3),
|
||||
\&\fBBIO_reset\fR\|(3), \fBBIO_flush\fR\|(3),
|
||||
\&\fBBIO_read_ex\fR\|(3),
|
||||
\&\fBBIO_write_ex\fR\|(3), \fBBIO_puts\fR\|(3),
|
||||
\&\fBBIO_gets\fR\|(3), \fBBIO_printf\fR\|(3),
|
||||
\&\fBBIO_set_close\fR\|(3), \fBBIO_get_close\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2000\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_s_mem.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_s_mem.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_s_mem 3"
|
||||
.TH BIO_s_mem 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_s_mem 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -159,51 +163,51 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_s_mem()\fR returns the memory \s-1BIO\s0 method function.
|
||||
\&\fBBIO_s_mem()\fR returns the memory \s-1BIO\s0 method function.
|
||||
.PP
|
||||
A memory \s-1BIO\s0 is a source/sink \s-1BIO\s0 which uses memory for its I/O. Data
|
||||
written to a memory \s-1BIO\s0 is stored in a \s-1BUF_MEM\s0 structure which is extended
|
||||
as appropriate to accommodate the stored data.
|
||||
.PP
|
||||
\&\fIBIO_s_secmem()\fR is like \fIBIO_s_mem()\fR except that the secure heap is used
|
||||
\&\fBBIO_s_secmem()\fR is like \fBBIO_s_mem()\fR except that the secure heap is used
|
||||
for buffer storage.
|
||||
.PP
|
||||
Any data written to a memory \s-1BIO\s0 can be recalled by reading from it.
|
||||
Unless the memory \s-1BIO\s0 is read only any data read from it is deleted from
|
||||
the \s-1BIO.\s0
|
||||
.PP
|
||||
Memory BIOs support \fIBIO_gets()\fR and \fIBIO_puts()\fR.
|
||||
Memory BIOs support \fBBIO_gets()\fR and \fBBIO_puts()\fR.
|
||||
.PP
|
||||
If the \s-1BIO_CLOSE\s0 flag is set when a memory \s-1BIO\s0 is freed then the underlying
|
||||
\&\s-1BUF_MEM\s0 structure is also freed.
|
||||
.PP
|
||||
Calling \fIBIO_reset()\fR on a read write memory \s-1BIO\s0 clears any data in it if the
|
||||
Calling \fBBIO_reset()\fR on a read write memory \s-1BIO\s0 clears any data in it if the
|
||||
flag \s-1BIO_FLAGS_NONCLEAR_RST\s0 is not set. On a read only \s-1BIO\s0 or if the flag
|
||||
\&\s-1BIO_FLAGS_NONCLEAR_RST\s0 is set it restores the \s-1BIO\s0 to its original state and
|
||||
the data can be read again.
|
||||
.PP
|
||||
\&\fIBIO_eof()\fR is true if no data is in the \s-1BIO.\s0
|
||||
\&\fBBIO_eof()\fR is true if no data is in the \s-1BIO.\s0
|
||||
.PP
|
||||
\&\fIBIO_ctrl_pending()\fR returns the number of bytes currently stored.
|
||||
\&\fBBIO_ctrl_pending()\fR returns the number of bytes currently stored.
|
||||
.PP
|
||||
\&\fIBIO_set_mem_eof_return()\fR sets the behaviour of memory \s-1BIO \s0\fBb\fR when it is
|
||||
empty. If the \fBv\fR is zero then an empty memory \s-1BIO\s0 will return \s-1EOF \s0(that is
|
||||
\&\fBBIO_set_mem_eof_return()\fR sets the behaviour of memory \s-1BIO\s0 \fBb\fR when it is
|
||||
empty. If the \fBv\fR is zero then an empty memory \s-1BIO\s0 will return \s-1EOF\s0 (that is
|
||||
it will return zero and BIO_should_retry(b) will be false. If \fBv\fR is non
|
||||
zero then it will return \fBv\fR when it is empty and it will set the read retry
|
||||
flag (that is BIO_read_retry(b) is true). To avoid ambiguity with a normal
|
||||
positive return value \fBv\fR should be set to a negative value, typically \-1.
|
||||
.PP
|
||||
\&\fIBIO_get_mem_data()\fR sets *\fBpp\fR to a pointer to the start of the memory BIOs data
|
||||
\&\fBBIO_get_mem_data()\fR sets *\fBpp\fR to a pointer to the start of the memory BIOs data
|
||||
and returns the total amount of data available. It is implemented as a macro.
|
||||
.PP
|
||||
\&\fIBIO_set_mem_buf()\fR sets the internal \s-1BUF_MEM\s0 structure to \fBbm\fR and sets the
|
||||
\&\fBBIO_set_mem_buf()\fR sets the internal \s-1BUF_MEM\s0 structure to \fBbm\fR and sets the
|
||||
close flag to \fBc\fR, that is \fBc\fR should be either \s-1BIO_CLOSE\s0 or \s-1BIO_NOCLOSE.\s0
|
||||
It is a macro.
|
||||
.PP
|
||||
\&\fIBIO_get_mem_ptr()\fR places the underlying \s-1BUF_MEM\s0 structure in *\fBpp\fR. It is
|
||||
\&\fBBIO_get_mem_ptr()\fR places the underlying \s-1BUF_MEM\s0 structure in *\fBpp\fR. It is
|
||||
a macro.
|
||||
.PP
|
||||
\&\fIBIO_new_mem_buf()\fR creates a memory \s-1BIO\s0 using \fBlen\fR bytes of data at \fBbuf\fR,
|
||||
\&\fBBIO_new_mem_buf()\fR creates a memory \s-1BIO\s0 using \fBlen\fR bytes of data at \fBbuf\fR,
|
||||
if \fBlen\fR is \-1 then the \fBbuf\fR is assumed to be nul terminated and its
|
||||
length is determined by \fBstrlen\fR. The \s-1BIO\s0 is set to a read only state and
|
||||
as a result cannot be written to. This is useful when some data needs to be
|
||||
|
@ -221,8 +225,24 @@ read in small chunks the operation can be very slow. The use of a read only
|
|||
memory \s-1BIO\s0 avoids this problem. If the \s-1BIO\s0 must be read write then adding
|
||||
a buffering \s-1BIO\s0 to the chain will speed up the process.
|
||||
.PP
|
||||
Calling \fIBIO_set_mem_buf()\fR on a \s-1BIO\s0 created with \fIBIO_new_secmem()\fR will
|
||||
Calling \fBBIO_set_mem_buf()\fR on a \s-1BIO\s0 created with \fBBIO_new_secmem()\fR will
|
||||
give undefined results, including perhaps a program crash.
|
||||
.PP
|
||||
Switching the memory \s-1BIO\s0 from read write to read only is not supported and
|
||||
can give undefined results including a program crash. There are two notable
|
||||
exceptions to the rule. The first one is to assign a static memory buffer
|
||||
immediately after \s-1BIO\s0 creation and set the \s-1BIO\s0 as read only.
|
||||
.PP
|
||||
The other supported sequence is to start with read write \s-1BIO\s0 then temporarily
|
||||
switch it to read only and call \fBBIO_reset()\fR on the read only \s-1BIO\s0 immediately
|
||||
before switching it back to read write. Before the \s-1BIO\s0 is freed it must be
|
||||
switched back to the read write mode.
|
||||
.PP
|
||||
Calling \fBBIO_get_mem_ptr()\fR on read only \s-1BIO\s0 will return a \s-1BUF_MEM\s0 that
|
||||
contains only the remaining data to be read. If the close status of the
|
||||
\&\s-1BIO\s0 is set to \s-1BIO_NOCLOSE,\s0 before freeing the \s-1BUF_MEM\s0 the data pointer
|
||||
in it must be set to \s-1NULL\s0 as the data pointer does not point to an
|
||||
allocated memory.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
There should be an option to set the maximum size of a memory \s-1BIO.\s0
|
||||
|
@ -254,15 +274,15 @@ Extract the \s-1BUF_MEM\s0 structure from a memory \s-1BIO\s0 and then free up t
|
|||
.Ve
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_s_mem()\fR and \fIBIO_s_secmem()\fR return a valid memory \fB\s-1BIO_METHOD\s0\fR structure.
|
||||
\&\fBBIO_s_mem()\fR and \fBBIO_s_secmem()\fR return a valid memory \fB\s-1BIO_METHOD\s0\fR structure.
|
||||
.PP
|
||||
\&\fIBIO_set_mem_eof_return()\fR, \fIBIO_get_mem_data()\fR, \fIBIO_set_mem_buf()\fR and \fIBIO_get_mem_ptr()\fR
|
||||
\&\fBBIO_set_mem_eof_return()\fR, \fBBIO_get_mem_data()\fR, \fBBIO_set_mem_buf()\fR and \fBBIO_get_mem_ptr()\fR
|
||||
return 1 on success or a value which is less than or equal to 0 if an error occurred.
|
||||
.PP
|
||||
\&\fIBIO_new_mem_buf()\fR returns a valid \fB\s-1BIO\s0\fR structure on success or \s-1NULL\s0 on error.
|
||||
\&\fBBIO_new_mem_buf()\fR returns a valid \fB\s-1BIO\s0\fR structure on success or \s-1NULL\s0 on error.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2000\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_s_null.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_s_null.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_s_null 3"
|
||||
.TH BIO_s_null 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_s_null 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -149,7 +153,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_s_null()\fR returns the null sink \s-1BIO\s0 method. Data written to
|
||||
\&\fBBIO_s_null()\fR returns the null sink \s-1BIO\s0 method. Data written to
|
||||
the null sink is discarded, reads return \s-1EOF.\s0
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
|
@ -165,7 +169,7 @@ Since a \s-1BIO\s0 chain must normally include a source/sink \s-1BIO\s0 this can
|
|||
by adding a null sink \s-1BIO\s0 to the end of the chain
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_s_null()\fR returns the null sink \s-1BIO\s0 method.
|
||||
\&\fBBIO_s_null()\fR returns the null sink \s-1BIO\s0 method.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_s_socket.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_s_socket.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_s_socket 3"
|
||||
.TH BIO_s_socket 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_s_socket 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -151,16 +155,16 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_s_socket()\fR returns the socket \s-1BIO\s0 method. This is a wrapper
|
||||
\&\fBBIO_s_socket()\fR returns the socket \s-1BIO\s0 method. This is a wrapper
|
||||
round the platform's socket routines.
|
||||
.PP
|
||||
\&\fIBIO_read_ex()\fR and \fIBIO_write_ex()\fR read or write the underlying socket.
|
||||
\&\fIBIO_puts()\fR is supported but \fIBIO_gets()\fR is not.
|
||||
\&\fBBIO_read_ex()\fR and \fBBIO_write_ex()\fR read or write the underlying socket.
|
||||
\&\fBBIO_puts()\fR is supported but \fBBIO_gets()\fR is not.
|
||||
.PP
|
||||
If the close flag is set then the socket is shut down and closed
|
||||
when the \s-1BIO\s0 is freed.
|
||||
.PP
|
||||
\&\fIBIO_new_socket()\fR returns a socket \s-1BIO\s0 using \fBsock\fR and \fBclose_flag\fR.
|
||||
\&\fBBIO_new_socket()\fR returns a socket \s-1BIO\s0 using \fBsock\fR and \fBclose_flag\fR.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
Socket BIOs also support any relevant functionality of file descriptor
|
||||
|
@ -172,9 +176,9 @@ Windows is one such platform. Any code mixing the two will not work on
|
|||
all platforms.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_s_socket()\fR returns the socket \s-1BIO\s0 method.
|
||||
\&\fBBIO_s_socket()\fR returns the socket \s-1BIO\s0 method.
|
||||
.PP
|
||||
\&\fIBIO_new_socket()\fR returns the newly allocated \s-1BIO\s0 or \s-1NULL\s0 is an error
|
||||
\&\fBBIO_new_socket()\fR returns the newly allocated \s-1BIO\s0 or \s-1NULL\s0 is an error
|
||||
occurred.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_set_callback.3,v 1.18 2018/09/23 13:33:05 christos Exp $
|
||||
.\" $NetBSD: BIO_set_callback.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_set_callback 3"
|
||||
.TH BIO_set_callback 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_set_callback 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -167,25 +171,25 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBIO_set_callback_ex()\fR and \fIBIO_get_callback_ex()\fR set and retrieve the \s-1BIO\s0
|
||||
\&\fBBIO_set_callback_ex()\fR and \fBBIO_get_callback_ex()\fR set and retrieve the \s-1BIO\s0
|
||||
callback. The callback is called during most high level \s-1BIO\s0 operations. It can
|
||||
be used for debugging purposes to trace operations on a \s-1BIO\s0 or to modify its
|
||||
operation.
|
||||
.PP
|
||||
\&\fIBIO_set_callback()\fR and \fIBIO_get_callback()\fR set and retrieve the old format \s-1BIO\s0
|
||||
\&\fBBIO_set_callback()\fR and \fBBIO_get_callback()\fR set and retrieve the old format \s-1BIO\s0
|
||||
callback. New code should not use these functions, but they are retained for
|
||||
backwards compatibility. Any callback set via \fIBIO_set_callback_ex()\fR will get
|
||||
called in preference to any set by \fIBIO_set_callback()\fR.
|
||||
backwards compatibility. Any callback set via \fBBIO_set_callback_ex()\fR will get
|
||||
called in preference to any set by \fBBIO_set_callback()\fR.
|
||||
.PP
|
||||
\&\fIBIO_set_callback_arg()\fR and \fIBIO_get_callback_arg()\fR are macros which can be
|
||||
\&\fBBIO_set_callback_arg()\fR and \fBBIO_get_callback_arg()\fR are macros which can be
|
||||
used to set and retrieve an argument for use in the callback.
|
||||
.PP
|
||||
\&\fIBIO_debug_callback()\fR is a standard debugging callback which prints
|
||||
\&\fBBIO_debug_callback()\fR is a standard debugging callback which prints
|
||||
out information relating to each \s-1BIO\s0 operation. If the callback
|
||||
argument is set it is interpreted as a \s-1BIO\s0 to send the information
|
||||
to, otherwise stderr is used.
|
||||
.PP
|
||||
\&\fIBIO_callback_fn_ex()\fR is the type of the callback function and \fIBIO_callback_fn()\fR
|
||||
\&\fBBIO_callback_fn_ex()\fR is the type of the callback function and \fBBIO_callback_fn()\fR
|
||||
is the type of the old format callback function. The meaning of each argument
|
||||
is described below:
|
||||
.IP "\fBb\fR" 4
|
||||
|
@ -372,18 +376,18 @@ argument of type \fBBIO_info_cb\fR itself. In this case \fBparg\fR is a pointer
|
|||
the actual call parameter, see \fBBIO_callback_ctrl\fR.
|
||||
.SH "EXAMPLE"
|
||||
.IX Header "EXAMPLE"
|
||||
The \fIBIO_debug_callback()\fR function is a good example, its source is
|
||||
The \fBBIO_debug_callback()\fR function is a good example, its source is
|
||||
in crypto/bio/bio_cb.c
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_get_callback_ex()\fR and \fIBIO_get_callback()\fR return the callback function
|
||||
previously set by a call to \fIBIO_set_callback_ex()\fR and \fIBIO_set_callback()\fR
|
||||
\&\fBBIO_get_callback_ex()\fR and \fBBIO_get_callback()\fR return the callback function
|
||||
previously set by a call to \fBBIO_set_callback_ex()\fR and \fBBIO_set_callback()\fR
|
||||
respectively.
|
||||
.PP
|
||||
\&\fIBIO_get_callback_arg()\fR returns a \fBchar\fR pointer to the value previously set
|
||||
via a call to \fIBIO_set_callback_arg()\fR.
|
||||
\&\fBBIO_get_callback_arg()\fR returns a \fBchar\fR pointer to the value previously set
|
||||
via a call to \fBBIO_set_callback_arg()\fR.
|
||||
.PP
|
||||
\&\fIBIO_debug_callback()\fR returns 1 or \fBret\fR if it's called after specific \s-1BIO\s0
|
||||
\&\fBBIO_debug_callback()\fR returns 1 or \fBret\fR if it's called after specific \s-1BIO\s0
|
||||
operations.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BIO_should_retry.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BIO_should_retry.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BIO_should_retry 3"
|
||||
.TH BIO_should_retry 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BIO_should_retry 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -161,50 +165,50 @@ libcrypto, -lcrypto
|
|||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
These functions determine why a \s-1BIO\s0 is not able to read or write data.
|
||||
They will typically be called after a failed \fIBIO_read_ex()\fR or \fIBIO_write_ex()\fR
|
||||
They will typically be called after a failed \fBBIO_read_ex()\fR or \fBBIO_write_ex()\fR
|
||||
call.
|
||||
.PP
|
||||
\&\fIBIO_should_retry()\fR is true if the call that produced this condition
|
||||
\&\fBBIO_should_retry()\fR is true if the call that produced this condition
|
||||
should then be retried at a later time.
|
||||
.PP
|
||||
If \fIBIO_should_retry()\fR is false then the cause is an error condition.
|
||||
If \fBBIO_should_retry()\fR is false then the cause is an error condition.
|
||||
.PP
|
||||
\&\fIBIO_should_read()\fR is true if the cause of the condition is that the \s-1BIO\s0
|
||||
\&\fBBIO_should_read()\fR is true if the cause of the condition is that the \s-1BIO\s0
|
||||
has insufficient data to return. Check for readability and/or retry the
|
||||
last operation.
|
||||
.PP
|
||||
\&\fIBIO_should_write()\fR is true if the cause of the condition is that the \s-1BIO\s0
|
||||
\&\fBBIO_should_write()\fR is true if the cause of the condition is that the \s-1BIO\s0
|
||||
has pending data to write. Check for writability and/or retry the
|
||||
last operation.
|
||||
.PP
|
||||
\&\fIBIO_should_io_special()\fR is true if some \*(L"special\*(R" condition, that is a
|
||||
\&\fBBIO_should_io_special()\fR is true if some \*(L"special\*(R" condition, that is a
|
||||
reason other than reading or writing is the cause of the condition.
|
||||
.PP
|
||||
\&\fIBIO_retry_type()\fR returns a mask of the cause of a retry condition
|
||||
\&\fBBIO_retry_type()\fR returns a mask of the cause of a retry condition
|
||||
consisting of the values \fB\s-1BIO_FLAGS_READ\s0\fR, \fB\s-1BIO_FLAGS_WRITE\s0\fR,
|
||||
\&\fB\s-1BIO_FLAGS_IO_SPECIAL\s0\fR though current \s-1BIO\s0 types will only set one of
|
||||
these.
|
||||
.PP
|
||||
\&\fIBIO_get_retry_BIO()\fR determines the precise reason for the special
|
||||
\&\fBBIO_get_retry_BIO()\fR determines the precise reason for the special
|
||||
condition, it returns the \s-1BIO\s0 that caused this condition and if
|
||||
\&\fBreason\fR is not \s-1NULL\s0 it contains the reason code. The meaning of
|
||||
the reason code and the action that should be taken depends on
|
||||
the type of \s-1BIO\s0 that resulted in this condition.
|
||||
.PP
|
||||
\&\fIBIO_get_retry_reason()\fR returns the reason for a special condition if
|
||||
passed the relevant \s-1BIO,\s0 for example as returned by \fIBIO_get_retry_BIO()\fR.
|
||||
\&\fBBIO_get_retry_reason()\fR returns the reason for a special condition if
|
||||
passed the relevant \s-1BIO,\s0 for example as returned by \fBBIO_get_retry_BIO()\fR.
|
||||
.PP
|
||||
\&\fIBIO_set_retry_reason()\fR sets the retry reason for a special condition for a given
|
||||
\&\fBBIO_set_retry_reason()\fR sets the retry reason for a special condition for a given
|
||||
\&\s-1BIO.\s0 This would usually only be called by \s-1BIO\s0 implementations.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
\&\fIBIO_should_read()\fR, \fIBIO_should_write()\fR, \fIBIO_should_io_special()\fR,
|
||||
\&\fIBIO_retry_type()\fR, and \fIBIO_should_retry()\fR, are implemented as macros.
|
||||
\&\fBBIO_should_read()\fR, \fBBIO_should_write()\fR, \fBBIO_should_io_special()\fR,
|
||||
\&\fBBIO_retry_type()\fR, and \fBBIO_should_retry()\fR, are implemented as macros.
|
||||
.PP
|
||||
If \fIBIO_should_retry()\fR returns false then the precise \*(L"error condition\*(R"
|
||||
If \fBBIO_should_retry()\fR returns false then the precise \*(L"error condition\*(R"
|
||||
depends on the \s-1BIO\s0 type that caused it and the return code of the \s-1BIO\s0
|
||||
operation. For example if a call to \fIBIO_read_ex()\fR on a socket \s-1BIO\s0 returns
|
||||
0 and \fIBIO_should_retry()\fR is false then the cause will be that the
|
||||
operation. For example if a call to \fBBIO_read_ex()\fR on a socket \s-1BIO\s0 returns
|
||||
0 and \fBBIO_should_retry()\fR is false then the cause will be that the
|
||||
connection closed. A similar condition on a file \s-1BIO\s0 will mean that it
|
||||
has reached \s-1EOF.\s0 Some \s-1BIO\s0 types may place additional information on
|
||||
the error queue. For more details see the individual \s-1BIO\s0 type manual
|
||||
|
@ -213,12 +217,12 @@ pages.
|
|||
If the underlying I/O structure is in a blocking mode almost all current
|
||||
\&\s-1BIO\s0 types will not request a retry, because the underlying I/O
|
||||
calls will not. If the application knows that the \s-1BIO\s0 type will never
|
||||
signal a retry then it need not call \fIBIO_should_retry()\fR after a failed
|
||||
signal a retry then it need not call \fBBIO_should_retry()\fR after a failed
|
||||
\&\s-1BIO I/O\s0 call. This is typically done with file BIOs.
|
||||
.PP
|
||||
\&\s-1SSL\s0 BIOs are the only current exception to this rule: they can request a
|
||||
retry even if the underlying I/O structure is blocking, if a handshake
|
||||
occurs during a call to \fIBIO_read()\fR. An application can retry the failed
|
||||
occurs during a call to \fBBIO_read()\fR. An application can retry the failed
|
||||
call immediately or avoid this situation by setting \s-1SSL_MODE_AUTO_RETRY\s0
|
||||
on the underlying \s-1SSL\s0 structure.
|
||||
.PP
|
||||
|
@ -228,10 +232,10 @@ repeatedly until data can be processed or is available. An application
|
|||
will normally wait until the necessary condition is satisfied. How
|
||||
this is done depends on the underlying I/O structure.
|
||||
.PP
|
||||
For example if the cause is ultimately a socket and \fIBIO_should_read()\fR
|
||||
is true then a call to \fIselect()\fR may be made to wait until data is
|
||||
For example if the cause is ultimately a socket and \fBBIO_should_read()\fR
|
||||
is true then a call to \fBselect()\fR may be made to wait until data is
|
||||
available and then retry the \s-1BIO\s0 operation. By combining the retry
|
||||
conditions of several non blocking BIOs in a single \fIselect()\fR call
|
||||
conditions of several non blocking BIOs in a single \fBselect()\fR call
|
||||
it is possible to service several BIOs in a single thread, though
|
||||
the performance may be poor if \s-1SSL\s0 BIOs are present because long delays
|
||||
can occur during the initial handshake process.
|
||||
|
@ -239,7 +243,7 @@ can occur during the initial handshake process.
|
|||
It is possible for a \s-1BIO\s0 to block indefinitely if the underlying I/O
|
||||
structure cannot process or return any data. This depends on the behaviour of
|
||||
the platforms I/O functions. This is often not desirable: one solution
|
||||
is to use non blocking I/O and use a timeout on the \fIselect()\fR (or
|
||||
is to use non blocking I/O and use a timeout on the \fBselect()\fR (or
|
||||
equivalent) call.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
|
@ -249,22 +253,22 @@ worked around by only passing the relevant data to \s-1ASN1\s0 functions when
|
|||
the entire structure can be read or written.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBIO_should_read()\fR, \fIBIO_should_write()\fR, \fIBIO_should_io_special()\fR, and
|
||||
\&\fIBIO_should_retry()\fR return either 1 or 0 based on the actual conditions
|
||||
\&\fBBIO_should_read()\fR, \fBBIO_should_write()\fR, \fBBIO_should_io_special()\fR, and
|
||||
\&\fBBIO_should_retry()\fR return either 1 or 0 based on the actual conditions
|
||||
of the \fB\s-1BIO\s0\fR.
|
||||
.PP
|
||||
\&\fIBIO_retry_type()\fR returns a flag combination presenting the cause of a retry
|
||||
\&\fBBIO_retry_type()\fR returns a flag combination presenting the cause of a retry
|
||||
condition or false if there is no retry condition.
|
||||
.PP
|
||||
\&\fIBIO_get_retry_BIO()\fR returns a valid \fB\s-1BIO\s0\fR structure.
|
||||
\&\fBBIO_get_retry_BIO()\fR returns a valid \fB\s-1BIO\s0\fR structure.
|
||||
.PP
|
||||
\&\fIBIO_get_retry_reason()\fR returns the reason for a special condition.
|
||||
\&\fBBIO_get_retry_reason()\fR returns the reason for a special condition.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
bio
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
The \fIBIO_get_retry_reason()\fR and \fIBIO_set_retry_reason()\fR functions were added in
|
||||
The \fBBIO_get_retry_reason()\fR and \fBBIO_set_retry_reason()\fR functions were added in
|
||||
OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_BLINDING_new.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_BLINDING_new.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_BLINDING_new 3"
|
||||
.TH BN_BLINDING_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_BLINDING_new 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -177,77 +181,77 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_BLINDING_new()\fR allocates a new \fB\s-1BN_BLINDING\s0\fR structure and copies
|
||||
\&\fBBN_BLINDING_new()\fR allocates a new \fB\s-1BN_BLINDING\s0\fR structure and copies
|
||||
the \fBA\fR and \fBAi\fR values into the newly created \fB\s-1BN_BLINDING\s0\fR object.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_free()\fR frees the \fB\s-1BN_BLINDING\s0\fR structure.
|
||||
\&\fBBN_BLINDING_free()\fR frees the \fB\s-1BN_BLINDING\s0\fR structure.
|
||||
If \fBb\fR is \s-1NULL,\s0 nothing is done.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_update()\fR updates the \fB\s-1BN_BLINDING\s0\fR parameters by squaring
|
||||
\&\fBBN_BLINDING_update()\fR updates the \fB\s-1BN_BLINDING\s0\fR parameters by squaring
|
||||
the \fBA\fR and \fBAi\fR or, after specific number of uses and if the
|
||||
necessary parameters are set, by re-creating the blinding parameters.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_convert_ex()\fR multiplies \fBn\fR with the blinding factor \fBA\fR.
|
||||
\&\fBBN_BLINDING_convert_ex()\fR multiplies \fBn\fR with the blinding factor \fBA\fR.
|
||||
If \fBr\fR is not \s-1NULL\s0 a copy the inverse blinding factor \fBAi\fR will be
|
||||
returned in \fBr\fR (this is useful if a \fB\s-1RSA\s0\fR object is shared among
|
||||
several threads). \fIBN_BLINDING_invert_ex()\fR multiplies \fBn\fR with the
|
||||
several threads). \fBBN_BLINDING_invert_ex()\fR multiplies \fBn\fR with the
|
||||
inverse blinding factor \fBAi\fR. If \fBr\fR is not \s-1NULL\s0 it will be used as
|
||||
the inverse blinding.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_convert()\fR and \fIBN_BLINDING_invert()\fR are wrapper
|
||||
functions for \fIBN_BLINDING_convert_ex()\fR and \fIBN_BLINDING_invert_ex()\fR
|
||||
\&\fBBN_BLINDING_convert()\fR and \fBBN_BLINDING_invert()\fR are wrapper
|
||||
functions for \fBBN_BLINDING_convert_ex()\fR and \fBBN_BLINDING_invert_ex()\fR
|
||||
with \fBr\fR set to \s-1NULL.\s0
|
||||
.PP
|
||||
\&\fIBN_BLINDING_is_current_thread()\fR returns whether the \fB\s-1BN_BLINDING\s0\fR
|
||||
\&\fBBN_BLINDING_is_current_thread()\fR returns whether the \fB\s-1BN_BLINDING\s0\fR
|
||||
structure is owned by the current thread. This is to help users
|
||||
provide proper locking if needed for multi-threaded use.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_set_current_thread()\fR sets the current thread as the
|
||||
\&\fBBN_BLINDING_set_current_thread()\fR sets the current thread as the
|
||||
owner of the \fB\s-1BN_BLINDING\s0\fR structure.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_lock()\fR locks the \fB\s-1BN_BLINDING\s0\fR structure.
|
||||
\&\fBBN_BLINDING_lock()\fR locks the \fB\s-1BN_BLINDING\s0\fR structure.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_unlock()\fR unlocks the \fB\s-1BN_BLINDING\s0\fR structure.
|
||||
\&\fBBN_BLINDING_unlock()\fR unlocks the \fB\s-1BN_BLINDING\s0\fR structure.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_get_flags()\fR returns the \s-1BN_BLINDING\s0 flags. Currently
|
||||
\&\fBBN_BLINDING_get_flags()\fR returns the \s-1BN_BLINDING\s0 flags. Currently
|
||||
there are two supported flags: \fB\s-1BN_BLINDING_NO_UPDATE\s0\fR and
|
||||
\&\fB\s-1BN_BLINDING_NO_RECREATE\s0\fR. \fB\s-1BN_BLINDING_NO_UPDATE\s0\fR inhibits the
|
||||
automatic update of the \fB\s-1BN_BLINDING\s0\fR parameters after each use
|
||||
and \fB\s-1BN_BLINDING_NO_RECREATE\s0\fR inhibits the automatic re-creation
|
||||
of the \fB\s-1BN_BLINDING\s0\fR parameters after a fixed number of uses (currently
|
||||
32). In newly allocated \fB\s-1BN_BLINDING\s0\fR objects no flags are set.
|
||||
\&\fIBN_BLINDING_set_flags()\fR sets the \fB\s-1BN_BLINDING\s0\fR parameters flags.
|
||||
\&\fBBN_BLINDING_set_flags()\fR sets the \fB\s-1BN_BLINDING\s0\fR parameters flags.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_create_param()\fR creates new \fB\s-1BN_BLINDING\s0\fR parameters
|
||||
\&\fBBN_BLINDING_create_param()\fR creates new \fB\s-1BN_BLINDING\s0\fR parameters
|
||||
using the exponent \fBe\fR and the modulus \fBm\fR. \fBbn_mod_exp\fR and
|
||||
\&\fBm_ctx\fR can be used to pass special functions for exponentiation
|
||||
(normally \fIBN_mod_exp_mont()\fR and \fB\s-1BN_MONT_CTX\s0\fR).
|
||||
(normally \fBBN_mod_exp_mont()\fR and \fB\s-1BN_MONT_CTX\s0\fR).
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_BLINDING_new()\fR returns the newly allocated \fB\s-1BN_BLINDING\s0\fR structure
|
||||
\&\fBBN_BLINDING_new()\fR returns the newly allocated \fB\s-1BN_BLINDING\s0\fR structure
|
||||
or \s-1NULL\s0 in case of an error.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_update()\fR, \fIBN_BLINDING_convert()\fR, \fIBN_BLINDING_invert()\fR,
|
||||
\&\fIBN_BLINDING_convert_ex()\fR and \fIBN_BLINDING_invert_ex()\fR return 1 on
|
||||
\&\fBBN_BLINDING_update()\fR, \fBBN_BLINDING_convert()\fR, \fBBN_BLINDING_invert()\fR,
|
||||
\&\fBBN_BLINDING_convert_ex()\fR and \fBBN_BLINDING_invert_ex()\fR return 1 on
|
||||
success and 0 if an error occurred.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_is_current_thread()\fR returns 1 if the current thread owns
|
||||
\&\fBBN_BLINDING_is_current_thread()\fR returns 1 if the current thread owns
|
||||
the \fB\s-1BN_BLINDING\s0\fR object, 0 otherwise.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_set_current_thread()\fR doesn't return anything.
|
||||
\&\fBBN_BLINDING_set_current_thread()\fR doesn't return anything.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_lock()\fR, \fIBN_BLINDING_unlock()\fR return 1 if the operation
|
||||
\&\fBBN_BLINDING_lock()\fR, \fBBN_BLINDING_unlock()\fR return 1 if the operation
|
||||
succeeded or 0 on error.
|
||||
.PP
|
||||
\&\fIBN_BLINDING_get_flags()\fR returns the currently set \fB\s-1BN_BLINDING\s0\fR flags
|
||||
\&\fBBN_BLINDING_get_flags()\fR returns the currently set \fB\s-1BN_BLINDING\s0\fR flags
|
||||
(a \fBunsigned long\fR value).
|
||||
.PP
|
||||
\&\fIBN_BLINDING_create_param()\fR returns the newly created \fB\s-1BN_BLINDING\s0\fR
|
||||
\&\fBBN_BLINDING_create_param()\fR returns the newly created \fB\s-1BN_BLINDING\s0\fR
|
||||
parameters or \s-1NULL\s0 on error.
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBN_BLINDING_thread_id()\fR was first introduced in OpenSSL 1.0.0, and it
|
||||
deprecates \fIBN_BLINDING_set_thread_id()\fR and \fIBN_BLINDING_get_thread_id()\fR.
|
||||
\&\fBBN_BLINDING_thread_id()\fR was first introduced in OpenSSL 1.0.0, and it
|
||||
deprecates \fBBN_BLINDING_set_thread_id()\fR and \fBBN_BLINDING_get_thread_id()\fR.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2005\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_CTX_new.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_CTX_new.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_CTX_new 3"
|
||||
.TH BN_CTX_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_CTX_new 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -158,34 +162,34 @@ library functions. Since dynamic memory allocation to create \fB\s-1BIGNUM\s0\fR
|
|||
is rather expensive when used in conjunction with repeated subroutine
|
||||
calls, the \fB\s-1BN_CTX\s0\fR structure is used.
|
||||
.PP
|
||||
\&\fIBN_CTX_new()\fR allocates and initializes a \fB\s-1BN_CTX\s0\fR structure.
|
||||
\&\fIBN_CTX_secure_new()\fR allocates and initializes a \fB\s-1BN_CTX\s0\fR structure
|
||||
but uses the secure heap (see \fICRYPTO_secure_malloc\fR\|(3)) to hold the
|
||||
\&\fBBN_CTX_new()\fR allocates and initializes a \fB\s-1BN_CTX\s0\fR structure.
|
||||
\&\fBBN_CTX_secure_new()\fR allocates and initializes a \fB\s-1BN_CTX\s0\fR structure
|
||||
but uses the secure heap (see \fBCRYPTO_secure_malloc\fR\|(3)) to hold the
|
||||
\&\fB\s-1BIGNUM\s0\fRs.
|
||||
.PP
|
||||
\&\fIBN_CTX_free()\fR frees the components of the \fB\s-1BN_CTX\s0\fR and the structure itself.
|
||||
Since \fIBN_CTX_start()\fR is required in order to obtain \fB\s-1BIGNUM\s0\fRs from the
|
||||
\&\fB\s-1BN_CTX\s0\fR, in most cases \fIBN_CTX_end()\fR must be called before the \fB\s-1BN_CTX\s0\fR may
|
||||
be freed by \fIBN_CTX_free()\fR. If \fBc\fR is \s-1NULL,\s0 nothing is done.
|
||||
\&\fBBN_CTX_free()\fR frees the components of the \fB\s-1BN_CTX\s0\fR and the structure itself.
|
||||
Since \fBBN_CTX_start()\fR is required in order to obtain \fB\s-1BIGNUM\s0\fRs from the
|
||||
\&\fB\s-1BN_CTX\s0\fR, in most cases \fBBN_CTX_end()\fR must be called before the \fB\s-1BN_CTX\s0\fR may
|
||||
be freed by \fBBN_CTX_free()\fR. If \fBc\fR is \s-1NULL,\s0 nothing is done.
|
||||
.PP
|
||||
A given \fB\s-1BN_CTX\s0\fR must only be used by a single thread of execution. No
|
||||
locking is performed, and the internal pool allocator will not properly handle
|
||||
multiple threads of execution.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_CTX_new()\fR and \fIBN_CTX_secure_new()\fR return a pointer to the \fB\s-1BN_CTX\s0\fR.
|
||||
\&\fBBN_CTX_new()\fR and \fBBN_CTX_secure_new()\fR return a pointer to the \fB\s-1BN_CTX\s0\fR.
|
||||
If the allocation fails,
|
||||
they return \fB\s-1NULL\s0\fR and sets an error code that can be obtained by
|
||||
\&\fIERR_get_error\fR\|(3).
|
||||
\&\fBERR_get_error\fR\|(3).
|
||||
.PP
|
||||
\&\fIBN_CTX_free()\fR has no return values.
|
||||
\&\fBBN_CTX_free()\fR has no return values.
|
||||
.SH "REMOVED FUNCTIONALITY"
|
||||
.IX Header "REMOVED FUNCTIONALITY"
|
||||
.Vb 1
|
||||
\& void BN_CTX_init(BN_CTX *c);
|
||||
.Ve
|
||||
.PP
|
||||
\&\fIBN_CTX_init()\fR is no longer available as of OpenSSL 1.1.0. Applications should
|
||||
\&\fBBN_CTX_init()\fR is no longer available as of OpenSSL 1.1.0. Applications should
|
||||
replace use of BN_CTX_init with BN_CTX_new instead:
|
||||
.PP
|
||||
.Vb 6
|
||||
|
@ -198,11 +202,11 @@ replace use of BN_CTX_init with BN_CTX_new instead:
|
|||
.Ve
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fIBN_add\fR\|(3),
|
||||
\&\fIBN_CTX_start\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBBN_add\fR\|(3),
|
||||
\&\fBBN_CTX_start\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBN_CTX_init()\fR was removed in OpenSSL 1.1.0.
|
||||
\&\fBBN_CTX_init()\fR was removed in OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_CTX_start.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_CTX_start.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_CTX_start 3"
|
||||
.TH BN_CTX_start 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_CTX_start 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -154,33 +158,34 @@ libcrypto, -lcrypto
|
|||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
These functions are used to obtain temporary \fB\s-1BIGNUM\s0\fR variables from
|
||||
a \fB\s-1BN_CTX\s0\fR (which can been created by using \fIBN_CTX_new\fR\|(3))
|
||||
a \fB\s-1BN_CTX\s0\fR (which can been created by using \fBBN_CTX_new\fR\|(3))
|
||||
in order to save the overhead of repeatedly creating and
|
||||
freeing \fB\s-1BIGNUM\s0\fRs in functions that are called from inside a loop.
|
||||
.PP
|
||||
A function must call \fIBN_CTX_start()\fR first. Then, \fIBN_CTX_get()\fR may be
|
||||
called repeatedly to obtain temporary \fB\s-1BIGNUM\s0\fRs. All \fIBN_CTX_get()\fR
|
||||
A function must call \fBBN_CTX_start()\fR first. Then, \fBBN_CTX_get()\fR may be
|
||||
called repeatedly to obtain temporary \fB\s-1BIGNUM\s0\fRs. All \fBBN_CTX_get()\fR
|
||||
calls must be made before calling any other functions that use the
|
||||
\&\fBctx\fR as an argument.
|
||||
.PP
|
||||
Finally, \fIBN_CTX_end()\fR must be called before returning from the function.
|
||||
When \fIBN_CTX_end()\fR is called, the \fB\s-1BIGNUM\s0\fR pointers obtained from
|
||||
\&\fIBN_CTX_get()\fR become invalid.
|
||||
Finally, \fBBN_CTX_end()\fR must be called before returning from the function.
|
||||
If \fBctx\fR is \s-1NULL,\s0 nothing is done.
|
||||
When \fBBN_CTX_end()\fR is called, the \fB\s-1BIGNUM\s0\fR pointers obtained from
|
||||
\&\fBBN_CTX_get()\fR become invalid.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_CTX_start()\fR and \fIBN_CTX_end()\fR return no values.
|
||||
\&\fBBN_CTX_start()\fR and \fBBN_CTX_end()\fR return no values.
|
||||
.PP
|
||||
\&\fIBN_CTX_get()\fR returns a pointer to the \fB\s-1BIGNUM\s0\fR, or \fB\s-1NULL\s0\fR on error.
|
||||
Once \fIBN_CTX_get()\fR has failed, the subsequent calls will return \fB\s-1NULL\s0\fR
|
||||
\&\fBBN_CTX_get()\fR returns a pointer to the \fB\s-1BIGNUM\s0\fR, or \fB\s-1NULL\s0\fR on error.
|
||||
Once \fBBN_CTX_get()\fR has failed, the subsequent calls will return \fB\s-1NULL\s0\fR
|
||||
as well, so it is sufficient to check the return value of the last
|
||||
\&\fIBN_CTX_get()\fR call. In case of an error, an error code is set, which
|
||||
can be obtained by \fIERR_get_error\fR\|(3).
|
||||
\&\fBBN_CTX_get()\fR call. In case of an error, an error code is set, which
|
||||
can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIBN_CTX_new\fR\|(3)
|
||||
\&\fBBN_CTX_new\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2000\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_add.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_add.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_add 3"
|
||||
.TH BN_add 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_add 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -182,63 +186,63 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_add()\fR adds \fIa\fR and \fIb\fR and places the result in \fIr\fR (\f(CW\*(C`r=a+b\*(C'\fR).
|
||||
\&\fBBN_add()\fR adds \fIa\fR and \fIb\fR and places the result in \fIr\fR (\f(CW\*(C`r=a+b\*(C'\fR).
|
||||
\&\fIr\fR may be the same \fB\s-1BIGNUM\s0\fR as \fIa\fR or \fIb\fR.
|
||||
.PP
|
||||
\&\fIBN_sub()\fR subtracts \fIb\fR from \fIa\fR and places the result in \fIr\fR (\f(CW\*(C`r=a\-b\*(C'\fR).
|
||||
\&\fBBN_sub()\fR subtracts \fIb\fR from \fIa\fR and places the result in \fIr\fR (\f(CW\*(C`r=a\-b\*(C'\fR).
|
||||
\&\fIr\fR may be the same \fB\s-1BIGNUM\s0\fR as \fIa\fR or \fIb\fR.
|
||||
.PP
|
||||
\&\fIBN_mul()\fR multiplies \fIa\fR and \fIb\fR and places the result in \fIr\fR (\f(CW\*(C`r=a*b\*(C'\fR).
|
||||
\&\fBBN_mul()\fR multiplies \fIa\fR and \fIb\fR and places the result in \fIr\fR (\f(CW\*(C`r=a*b\*(C'\fR).
|
||||
\&\fIr\fR may be the same \fB\s-1BIGNUM\s0\fR as \fIa\fR or \fIb\fR.
|
||||
For multiplication by powers of 2, use \fIBN_lshift\fR\|(3).
|
||||
For multiplication by powers of 2, use \fBBN_lshift\fR\|(3).
|
||||
.PP
|
||||
\&\fIBN_sqr()\fR takes the square of \fIa\fR and places the result in \fIr\fR
|
||||
\&\fBBN_sqr()\fR takes the square of \fIa\fR and places the result in \fIr\fR
|
||||
(\f(CW\*(C`r=a^2\*(C'\fR). \fIr\fR and \fIa\fR may be the same \fB\s-1BIGNUM\s0\fR.
|
||||
This function is faster than BN_mul(r,a,a).
|
||||
.PP
|
||||
\&\fIBN_div()\fR divides \fIa\fR by \fId\fR and places the result in \fIdv\fR and the
|
||||
\&\fBBN_div()\fR divides \fIa\fR by \fId\fR and places the result in \fIdv\fR and the
|
||||
remainder in \fIrem\fR (\f(CW\*(C`dv=a/d, rem=a%d\*(C'\fR). Either of \fIdv\fR and \fIrem\fR may
|
||||
be \fB\s-1NULL\s0\fR, in which case the respective value is not returned.
|
||||
The result is rounded towards zero; thus if \fIa\fR is negative, the
|
||||
remainder will be zero or negative.
|
||||
For division by powers of 2, use \fIBN_rshift\fR\|(3).
|
||||
For division by powers of 2, use \fBBN_rshift\fR\|(3).
|
||||
.PP
|
||||
\&\fIBN_mod()\fR corresponds to \fIBN_div()\fR with \fIdv\fR set to \fB\s-1NULL\s0\fR.
|
||||
\&\fBBN_mod()\fR corresponds to \fBBN_div()\fR with \fIdv\fR set to \fB\s-1NULL\s0\fR.
|
||||
.PP
|
||||
\&\fIBN_nnmod()\fR reduces \fIa\fR modulo \fIm\fR and places the non-negative
|
||||
\&\fBBN_nnmod()\fR reduces \fIa\fR modulo \fIm\fR and places the non-negative
|
||||
remainder in \fIr\fR.
|
||||
.PP
|
||||
\&\fIBN_mod_add()\fR adds \fIa\fR to \fIb\fR modulo \fIm\fR and places the non-negative
|
||||
\&\fBBN_mod_add()\fR adds \fIa\fR to \fIb\fR modulo \fIm\fR and places the non-negative
|
||||
result in \fIr\fR.
|
||||
.PP
|
||||
\&\fIBN_mod_sub()\fR subtracts \fIb\fR from \fIa\fR modulo \fIm\fR and places the
|
||||
\&\fBBN_mod_sub()\fR subtracts \fIb\fR from \fIa\fR modulo \fIm\fR and places the
|
||||
non-negative result in \fIr\fR.
|
||||
.PP
|
||||
\&\fIBN_mod_mul()\fR multiplies \fIa\fR by \fIb\fR and finds the non-negative
|
||||
\&\fBBN_mod_mul()\fR multiplies \fIa\fR by \fIb\fR and finds the non-negative
|
||||
remainder respective to modulus \fIm\fR (\f(CW\*(C`r=(a*b) mod m\*(C'\fR). \fIr\fR may be
|
||||
the same \fB\s-1BIGNUM\s0\fR as \fIa\fR or \fIb\fR. For more efficient algorithms for
|
||||
repeated computations using the same modulus, see
|
||||
\&\fIBN_mod_mul_montgomery\fR\|(3) and
|
||||
\&\fIBN_mod_mul_reciprocal\fR\|(3).
|
||||
\&\fBBN_mod_mul_montgomery\fR\|(3) and
|
||||
\&\fBBN_mod_mul_reciprocal\fR\|(3).
|
||||
.PP
|
||||
\&\fIBN_mod_sqr()\fR takes the square of \fIa\fR modulo \fBm\fR and places the
|
||||
\&\fBBN_mod_sqr()\fR takes the square of \fIa\fR modulo \fBm\fR and places the
|
||||
result in \fIr\fR.
|
||||
.PP
|
||||
\&\fIBN_exp()\fR raises \fIa\fR to the \fIp\fR\-th power and places the result in \fIr\fR
|
||||
\&\fBBN_exp()\fR raises \fIa\fR to the \fIp\fR\-th power and places the result in \fIr\fR
|
||||
(\f(CW\*(C`r=a^p\*(C'\fR). This function is faster than repeated applications of
|
||||
\&\fIBN_mul()\fR.
|
||||
\&\fBBN_mul()\fR.
|
||||
.PP
|
||||
\&\fIBN_mod_exp()\fR computes \fIa\fR to the \fIp\fR\-th power modulo \fIm\fR (\f(CW\*(C`r=a^p %
|
||||
m\*(C'\fR). This function uses less time and space than \fIBN_exp()\fR. Do not call this
|
||||
\&\fBBN_mod_exp()\fR computes \fIa\fR to the \fIp\fR\-th power modulo \fIm\fR (\f(CW\*(C`r=a^p %
|
||||
m\*(C'\fR). This function uses less time and space than \fBBN_exp()\fR. Do not call this
|
||||
function when \fBm\fR is even and any of the parameters have the
|
||||
\&\fB\s-1BN_FLG_CONSTTIME\s0\fR flag set.
|
||||
.PP
|
||||
\&\fIBN_gcd()\fR computes the greatest common divisor of \fIa\fR and \fIb\fR and
|
||||
\&\fBBN_gcd()\fR computes the greatest common divisor of \fIa\fR and \fIb\fR and
|
||||
places the result in \fIr\fR. \fIr\fR may be the same \fB\s-1BIGNUM\s0\fR as \fIa\fR or
|
||||
\&\fIb\fR.
|
||||
.PP
|
||||
For all functions, \fIctx\fR is a previously allocated \fB\s-1BN_CTX\s0\fR used for
|
||||
temporary variables; see \fIBN_CTX_new\fR\|(3).
|
||||
temporary variables; see \fBBN_CTX_new\fR\|(3).
|
||||
.PP
|
||||
Unless noted otherwise, the result \fB\s-1BIGNUM\s0\fR must be different from
|
||||
the arguments.
|
||||
|
@ -246,11 +250,11 @@ the arguments.
|
|||
.IX Header "RETURN VALUES"
|
||||
For all functions, 1 is returned for success, 0 on error. The return
|
||||
value should always be checked (e.g., \f(CW\*(C`if (!BN_add(r,a,b)) goto err;\*(C'\fR).
|
||||
The error codes can be obtained by \fIERR_get_error\fR\|(3).
|
||||
The error codes can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fIBN_CTX_new\fR\|(3),
|
||||
\&\fIBN_add_word\fR\|(3), \fIBN_set_bit\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBBN_CTX_new\fR\|(3),
|
||||
\&\fBBN_add_word\fR\|(3), \fBBN_set_bit\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_add_word.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_add_word.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_add_word 3"
|
||||
.TH BN_add_word 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_add_word 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -162,27 +166,27 @@ These functions perform arithmetic operations on BIGNUMs with unsigned
|
|||
integers. They are much more efficient than the normal \s-1BIGNUM\s0
|
||||
arithmetic operations.
|
||||
.PP
|
||||
\&\fIBN_add_word()\fR adds \fBw\fR to \fBa\fR (\f(CW\*(C`a+=w\*(C'\fR).
|
||||
\&\fBBN_add_word()\fR adds \fBw\fR to \fBa\fR (\f(CW\*(C`a+=w\*(C'\fR).
|
||||
.PP
|
||||
\&\fIBN_sub_word()\fR subtracts \fBw\fR from \fBa\fR (\f(CW\*(C`a\-=w\*(C'\fR).
|
||||
\&\fBBN_sub_word()\fR subtracts \fBw\fR from \fBa\fR (\f(CW\*(C`a\-=w\*(C'\fR).
|
||||
.PP
|
||||
\&\fIBN_mul_word()\fR multiplies \fBa\fR and \fBw\fR (\f(CW\*(C`a*=w\*(C'\fR).
|
||||
\&\fBBN_mul_word()\fR multiplies \fBa\fR and \fBw\fR (\f(CW\*(C`a*=w\*(C'\fR).
|
||||
.PP
|
||||
\&\fIBN_div_word()\fR divides \fBa\fR by \fBw\fR (\f(CW\*(C`a/=w\*(C'\fR) and returns the remainder.
|
||||
\&\fBBN_div_word()\fR divides \fBa\fR by \fBw\fR (\f(CW\*(C`a/=w\*(C'\fR) and returns the remainder.
|
||||
.PP
|
||||
\&\fIBN_mod_word()\fR returns the remainder of \fBa\fR divided by \fBw\fR (\f(CW\*(C`a%w\*(C'\fR).
|
||||
\&\fBBN_mod_word()\fR returns the remainder of \fBa\fR divided by \fBw\fR (\f(CW\*(C`a%w\*(C'\fR).
|
||||
.PP
|
||||
For \fIBN_div_word()\fR and \fIBN_mod_word()\fR, \fBw\fR must not be 0.
|
||||
For \fBBN_div_word()\fR and \fBBN_mod_word()\fR, \fBw\fR must not be 0.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_add_word()\fR, \fIBN_sub_word()\fR and \fIBN_mul_word()\fR return 1 for success, 0
|
||||
on error. The error codes can be obtained by \fIERR_get_error\fR\|(3).
|
||||
\&\fBBN_add_word()\fR, \fBBN_sub_word()\fR and \fBBN_mul_word()\fR return 1 for success, 0
|
||||
on error. The error codes can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.PP
|
||||
\&\fIBN_mod_word()\fR and \fIBN_div_word()\fR return \fBa\fR%\fBw\fR on success and
|
||||
\&\fBBN_mod_word()\fR and \fBBN_div_word()\fR return \fBa\fR%\fBw\fR on success and
|
||||
\&\fB(\s-1BN_ULONG\s0)\-1\fR if an error occurred.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fIBN_add\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBBN_add\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_bn2bin.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_bn2bin.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_bn2bin 3"
|
||||
.TH BN_bn2bin 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_bn2bin 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -168,76 +172,76 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_bn2bin()\fR converts the absolute value of \fBa\fR into big-endian form
|
||||
\&\fBBN_bn2bin()\fR converts the absolute value of \fBa\fR into big-endian form
|
||||
and stores it at \fBto\fR. \fBto\fR must point to BN_num_bytes(\fBa\fR) bytes of
|
||||
memory.
|
||||
.PP
|
||||
\&\fIBN_bn2binpad()\fR also converts the absolute value of \fBa\fR into big-endian form
|
||||
\&\fBBN_bn2binpad()\fR also converts the absolute value of \fBa\fR into big-endian form
|
||||
and stores it at \fBto\fR. \fBtolen\fR indicates the length of the output buffer
|
||||
\&\fBto\fR. The result is padded with zeroes if necessary. If \fBtolen\fR is less than
|
||||
BN_num_bytes(\fBa\fR) an error is returned.
|
||||
.PP
|
||||
\&\fIBN_bin2bn()\fR converts the positive integer in big-endian form of length
|
||||
\&\fBBN_bin2bn()\fR converts the positive integer in big-endian form of length
|
||||
\&\fBlen\fR at \fBs\fR into a \fB\s-1BIGNUM\s0\fR and places it in \fBret\fR. If \fBret\fR is
|
||||
\&\s-1NULL,\s0 a new \fB\s-1BIGNUM\s0\fR is created.
|
||||
.PP
|
||||
\&\fIBN_bn2lebinpad()\fR and \fIBN_lebin2bn()\fR are identical to \fIBN_bn2binpad()\fR and
|
||||
\&\fIBN_bin2bn()\fR except the buffer is in little-endian format.
|
||||
\&\fBBN_bn2lebinpad()\fR and \fBBN_lebin2bn()\fR are identical to \fBBN_bn2binpad()\fR and
|
||||
\&\fBBN_bin2bn()\fR except the buffer is in little-endian format.
|
||||
.PP
|
||||
\&\fIBN_bn2hex()\fR and \fIBN_bn2dec()\fR return printable strings containing the
|
||||
\&\fBBN_bn2hex()\fR and \fBBN_bn2dec()\fR return printable strings containing the
|
||||
hexadecimal and decimal encoding of \fBa\fR respectively. For negative
|
||||
numbers, the string is prefaced with a leading '\-'. The string must be
|
||||
freed later using \fIOPENSSL_free()\fR.
|
||||
freed later using \fBOPENSSL_free()\fR.
|
||||
.PP
|
||||
\&\fIBN_hex2bn()\fR takes as many characters as possible from the string \fBstr\fR,
|
||||
\&\fBBN_hex2bn()\fR takes as many characters as possible from the string \fBstr\fR,
|
||||
including the leading character '\-' which means negative, to form a valid
|
||||
hexadecimal number representation and converts them to a \fB\s-1BIGNUM\s0\fR and
|
||||
stores it in **\fBa\fR. If *\fBa\fR is \s-1NULL,\s0 a new \fB\s-1BIGNUM\s0\fR is created. If
|
||||
\&\fBa\fR is \s-1NULL,\s0 it only computes the length of valid representation.
|
||||
A \*(L"negative zero\*(R" is converted to zero.
|
||||
\&\fIBN_dec2bn()\fR is the same using the decimal system.
|
||||
\&\fBBN_dec2bn()\fR is the same using the decimal system.
|
||||
.PP
|
||||
\&\fIBN_print()\fR and \fIBN_print_fp()\fR write the hexadecimal encoding of \fBa\fR,
|
||||
\&\fBBN_print()\fR and \fBBN_print_fp()\fR write the hexadecimal encoding of \fBa\fR,
|
||||
with a leading '\-' for negative numbers, to the \fB\s-1BIO\s0\fR or \fB\s-1FILE\s0\fR
|
||||
\&\fBfp\fR.
|
||||
.PP
|
||||
\&\fIBN_bn2mpi()\fR and \fIBN_mpi2bn()\fR convert \fB\s-1BIGNUM\s0\fRs from and to a format
|
||||
\&\fBBN_bn2mpi()\fR and \fBBN_mpi2bn()\fR convert \fB\s-1BIGNUM\s0\fRs from and to a format
|
||||
that consists of the number's length in bytes represented as a 4\-byte
|
||||
big-endian number, and the number itself in big-endian format, where
|
||||
the most significant bit signals a negative number (the representation
|
||||
of numbers with the \s-1MSB\s0 set is prefixed with null byte).
|
||||
.PP
|
||||
\&\fIBN_bn2mpi()\fR stores the representation of \fBa\fR at \fBto\fR, where \fBto\fR
|
||||
\&\fBBN_bn2mpi()\fR stores the representation of \fBa\fR at \fBto\fR, where \fBto\fR
|
||||
must be large enough to hold the result. The size can be determined by
|
||||
calling BN_bn2mpi(\fBa\fR, \s-1NULL\s0).
|
||||
.PP
|
||||
\&\fIBN_mpi2bn()\fR converts the \fBlen\fR bytes long representation at \fBs\fR to
|
||||
\&\fBBN_mpi2bn()\fR converts the \fBlen\fR bytes long representation at \fBs\fR to
|
||||
a \fB\s-1BIGNUM\s0\fR and stores it at \fBret\fR, or in a newly allocated \fB\s-1BIGNUM\s0\fR
|
||||
if \fBret\fR is \s-1NULL.\s0
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_bn2bin()\fR returns the length of the big-endian number placed at \fBto\fR.
|
||||
\&\fIBN_bin2bn()\fR returns the \fB\s-1BIGNUM\s0\fR, \s-1NULL\s0 on error.
|
||||
\&\fBBN_bn2bin()\fR returns the length of the big-endian number placed at \fBto\fR.
|
||||
\&\fBBN_bin2bn()\fR returns the \fB\s-1BIGNUM\s0\fR, \s-1NULL\s0 on error.
|
||||
.PP
|
||||
\&\fIBN_bn2binpad()\fR returns the number of bytes written or \-1 if the supplied
|
||||
\&\fBBN_bn2binpad()\fR returns the number of bytes written or \-1 if the supplied
|
||||
buffer is too small.
|
||||
.PP
|
||||
\&\fIBN_bn2hex()\fR and \fIBN_bn2dec()\fR return a null-terminated string, or \s-1NULL\s0
|
||||
on error. \fIBN_hex2bn()\fR and \fIBN_dec2bn()\fR return the number of characters
|
||||
\&\fBBN_bn2hex()\fR and \fBBN_bn2dec()\fR return a null-terminated string, or \s-1NULL\s0
|
||||
on error. \fBBN_hex2bn()\fR and \fBBN_dec2bn()\fR return the number of characters
|
||||
used in parsing, or 0 on error, in which
|
||||
case no new \fB\s-1BIGNUM\s0\fR will be created.
|
||||
.PP
|
||||
\&\fIBN_print_fp()\fR and \fIBN_print()\fR return 1 on success, 0 on write errors.
|
||||
\&\fBBN_print_fp()\fR and \fBBN_print()\fR return 1 on success, 0 on write errors.
|
||||
.PP
|
||||
\&\fIBN_bn2mpi()\fR returns the length of the representation. \fIBN_mpi2bn()\fR
|
||||
\&\fBBN_bn2mpi()\fR returns the length of the representation. \fBBN_mpi2bn()\fR
|
||||
returns the \fB\s-1BIGNUM\s0\fR, and \s-1NULL\s0 on error.
|
||||
.PP
|
||||
The error codes can be obtained by \fIERR_get_error\fR\|(3).
|
||||
The error codes can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fIBN_zero\fR\|(3),
|
||||
\&\fIASN1_INTEGER_to_BN\fR\|(3),
|
||||
\&\fIBN_num_bytes\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBBN_zero\fR\|(3),
|
||||
\&\fBASN1_INTEGER_to_BN\fR\|(3),
|
||||
\&\fBBN_num_bytes\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_cmp.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_cmp.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_cmp 3"
|
||||
.TH BN_cmp 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_cmp 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -155,20 +159,20 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_cmp()\fR compares the numbers \fBa\fR and \fBb\fR. \fIBN_ucmp()\fR compares their
|
||||
\&\fBBN_cmp()\fR compares the numbers \fBa\fR and \fBb\fR. \fBBN_ucmp()\fR compares their
|
||||
absolute values.
|
||||
.PP
|
||||
\&\fIBN_is_zero()\fR, \fIBN_is_one()\fR and \fIBN_is_word()\fR test if \fBa\fR equals 0, 1,
|
||||
or \fBw\fR respectively. \fIBN_is_odd()\fR tests if a is odd.
|
||||
\&\fBBN_is_zero()\fR, \fBBN_is_one()\fR and \fBBN_is_word()\fR test if \fBa\fR equals 0, 1,
|
||||
or \fBw\fR respectively. \fBBN_is_odd()\fR tests if a is odd.
|
||||
.PP
|
||||
\&\fIBN_is_zero()\fR, \fIBN_is_one()\fR, \fIBN_is_word()\fR and \fIBN_is_odd()\fR are macros.
|
||||
\&\fBBN_is_zero()\fR, \fBBN_is_one()\fR, \fBBN_is_word()\fR and \fBBN_is_odd()\fR are macros.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_cmp()\fR returns \-1 if \fBa\fR < \fBb\fR, 0 if \fBa\fR == \fBb\fR and 1 if
|
||||
\&\fBa\fR > \fBb\fR. \fIBN_ucmp()\fR is the same using the absolute values
|
||||
\&\fBBN_cmp()\fR returns \-1 if \fBa\fR < \fBb\fR, 0 if \fBa\fR == \fBb\fR and 1 if
|
||||
\&\fBa\fR > \fBb\fR. \fBBN_ucmp()\fR is the same using the absolute values
|
||||
of \fBa\fR and \fBb\fR.
|
||||
.PP
|
||||
\&\fIBN_is_zero()\fR, \fIBN_is_one()\fR \fIBN_is_word()\fR and \fIBN_is_odd()\fR return 1 if
|
||||
\&\fBBN_is_zero()\fR, \fBBN_is_one()\fR \fBBN_is_word()\fR and \fBBN_is_odd()\fR return 1 if
|
||||
the condition is true, 0 otherwise.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_copy.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_copy.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_copy 3"
|
||||
.TH BN_copy 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_copy 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -153,7 +157,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_copy()\fR copies \fBfrom\fR to \fBto\fR. \fIBN_dup()\fR creates a new \fB\s-1BIGNUM\s0\fR
|
||||
\&\fBBN_copy()\fR copies \fBfrom\fR to \fBto\fR. \fBBN_dup()\fR creates a new \fB\s-1BIGNUM\s0\fR
|
||||
containing the value \fBfrom\fR.
|
||||
.PP
|
||||
BN_with_flags creates a \fBtemporary\fR shallow copy of \fBb\fR in \fBdest\fR. It places
|
||||
|
@ -166,7 +170,7 @@ might commonly be used to create a temporary copy of a \s-1BIGNUM\s0 with the
|
|||
\&\fBdest\fR will share some internal state with \fBb\fR. For this reason the following
|
||||
restrictions apply to the use of \fBdest\fR:
|
||||
.IP "\(bu" 2
|
||||
\&\fBdest\fR should be a newly allocated \s-1BIGNUM\s0 obtained via a call to \fIBN_new()\fR. It
|
||||
\&\fBdest\fR should be a newly allocated \s-1BIGNUM\s0 obtained via a call to \fBBN_new()\fR. It
|
||||
should not have been used for other purposes or initialised in any way.
|
||||
.IP "\(bu" 2
|
||||
\&\fBdest\fR must only be used in \*(L"read-only\*(R" operations, i.e. typically those
|
||||
|
@ -175,12 +179,12 @@ functions where the relevant parameter is declared \*(L"const\*(R".
|
|||
\&\fBdest\fR must be used and freed before any further subsequent use of \fBb\fR
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_copy()\fR returns \fBto\fR on success, \s-1NULL\s0 on error. \fIBN_dup()\fR returns
|
||||
\&\fBBN_copy()\fR returns \fBto\fR on success, \s-1NULL\s0 on error. \fBBN_dup()\fR returns
|
||||
the new \fB\s-1BIGNUM\s0\fR, and \s-1NULL\s0 on error. The error codes can be obtained
|
||||
by \fIERR_get_error\fR\|(3).
|
||||
by \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_generate_prime.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_generate_prime.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_generate_prime 3"
|
||||
.TH BN_generate_prime 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_generate_prime 3 "2019-03-12" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -189,7 +193,7 @@ Deprecated:
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_generate_prime_ex()\fR generates a pseudo-random prime number of
|
||||
\&\fBBN_generate_prime_ex()\fR generates a pseudo-random prime number of
|
||||
at least bit length \fBbits\fR.
|
||||
If \fBret\fR is not \fB\s-1NULL\s0\fR, it will be used to store the number.
|
||||
.PP
|
||||
|
@ -203,7 +207,7 @@ While the number is being tested for primality,
|
|||
.IP "\(bu" 2
|
||||
When a prime has been found, \fBBN_GENCB_call(cb, 2, i)\fR is called.
|
||||
.IP "\(bu" 2
|
||||
The callers of \fIBN_generate_prime_ex()\fR may call \fBBN_GENCB_call(cb, i, j)\fR with
|
||||
The callers of \fBBN_generate_prime_ex()\fR may call \fBBN_GENCB_call(cb, i, j)\fR with
|
||||
other values as described in their respective man pages; see \*(L"\s-1SEE ALSO\*(R"\s0.
|
||||
.PP
|
||||
The prime may have to fulfill additional requirements for use in
|
||||
|
@ -216,21 +220,21 @@ generator.
|
|||
If \fBsafe\fR is true, it will be a safe prime (i.e. a prime p so
|
||||
that (p\-1)/2 is also prime).
|
||||
.PP
|
||||
The \s-1PRNG\s0 must be seeded prior to calling \fIBN_generate_prime_ex()\fR.
|
||||
The \s-1PRNG\s0 must be seeded prior to calling \fBBN_generate_prime_ex()\fR.
|
||||
The prime number generation has a negligible error probability.
|
||||
.PP
|
||||
\&\fIBN_is_prime_ex()\fR and \fIBN_is_prime_fasttest_ex()\fR test if the number \fBp\fR is
|
||||
\&\fBBN_is_prime_ex()\fR and \fBBN_is_prime_fasttest_ex()\fR test if the number \fBp\fR is
|
||||
prime. The following tests are performed until one of them shows that
|
||||
\&\fBp\fR is composite; if \fBp\fR passes all these tests, it is considered
|
||||
prime.
|
||||
.PP
|
||||
\&\fIBN_is_prime_fasttest_ex()\fR, when called with \fBdo_trial_division == 1\fR,
|
||||
\&\fBBN_is_prime_fasttest_ex()\fR, when called with \fBdo_trial_division == 1\fR,
|
||||
first attempts trial division by a number of small primes;
|
||||
if no divisors are found by this test and \fBcb\fR is not \fB\s-1NULL\s0\fR,
|
||||
\&\fBBN_GENCB_call(cb, 1, \-1)\fR is called.
|
||||
If \fBdo_trial_division == 0\fR, this test is skipped.
|
||||
.PP
|
||||
Both \fIBN_is_prime_ex()\fR and \fIBN_is_prime_fasttest_ex()\fR perform a Miller-Rabin
|
||||
Both \fBBN_is_prime_ex()\fR and \fBBN_is_prime_fasttest_ex()\fR perform a Miller-Rabin
|
||||
probabilistic primality test with \fBnchecks\fR iterations. If
|
||||
\&\fBnchecks == BN_prime_checks\fR, a number of iterations is used that
|
||||
yields a false positive rate of at most 2^\-64 for random input.
|
||||
|
@ -250,20 +254,20 @@ after the j\-th iteration (j = 0, 1, ...). \fBctx\fR is a
|
|||
pre-allocated \fB\s-1BN_CTX\s0\fR (to save the overhead of allocating and
|
||||
freeing the structure in a loop), or \fB\s-1NULL\s0\fR.
|
||||
.PP
|
||||
\&\fIBN_GENCB_call()\fR calls the callback function held in the \fB\s-1BN_GENCB\s0\fR structure
|
||||
\&\fBBN_GENCB_call()\fR calls the callback function held in the \fB\s-1BN_GENCB\s0\fR structure
|
||||
and passes the ints \fBa\fR and \fBb\fR as arguments. There are two types of
|
||||
\&\fB\s-1BN_GENCB\s0\fR structure that are supported: \*(L"new\*(R" style and \*(L"old\*(R" style. New
|
||||
programs should prefer the \*(L"new\*(R" style, whilst the \*(L"old\*(R" style is provided
|
||||
for backwards compatibility purposes.
|
||||
.PP
|
||||
A \fB\s-1BN_GENCB\s0\fR structure should be created through a call to \fIBN_GENCB_new()\fR,
|
||||
and freed through a call to \fIBN_GENCB_free()\fR.
|
||||
A \fB\s-1BN_GENCB\s0\fR structure should be created through a call to \fBBN_GENCB_new()\fR,
|
||||
and freed through a call to \fBBN_GENCB_free()\fR.
|
||||
.PP
|
||||
For \*(L"new\*(R" style callbacks a \s-1BN_GENCB\s0 structure should be initialised with a
|
||||
call to \fIBN_GENCB_set()\fR, where \fBgencb\fR is a \fB\s-1BN_GENCB\s0 *\fR, \fBcallback\fR is of
|
||||
call to \fBBN_GENCB_set()\fR, where \fBgencb\fR is a \fB\s-1BN_GENCB\s0 *\fR, \fBcallback\fR is of
|
||||
type \fBint (*callback)(int, int, \s-1BN_GENCB\s0 *)\fR and \fBcb_arg\fR is a \fBvoid *\fR.
|
||||
\&\*(L"Old\*(R" style callbacks are the same except they are initialised with a call
|
||||
to \fIBN_GENCB_set_old()\fR and \fBcallback\fR is of type
|
||||
to \fBBN_GENCB_set_old()\fR and \fBcallback\fR is of type
|
||||
\&\fBvoid (*callback)(int, int, void *)\fR.
|
||||
.PP
|
||||
A callback is invoked through a call to \fBBN_GENCB_call\fR. This will check
|
||||
|
@ -273,22 +277,22 @@ style callbacks or \fBcallback(a, b, cb_arg)\fR for old style.
|
|||
It is possible to obtain the argument associated with a \s-1BN_GENCB\s0 structure
|
||||
(set via a call to BN_GENCB_set or BN_GENCB_set_old) using BN_GENCB_get_arg.
|
||||
.PP
|
||||
\&\fIBN_generate_prime()\fR (deprecated) works in the same way as
|
||||
\&\fIBN_generate_prime_ex()\fR but expects an old-style callback function
|
||||
\&\fBBN_generate_prime()\fR (deprecated) works in the same way as
|
||||
\&\fBBN_generate_prime_ex()\fR but expects an old-style callback function
|
||||
directly in the \fBcallback\fR parameter, and an argument to pass to it in
|
||||
the \fBcb_arg\fR. \fIBN_is_prime()\fR and \fIBN_is_prime_fasttest()\fR
|
||||
can similarly be compared to \fIBN_is_prime_ex()\fR and
|
||||
\&\fIBN_is_prime_fasttest_ex()\fR, respectively.
|
||||
the \fBcb_arg\fR. \fBBN_is_prime()\fR and \fBBN_is_prime_fasttest()\fR
|
||||
can similarly be compared to \fBBN_is_prime_ex()\fR and
|
||||
\&\fBBN_is_prime_fasttest_ex()\fR, respectively.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_generate_prime_ex()\fR return 1 on success or 0 on error.
|
||||
\&\fBBN_generate_prime_ex()\fR return 1 on success or 0 on error.
|
||||
.PP
|
||||
\&\fIBN_is_prime_ex()\fR, \fIBN_is_prime_fasttest_ex()\fR, \fIBN_is_prime()\fR and
|
||||
\&\fIBN_is_prime_fasttest()\fR return 0 if the number is composite, 1 if it is
|
||||
\&\fBBN_is_prime_ex()\fR, \fBBN_is_prime_fasttest_ex()\fR, \fBBN_is_prime()\fR and
|
||||
\&\fBBN_is_prime_fasttest()\fR return 0 if the number is composite, 1 if it is
|
||||
prime with an error probability of less than 0.25^\fBnchecks\fR, and
|
||||
\&\-1 on error.
|
||||
.PP
|
||||
\&\fIBN_generate_prime()\fR returns the prime number on success, \fB\s-1NULL\s0\fR otherwise.
|
||||
\&\fBBN_generate_prime()\fR returns the prime number on success, \fB\s-1NULL\s0\fR otherwise.
|
||||
.PP
|
||||
BN_GENCB_new returns a pointer to a \s-1BN_GENCB\s0 structure on success, or \fB\s-1NULL\s0\fR
|
||||
otherwise.
|
||||
|
@ -298,7 +302,7 @@ structure.
|
|||
.PP
|
||||
Callback functions should return 1 on success or 0 on error.
|
||||
.PP
|
||||
The error codes can be obtained by \fIERR_get_error\fR\|(3).
|
||||
The error codes can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "REMOVED FUNCTIONALITY"
|
||||
.IX Header "REMOVED FUNCTIONALITY"
|
||||
As of OpenSSL 1.1.0 it is no longer possible to create a \s-1BN_GENCB\s0 structure
|
||||
|
@ -320,12 +324,12 @@ Instead applications should create a \s-1BN_GENCB\s0 structure using BN_GENCB_ne
|
|||
.Ve
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIDH_generate_parameters\fR\|(3), \fIDSA_generate_parameters\fR\|(3),
|
||||
\&\fIRSA_generate_key\fR\|(3), \fIERR_get_error\fR\|(3), \fIRAND_bytes\fR\|(3)
|
||||
\&\fBDH_generate_parameters\fR\|(3), \fBDSA_generate_parameters\fR\|(3),
|
||||
\&\fBRSA_generate_key\fR\|(3), \fBERR_get_error\fR\|(3), \fBRAND_bytes\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBN_GENCB_new()\fR, \fIBN_GENCB_free()\fR,
|
||||
and \fIBN_GENCB_get_arg()\fR were added in OpenSSL 1.1.0
|
||||
The \fBBN_GENCB_new()\fR, \fBBN_GENCB_free()\fR,
|
||||
and \fBBN_GENCB_get_arg()\fR functions were added in OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_mod_inverse.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_mod_inverse.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_mod_inverse 3"
|
||||
.TH BN_mod_inverse 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_mod_inverse 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -150,7 +154,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_mod_inverse()\fR computes the inverse of \fBa\fR modulo \fBn\fR
|
||||
\&\fBBN_mod_inverse()\fR computes the inverse of \fBa\fR modulo \fBn\fR
|
||||
places the result in \fBr\fR (\f(CW\*(C`(a*r)%n==1\*(C'\fR). If \fBr\fR is \s-1NULL,\s0
|
||||
a new \fB\s-1BIGNUM\s0\fR is created.
|
||||
.PP
|
||||
|
@ -158,11 +162,11 @@ a new \fB\s-1BIGNUM\s0\fR is created.
|
|||
variables. \fBr\fR may be the same \fB\s-1BIGNUM\s0\fR as \fBa\fR or \fBn\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_mod_inverse()\fR returns the \fB\s-1BIGNUM\s0\fR containing the inverse, and
|
||||
\&\s-1NULL\s0 on error. The error codes can be obtained by \fIERR_get_error\fR\|(3).
|
||||
\&\fBBN_mod_inverse()\fR returns the \fB\s-1BIGNUM\s0\fR containing the inverse, and
|
||||
\&\s-1NULL\s0 on error. The error codes can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fIBN_add\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBBN_add\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_mod_mul_montgomery.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_mod_mul_montgomery.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_mod_mul_montgomery 3"
|
||||
.TH BN_mod_mul_montgomery 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_mod_mul_montgomery 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -165,51 +169,51 @@ libcrypto, -lcrypto
|
|||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
These functions implement Montgomery multiplication. They are used
|
||||
automatically when \fIBN_mod_exp\fR\|(3) is called with suitable input,
|
||||
automatically when \fBBN_mod_exp\fR\|(3) is called with suitable input,
|
||||
but they may be useful when several operations are to be performed
|
||||
using the same modulus.
|
||||
.PP
|
||||
\&\fIBN_MONT_CTX_new()\fR allocates and initializes a \fB\s-1BN_MONT_CTX\s0\fR structure.
|
||||
\&\fBBN_MONT_CTX_new()\fR allocates and initializes a \fB\s-1BN_MONT_CTX\s0\fR structure.
|
||||
.PP
|
||||
\&\fIBN_MONT_CTX_set()\fR sets up the \fImont\fR structure from the modulus \fIm\fR
|
||||
\&\fBBN_MONT_CTX_set()\fR sets up the \fImont\fR structure from the modulus \fIm\fR
|
||||
by precomputing its inverse and a value R.
|
||||
.PP
|
||||
\&\fIBN_MONT_CTX_copy()\fR copies the \fB\s-1BN_MONT_CTX\s0\fR \fIfrom\fR to \fIto\fR.
|
||||
\&\fBBN_MONT_CTX_copy()\fR copies the \fB\s-1BN_MONT_CTX\s0\fR \fIfrom\fR to \fIto\fR.
|
||||
.PP
|
||||
\&\fIBN_MONT_CTX_free()\fR frees the components of the \fB\s-1BN_MONT_CTX\s0\fR, and, if
|
||||
it was created by \fIBN_MONT_CTX_new()\fR, also the structure itself.
|
||||
\&\fBBN_MONT_CTX_free()\fR frees the components of the \fB\s-1BN_MONT_CTX\s0\fR, and, if
|
||||
it was created by \fBBN_MONT_CTX_new()\fR, also the structure itself.
|
||||
If \fBmont\fR is \s-1NULL,\s0 nothing is done.
|
||||
.PP
|
||||
\&\fIBN_mod_mul_montgomery()\fR computes Mont(\fIa\fR,\fIb\fR):=\fIa\fR*\fIb\fR*R^\-1 and places
|
||||
\&\fBBN_mod_mul_montgomery()\fR computes Mont(\fIa\fR,\fIb\fR):=\fIa\fR*\fIb\fR*R^\-1 and places
|
||||
the result in \fIr\fR.
|
||||
.PP
|
||||
\&\fIBN_from_montgomery()\fR performs the Montgomery reduction \fIr\fR = \fIa\fR*R^\-1.
|
||||
\&\fBBN_from_montgomery()\fR performs the Montgomery reduction \fIr\fR = \fIa\fR*R^\-1.
|
||||
.PP
|
||||
\&\fIBN_to_montgomery()\fR computes Mont(\fIa\fR,R^2), i.e. \fIa\fR*R.
|
||||
\&\fBBN_to_montgomery()\fR computes Mont(\fIa\fR,R^2), i.e. \fIa\fR*R.
|
||||
Note that \fIa\fR must be non-negative and smaller than the modulus.
|
||||
.PP
|
||||
For all functions, \fIctx\fR is a previously allocated \fB\s-1BN_CTX\s0\fR used for
|
||||
temporary variables.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_MONT_CTX_new()\fR returns the newly allocated \fB\s-1BN_MONT_CTX\s0\fR, and \s-1NULL\s0
|
||||
\&\fBBN_MONT_CTX_new()\fR returns the newly allocated \fB\s-1BN_MONT_CTX\s0\fR, and \s-1NULL\s0
|
||||
on error.
|
||||
.PP
|
||||
\&\fIBN_MONT_CTX_free()\fR has no return value.
|
||||
\&\fBBN_MONT_CTX_free()\fR has no return value.
|
||||
.PP
|
||||
For the other functions, 1 is returned for success, 0 on error.
|
||||
The error codes can be obtained by \fIERR_get_error\fR\|(3).
|
||||
The error codes can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "WARNING"
|
||||
.IX Header "WARNING"
|
||||
The inputs must be reduced modulo \fBm\fR, otherwise the result will be
|
||||
outside the expected range.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fIBN_add\fR\|(3),
|
||||
\&\fIBN_CTX_new\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBBN_add\fR\|(3),
|
||||
\&\fBBN_CTX_new\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBN_MONT_CTX_init()\fR was removed in OpenSSL 1.1.0
|
||||
\&\fBBN_MONT_CTX_init()\fR was removed in OpenSSL 1.1.0
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_mod_mul_reciprocal.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_mod_mul_reciprocal.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_mod_mul_reciprocal 3"
|
||||
.TH BN_mod_mul_reciprocal 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_mod_mul_reciprocal 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -160,43 +164,43 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_mod_mul_reciprocal()\fR can be used to perform an efficient
|
||||
\&\fIBN_mod_mul\fR\|(3) operation when the operation will be performed
|
||||
\&\fBBN_mod_mul_reciprocal()\fR can be used to perform an efficient
|
||||
\&\fBBN_mod_mul\fR\|(3) operation when the operation will be performed
|
||||
repeatedly with the same modulus. It computes \fBr\fR=(\fBa\fR*\fBb\fR)%\fBm\fR
|
||||
using \fBrecp\fR=1/\fBm\fR, which is set as described below. \fBctx\fR is a
|
||||
previously allocated \fB\s-1BN_CTX\s0\fR used for temporary variables.
|
||||
.PP
|
||||
\&\fIBN_RECP_CTX_new()\fR allocates and initializes a \fB\s-1BN_RECP\s0\fR structure.
|
||||
\&\fBBN_RECP_CTX_new()\fR allocates and initializes a \fB\s-1BN_RECP\s0\fR structure.
|
||||
.PP
|
||||
\&\fIBN_RECP_CTX_free()\fR frees the components of the \fB\s-1BN_RECP\s0\fR, and, if it
|
||||
was created by \fIBN_RECP_CTX_new()\fR, also the structure itself.
|
||||
\&\fBBN_RECP_CTX_free()\fR frees the components of the \fB\s-1BN_RECP\s0\fR, and, if it
|
||||
was created by \fBBN_RECP_CTX_new()\fR, also the structure itself.
|
||||
If \fBrecp\fR is \s-1NULL,\s0 nothing is done.
|
||||
.PP
|
||||
\&\fIBN_RECP_CTX_set()\fR stores \fBm\fR in \fBrecp\fR and sets it up for computing
|
||||
\&\fBBN_RECP_CTX_set()\fR stores \fBm\fR in \fBrecp\fR and sets it up for computing
|
||||
1/\fBm\fR and shifting it left by BN_num_bits(\fBm\fR)+1 to make it an
|
||||
integer. The result and the number of bits it was shifted left will
|
||||
later be stored in \fBrecp\fR.
|
||||
.PP
|
||||
\&\fIBN_div_recp()\fR divides \fBa\fR by \fBm\fR using \fBrecp\fR. It places the quotient
|
||||
\&\fBBN_div_recp()\fR divides \fBa\fR by \fBm\fR using \fBrecp\fR. It places the quotient
|
||||
in \fBdv\fR and the remainder in \fBrem\fR.
|
||||
.PP
|
||||
The \fB\s-1BN_RECP_CTX\s0\fR structure cannot be shared between threads.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_RECP_CTX_new()\fR returns the newly allocated \fB\s-1BN_RECP_CTX\s0\fR, and \s-1NULL\s0
|
||||
\&\fBBN_RECP_CTX_new()\fR returns the newly allocated \fB\s-1BN_RECP_CTX\s0\fR, and \s-1NULL\s0
|
||||
on error.
|
||||
.PP
|
||||
\&\fIBN_RECP_CTX_free()\fR has no return value.
|
||||
\&\fBBN_RECP_CTX_free()\fR has no return value.
|
||||
.PP
|
||||
For the other functions, 1 is returned for success, 0 on error.
|
||||
The error codes can be obtained by \fIERR_get_error\fR\|(3).
|
||||
The error codes can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fIBN_add\fR\|(3),
|
||||
\&\fIBN_CTX_new\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3), \fBBN_add\fR\|(3),
|
||||
\&\fBBN_CTX_new\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBN_RECP_CTX_init()\fR was removed in OpenSSL 1.1.0
|
||||
\&\fBBN_RECP_CTX_init()\fR was removed in OpenSSL 1.1.0
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_new.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_new.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_new 3"
|
||||
.TH BN_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_new 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -157,36 +161,37 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_new()\fR allocates and initializes a \fB\s-1BIGNUM\s0\fR structure.
|
||||
\&\fIBN_secure_new()\fR does the same except that the secure heap
|
||||
\&\fIOPENSSL_secure_malloc\fR\|(3) is used to store the value.
|
||||
\&\fBBN_new()\fR allocates and initializes a \fB\s-1BIGNUM\s0\fR structure.
|
||||
\&\fBBN_secure_new()\fR does the same except that the secure heap
|
||||
\&\fBOPENSSL_secure_malloc\fR\|(3) is used to store the value.
|
||||
.PP
|
||||
\&\fIBN_clear()\fR is used to destroy sensitive data such as keys when they
|
||||
\&\fBBN_clear()\fR is used to destroy sensitive data such as keys when they
|
||||
are no longer needed. It erases the memory used by \fBa\fR and sets it
|
||||
to the value 0.
|
||||
If \fBa\fR is \s-1NULL,\s0 nothing is done.
|
||||
.PP
|
||||
\&\fIBN_free()\fR frees the components of the \fB\s-1BIGNUM\s0\fR, and if it was created
|
||||
by \fIBN_new()\fR, also the structure itself. \fIBN_clear_free()\fR additionally
|
||||
\&\fBBN_free()\fR frees the components of the \fB\s-1BIGNUM\s0\fR, and if it was created
|
||||
by \fBBN_new()\fR, also the structure itself. \fBBN_clear_free()\fR additionally
|
||||
overwrites the data before the memory is returned to the system.
|
||||
If \fBa\fR is \s-1NULL,\s0 nothing is done.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_new()\fR and \fIBN_secure_new()\fR
|
||||
\&\fBBN_new()\fR and \fBBN_secure_new()\fR
|
||||
return a pointer to the \fB\s-1BIGNUM\s0\fR initialised to the value 0.
|
||||
If the allocation fails,
|
||||
they return \fB\s-1NULL\s0\fR and set an error code that can be obtained
|
||||
by \fIERR_get_error\fR\|(3).
|
||||
by \fBERR_get_error\fR\|(3).
|
||||
.PP
|
||||
\&\fIBN_clear()\fR, \fIBN_free()\fR and \fIBN_clear_free()\fR have no return values.
|
||||
\&\fBBN_clear()\fR, \fBBN_free()\fR and \fBBN_clear_free()\fR have no return values.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBN_init()\fR was removed in OpenSSL 1.1.0; use \fIBN_new()\fR instead.
|
||||
\&\fBBN_init()\fR was removed in OpenSSL 1.1.0; use \fBBN_new()\fR instead.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2000\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_num_bytes.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_num_bytes.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_num_bytes 3"
|
||||
.TH BN_num_bytes 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_num_bytes 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -153,35 +157,35 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_num_bytes()\fR returns the size of a \fB\s-1BIGNUM\s0\fR in bytes.
|
||||
\&\fBBN_num_bytes()\fR returns the size of a \fB\s-1BIGNUM\s0\fR in bytes.
|
||||
.PP
|
||||
\&\fIBN_num_bits_word()\fR returns the number of significant bits in a word.
|
||||
\&\fBBN_num_bits_word()\fR returns the number of significant bits in a word.
|
||||
If we take 0x00000432 as an example, it returns 11, not 16, not 32.
|
||||
Basically, except for a zero, it returns \fIfloor(log2(w))+1\fR.
|
||||
.PP
|
||||
\&\fIBN_num_bits()\fR returns the number of significant bits in a \fB\s-1BIGNUM\s0\fR,
|
||||
following the same principle as \fIBN_num_bits_word()\fR.
|
||||
\&\fBBN_num_bits()\fR returns the number of significant bits in a \fB\s-1BIGNUM\s0\fR,
|
||||
following the same principle as \fBBN_num_bits_word()\fR.
|
||||
.PP
|
||||
\&\fIBN_num_bytes()\fR is a macro.
|
||||
\&\fBBN_num_bytes()\fR is a macro.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
The size.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
Some have tried using \fIBN_num_bits()\fR on individual numbers in \s-1RSA\s0 keys,
|
||||
Some have tried using \fBBN_num_bits()\fR on individual numbers in \s-1RSA\s0 keys,
|
||||
\&\s-1DH\s0 keys and \s-1DSA\s0 keys, and found that they don't always come up with
|
||||
the number of bits they expected (something like 512, 1024, 2048,
|
||||
\&...). This is because generating a number with some specific number
|
||||
of bits doesn't always set the highest bits, thereby making the number
|
||||
of \fIsignificant\fR bits a little lower. If you want to know the \*(L"key
|
||||
size\*(R" of such a key, either use functions like \fIRSA_size()\fR, \fIDH_size()\fR
|
||||
and \fIDSA_size()\fR, or use \fIBN_num_bytes()\fR and multiply with 8 (although
|
||||
size\*(R" of such a key, either use functions like \fBRSA_size()\fR, \fBDH_size()\fR
|
||||
and \fBDSA_size()\fR, or use \fBBN_num_bytes()\fR and multiply with 8 (although
|
||||
there's no real guarantee that will match the \*(L"key size\*(R", just a lot
|
||||
more probability).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIDH_size\fR\|(3), \fIDSA_size\fR\|(3),
|
||||
\&\fIRSA_size\fR\|(3)
|
||||
\&\fBDH_size\fR\|(3), \fBDSA_size\fR\|(3),
|
||||
\&\fBRSA_size\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_rand.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_rand.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_rand 3"
|
||||
.TH BN_rand 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_rand 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -161,7 +165,7 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_rand()\fR generates a cryptographically strong pseudo-random number of
|
||||
\&\fBBN_rand()\fR generates a cryptographically strong pseudo-random number of
|
||||
\&\fBbits\fR in length and stores it in \fBrnd\fR.
|
||||
If \fBbits\fR is less than zero, or too small to
|
||||
accommodate the requirements specified by the \fBtop\fR and \fBbottom\fR
|
||||
|
@ -177,13 +181,13 @@ If \fBbottom\fR is \fB\s-1BN_RAND_BOTTOM_ODD\s0\fR, the number will be odd; if i
|
|||
is \fB\s-1BN_RAND_BOTTOM_ANY\s0\fR it can be odd or even.
|
||||
If \fBbits\fR is 1 then \fBtop\fR cannot also be \fB\s-1BN_RAND_FLG_TOPTWO\s0\fR.
|
||||
.PP
|
||||
\&\fIBN_rand_range()\fR generates a cryptographically strong pseudo-random
|
||||
\&\fBBN_rand_range()\fR generates a cryptographically strong pseudo-random
|
||||
number \fBrnd\fR in the range 0 <= \fBrnd\fR < \fBrange\fR.
|
||||
.PP
|
||||
\&\fIBN_priv_rand()\fR and \fIBN_priv_rand_range()\fR have the same semantics as
|
||||
\&\fIBN_rand()\fR and \fIBN_rand_range()\fR respectively. They are intended to be
|
||||
\&\fBBN_priv_rand()\fR and \fBBN_priv_rand_range()\fR have the same semantics as
|
||||
\&\fBBN_rand()\fR and \fBBN_rand_range()\fR respectively. They are intended to be
|
||||
used for generating values that should remain private, and mirror the
|
||||
same difference between \fIRAND_bytes\fR\|(3) and \fIRAND_priv_bytes\fR\|(3).
|
||||
same difference between \fBRAND_bytes\fR\|(3) and \fBRAND_priv_bytes\fR\|(3).
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
Always check the error return value of these functions and do not take
|
||||
|
@ -192,28 +196,29 @@ seeded with enough randomness to ensure an unpredictable byte sequence.
|
|||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
The functions return 1 on success, 0 on error.
|
||||
The error codes can be obtained by \fIERR_get_error\fR\|(3).
|
||||
The error codes can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fBERR_get_error\fR\|(3),
|
||||
\&\fBRAND_add\fR\|(3),
|
||||
\&\fBRAND_bytes\fR\|(3),
|
||||
\&\fBRAND_priv_bytes\fR\|(3),
|
||||
\&\s-1\fBRAND\s0\fR\|(7),
|
||||
\&\s-1\fBRAND_DRBG\s0\fR\|(7)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
.IP "\(bu" 2
|
||||
Starting with OpenSSL release 1.1.0, \fIBN_pseudo_rand()\fR has been identical
|
||||
to \fIBN_rand()\fR and \fIBN_pseudo_rand_range()\fR has been identical to
|
||||
\&\fIBN_rand_range()\fR.
|
||||
Starting with OpenSSL release 1.1.0, \fBBN_pseudo_rand()\fR has been identical
|
||||
to \fBBN_rand()\fR and \fBBN_pseudo_rand_range()\fR has been identical to
|
||||
\&\fBBN_rand_range()\fR.
|
||||
The \*(L"pseudo\*(R" functions should not be used and may be deprecated in
|
||||
a future release.
|
||||
.IP "\(bu" 2
|
||||
\&\fIBN_priv_rand()\fR and \fIBN_priv_rand_range()\fR were added in OpenSSL 1.1.1.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3),
|
||||
\&\fIRAND_add\fR\|(3),
|
||||
\&\fIRAND_bytes\fR\|(3),
|
||||
\&\fIRAND_priv_bytes\fR\|(3),
|
||||
\&\s-1\fIRAND\s0\fR\|(7),
|
||||
\&\s-1\fIRAND_DRBG\s0\fR\|(7)
|
||||
The
|
||||
\&\fBBN_priv_rand()\fR and \fBBN_priv_rand_range()\fR functions were added in OpenSSL 1.1.1.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2000\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_security_bits.3,v 1.1 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_security_bits.3,v 1.2 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_security_bits 3"
|
||||
.TH BN_security_bits 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_security_bits 3 "2019-06-09" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -149,11 +153,11 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_security_bits()\fR returns the number of bits of security provided by a
|
||||
\&\fBBN_security_bits()\fR returns the number of bits of security provided by a
|
||||
specific algorithm and a particular key size. The bits of security is
|
||||
defined in \s-1NIST SP800\-57.\s0 Currently, \fIBN_security_bits()\fR support two types
|
||||
of asymmetric algorithms: the \s-1FFC \s0(Finite Field Cryptography) and \s-1IFC
|
||||
\&\s0(Integer Factorization Cryptography). For \s-1FFC,\s0 e.g., \s-1DSA\s0 and \s-1DH,\s0 both
|
||||
defined in \s-1NIST SP800\-57.\s0 Currently, \fBBN_security_bits()\fR support two types
|
||||
of asymmetric algorithms: the \s-1FFC\s0 (Finite Field Cryptography) and \s-1IFC\s0
|
||||
(Integer Factorization Cryptography). For \s-1FFC,\s0 e.g., \s-1DSA\s0 and \s-1DH,\s0 both
|
||||
parameters \fBL\fR and \fBN\fR are used to decide the bits of security, where
|
||||
\&\fBL\fR is the size of the public key and \fBN\fR is the size of the private
|
||||
key. For \s-1IFC,\s0 e.g., \s-1RSA,\s0 only \fBL\fR is used and it's commonly considered
|
||||
|
@ -163,17 +167,17 @@ to be the key size (modulus).
|
|||
Number of security bits.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
\&\s-1ECC \s0(Elliptic Curve Cryptography) is not covered by the \fIBN_security_bits()\fR
|
||||
\&\s-1ECC\s0 (Elliptic Curve Cryptography) is not covered by the \fBBN_security_bits()\fR
|
||||
function. The symmetric algorithms are not covered neither.
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBN_security_bits()\fR was added in OpenSSL 1.1.0.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIDH_security_bits\fR\|(3), \fIDSA_security_bits\fR\|(3), \fIRSA_security_bits\fR\|(3)
|
||||
\&\fBDH_security_bits\fR\|(3), \fBDSA_security_bits\fR\|(3), \fBRSA_security_bits\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
The \fBBN_security_bits()\fR function was added in OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
Copyright 2017\-2019 The OpenSSL Project Authors. All Rights Reserved.
|
||||
.PP
|
||||
Licensed under the OpenSSL license (the \*(L"License\*(R"). You may not use
|
||||
this file except in compliance with the License. You can obtain a copy
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_set_bit.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_set_bit.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_set_bit 3"
|
||||
.TH BN_set_bit 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_set_bit 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -161,36 +165,36 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_set_bit()\fR sets bit \fBn\fR in \fBa\fR to 1 (\f(CW\*(C`a|=(1<<n)\*(C'\fR). The
|
||||
\&\fBBN_set_bit()\fR sets bit \fBn\fR in \fBa\fR to 1 (\f(CW\*(C`a|=(1<<n)\*(C'\fR). The
|
||||
number is expanded if necessary.
|
||||
.PP
|
||||
\&\fIBN_clear_bit()\fR sets bit \fBn\fR in \fBa\fR to 0 (\f(CW\*(C`a&=~(1<<n)\*(C'\fR). An
|
||||
\&\fBBN_clear_bit()\fR sets bit \fBn\fR in \fBa\fR to 0 (\f(CW\*(C`a&=~(1<<n)\*(C'\fR). An
|
||||
error occurs if \fBa\fR is shorter than \fBn\fR bits.
|
||||
.PP
|
||||
\&\fIBN_is_bit_set()\fR tests if bit \fBn\fR in \fBa\fR is set.
|
||||
\&\fBBN_is_bit_set()\fR tests if bit \fBn\fR in \fBa\fR is set.
|
||||
.PP
|
||||
\&\fIBN_mask_bits()\fR truncates \fBa\fR to an \fBn\fR bit number
|
||||
\&\fBBN_mask_bits()\fR truncates \fBa\fR to an \fBn\fR bit number
|
||||
(\f(CW\*(C`a&=~((~0)>>n)\*(C'\fR). An error occurs if \fBa\fR already is
|
||||
shorter than \fBn\fR bits.
|
||||
.PP
|
||||
\&\fIBN_lshift()\fR shifts \fBa\fR left by \fBn\fR bits and places the result in
|
||||
\&\fBr\fR (\f(CW\*(C`r=a*2^n\*(C'\fR). Note that \fBn\fR must be non-negative. \fIBN_lshift1()\fR shifts
|
||||
\&\fBBN_lshift()\fR shifts \fBa\fR left by \fBn\fR bits and places the result in
|
||||
\&\fBr\fR (\f(CW\*(C`r=a*2^n\*(C'\fR). Note that \fBn\fR must be non-negative. \fBBN_lshift1()\fR shifts
|
||||
\&\fBa\fR left by one and places the result in \fBr\fR (\f(CW\*(C`r=2*a\*(C'\fR).
|
||||
.PP
|
||||
\&\fIBN_rshift()\fR shifts \fBa\fR right by \fBn\fR bits and places the result in
|
||||
\&\fBr\fR (\f(CW\*(C`r=a/2^n\*(C'\fR). Note that \fBn\fR must be non-negative. \fIBN_rshift1()\fR shifts
|
||||
\&\fBBN_rshift()\fR shifts \fBa\fR right by \fBn\fR bits and places the result in
|
||||
\&\fBr\fR (\f(CW\*(C`r=a/2^n\*(C'\fR). Note that \fBn\fR must be non-negative. \fBBN_rshift1()\fR shifts
|
||||
\&\fBa\fR right by one and places the result in \fBr\fR (\f(CW\*(C`r=a/2\*(C'\fR).
|
||||
.PP
|
||||
For the shift functions, \fBr\fR and \fBa\fR may be the same variable.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_is_bit_set()\fR returns 1 if the bit is set, 0 otherwise.
|
||||
\&\fBBN_is_bit_set()\fR returns 1 if the bit is set, 0 otherwise.
|
||||
.PP
|
||||
All other functions return 1 for success, 0 on error. The error codes
|
||||
can be obtained by \fIERR_get_error\fR\|(3).
|
||||
can be obtained by \fBERR_get_error\fR\|(3).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIBN_num_bytes\fR\|(3), \fIBN_add\fR\|(3)
|
||||
\&\fBBN_num_bytes\fR\|(3), \fBBN_add\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2017 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_swap.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_swap.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_swap 3"
|
||||
.TH BN_swap 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_swap 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -149,10 +153,10 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fIBN_swap()\fR exchanges the values of \fIa\fR and \fIb\fR.
|
||||
\&\fBBN_swap()\fR exchanges the values of \fIa\fR and \fIb\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_swap()\fR does not return a value.
|
||||
\&\fBBN_swap()\fR does not return a value.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BN_zero.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BN_zero.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BN_zero 3"
|
||||
.TH BN_zero 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BN_zero 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -159,34 +163,34 @@ libcrypto, -lcrypto
|
|||
\&\fB\s-1BN_ULONG\s0\fR is a macro that will be an unsigned integral type optimized
|
||||
for the most efficient implementation on the local platform.
|
||||
.PP
|
||||
\&\fIBN_zero()\fR, \fIBN_one()\fR and \fIBN_set_word()\fR set \fBa\fR to the values 0, 1 and
|
||||
\&\fBw\fR respectively. \fIBN_zero()\fR and \fIBN_one()\fR are macros.
|
||||
\&\fBBN_zero()\fR, \fBBN_one()\fR and \fBBN_set_word()\fR set \fBa\fR to the values 0, 1 and
|
||||
\&\fBw\fR respectively. \fBBN_zero()\fR and \fBBN_one()\fR are macros.
|
||||
.PP
|
||||
\&\fIBN_value_one()\fR returns a \fB\s-1BIGNUM\s0\fR constant of value 1. This constant
|
||||
\&\fBBN_value_one()\fR returns a \fB\s-1BIGNUM\s0\fR constant of value 1. This constant
|
||||
is useful for use in comparisons and assignment.
|
||||
.PP
|
||||
\&\fIBN_get_word()\fR returns \fBa\fR, if it can be represented as a \fB\s-1BN_ULONG\s0\fR.
|
||||
\&\fBBN_get_word()\fR returns \fBa\fR, if it can be represented as a \fB\s-1BN_ULONG\s0\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBN_get_word()\fR returns the value \fBa\fR, or all-bits-set if \fBa\fR cannot
|
||||
\&\fBBN_get_word()\fR returns the value \fBa\fR, or all-bits-set if \fBa\fR cannot
|
||||
be represented as a single integer.
|
||||
.PP
|
||||
\&\fIBN_one()\fR and \fIBN_set_word()\fR return 1 on success, 0 otherwise.
|
||||
\&\fIBN_value_one()\fR returns the constant.
|
||||
\&\fIBN_zero()\fR never fails and returns no value.
|
||||
\&\fBBN_one()\fR and \fBBN_set_word()\fR return 1 on success, 0 otherwise.
|
||||
\&\fBBN_value_one()\fR returns the constant.
|
||||
\&\fBBN_zero()\fR never fails and returns no value.
|
||||
.SH "BUGS"
|
||||
.IX Header "BUGS"
|
||||
If a \fB\s-1BIGNUM\s0\fR is equal to the value of all-bits-set, it will collide
|
||||
with the error condition returned by \fIBN_get_word()\fR which uses that
|
||||
with the error condition returned by \fBBN_get_word()\fR which uses that
|
||||
as an error value.
|
||||
.PP
|
||||
\&\fB\s-1BN_ULONG\s0\fR should probably be a typedef.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIBN_bn2bin\fR\|(3)
|
||||
\&\fBBN_bn2bin\fR\|(3)
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
In OpenSSL 0.9.8, \fIBN_zero()\fR was changed to not return a value; previous
|
||||
In OpenSSL 0.9.8, \fBBN_zero()\fR was changed to not return a value; previous
|
||||
versions returned an int.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: BUF_MEM_new.3,v 1.2 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: BUF_MEM_new.3,v 1.3 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "BUF_MEM_new 3"
|
||||
.TH BUF_MEM_new 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH BUF_MEM_new 3 "2019-03-12" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -163,39 +167,39 @@ libcrypto, -lcrypto
|
|||
The buffer library handles simple character arrays. Buffers are used for
|
||||
various purposes in the library, most notably memory BIOs.
|
||||
.PP
|
||||
\&\fIBUF_MEM_new()\fR allocates a new buffer of zero size.
|
||||
\&\fBBUF_MEM_new()\fR allocates a new buffer of zero size.
|
||||
.PP
|
||||
\&\fIBUF_MEM_new_ex()\fR allocates a buffer with the specified flags.
|
||||
\&\fBBUF_MEM_new_ex()\fR allocates a buffer with the specified flags.
|
||||
The flag \fB\s-1BUF_MEM_FLAG_SECURE\s0\fR specifies that the \fBdata\fR pointer
|
||||
should be allocated on the secure heap; see \fICRYPTO_secure_malloc\fR\|(3).
|
||||
should be allocated on the secure heap; see \fBCRYPTO_secure_malloc\fR\|(3).
|
||||
.PP
|
||||
\&\fIBUF_MEM_free()\fR frees up an already existing buffer. The data is zeroed
|
||||
\&\fBBUF_MEM_free()\fR frees up an already existing buffer. The data is zeroed
|
||||
before freeing up in case the buffer contains sensitive data.
|
||||
.PP
|
||||
\&\fIBUF_MEM_grow()\fR changes the size of an already existing buffer to
|
||||
\&\fBBUF_MEM_grow()\fR changes the size of an already existing buffer to
|
||||
\&\fBlen\fR. Any data already in the buffer is preserved if it increases in
|
||||
size.
|
||||
.PP
|
||||
\&\fIBUF_MEM_grow_clean()\fR is similar to \fIBUF_MEM_grow()\fR but it sets any free'd
|
||||
\&\fBBUF_MEM_grow_clean()\fR is similar to \fBBUF_MEM_grow()\fR but it sets any free'd
|
||||
or additionally-allocated memory to zero.
|
||||
.PP
|
||||
\&\fIBUF_reverse()\fR reverses \fBsize\fR bytes at \fBin\fR into \fBout\fR. If \fBin\fR
|
||||
\&\fBBUF_reverse()\fR reverses \fBsize\fR bytes at \fBin\fR into \fBout\fR. If \fBin\fR
|
||||
is \s-1NULL,\s0 the array is reversed in-place.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fIBUF_MEM_new()\fR returns the buffer or \s-1NULL\s0 on error.
|
||||
\&\fBBUF_MEM_new()\fR returns the buffer or \s-1NULL\s0 on error.
|
||||
.PP
|
||||
\&\fIBUF_MEM_free()\fR has no return value.
|
||||
\&\fBBUF_MEM_free()\fR has no return value.
|
||||
.PP
|
||||
\&\fIBUF_MEM_grow()\fR and \fIBUF_MEM_grow_clean()\fR return
|
||||
\&\fBBUF_MEM_grow()\fR and \fBBUF_MEM_grow_clean()\fR return
|
||||
zero on error or the new size (i.e., \fBlen\fR).
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIbio\fR\|(7),
|
||||
\&\fICRYPTO_secure_malloc\fR\|(3).
|
||||
\&\fBbio\fR\|(7),
|
||||
\&\fBCRYPTO_secure_malloc\fR\|(3).
|
||||
.SH "HISTORY"
|
||||
.IX Header "HISTORY"
|
||||
\&\fIBUF_MEM_new_ex()\fR was added in OpenSSL 1.1.0.
|
||||
The \fBBUF_MEM_new_ex()\fR function was added in OpenSSL 1.1.0.
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2000\-2018 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: CMS_add0_cert.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: CMS_add0_cert.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "CMS_add0_cert 3"
|
||||
.TH CMS_add0_cert 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH CMS_add0_cert 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -156,12 +160,12 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fICMS_add0_cert()\fR and \fICMS_add1_cert()\fR add certificate \fBcert\fR to \fBcms\fR.
|
||||
\&\fBCMS_add0_cert()\fR and \fBCMS_add1_cert()\fR add certificate \fBcert\fR to \fBcms\fR.
|
||||
must be of type signed data or enveloped data.
|
||||
.PP
|
||||
\&\fICMS_get1_certs()\fR returns all certificates in \fBcms\fR.
|
||||
\&\fBCMS_get1_certs()\fR returns all certificates in \fBcms\fR.
|
||||
.PP
|
||||
\&\fICMS_add0_crl()\fR and \fICMS_add1_crl()\fR add \s-1CRL \s0\fBcrl\fR to \fBcms\fR. \fICMS_get1_crls()\fR
|
||||
\&\fBCMS_add0_crl()\fR and \fBCMS_add1_crl()\fR add \s-1CRL\s0 \fBcrl\fR to \fBcms\fR. \fBCMS_get1_crls()\fR
|
||||
returns any CRLs in \fBcms\fR.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
|
@ -172,25 +176,25 @@ For signed data certificates and CRLs are added to the \fBcertificates\fR and
|
|||
\&\fBcrls\fR fields of SignedData structure. For enveloped data they are added to
|
||||
\&\fBOriginatorInfo\fR.
|
||||
.PP
|
||||
As the \fB0\fR implies \fICMS_add0_cert()\fR adds \fBcert\fR internally to \fBcms\fR and it
|
||||
must not be freed up after the call as opposed to \fICMS_add1_cert()\fR where \fBcert\fR
|
||||
As the \fB0\fR implies \fBCMS_add0_cert()\fR adds \fBcert\fR internally to \fBcms\fR and it
|
||||
must not be freed up after the call as opposed to \fBCMS_add1_cert()\fR where \fBcert\fR
|
||||
must be freed up.
|
||||
.PP
|
||||
The same certificate or \s-1CRL\s0 must not be added to the same cms structure more
|
||||
than once.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fICMS_add0_cert()\fR, \fICMS_add1_cert()\fR and \fICMS_add0_crl()\fR and \fICMS_add1_crl()\fR return
|
||||
\&\fBCMS_add0_cert()\fR, \fBCMS_add1_cert()\fR and \fBCMS_add0_crl()\fR and \fBCMS_add1_crl()\fR return
|
||||
1 for success and 0 for failure.
|
||||
.PP
|
||||
\&\fICMS_get1_certs()\fR and \fICMS_get1_crls()\fR return the \s-1STACK\s0 of certificates or CRLs
|
||||
\&\fBCMS_get1_certs()\fR and \fBCMS_get1_crls()\fR return the \s-1STACK\s0 of certificates or CRLs
|
||||
or \s-1NULL\s0 if there are none or an error occurs. The only error which will occur
|
||||
in practice is if the \fBcms\fR type is invalid.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3),
|
||||
\&\fICMS_sign\fR\|(3),
|
||||
\&\fICMS_encrypt\fR\|(3)
|
||||
\&\fBERR_get_error\fR\|(3),
|
||||
\&\fBCMS_sign\fR\|(3),
|
||||
\&\fBCMS_encrypt\fR\|(3)
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2008\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
.\" $NetBSD: CMS_add1_recipient_cert.3,v 1.18 2018/09/23 13:33:06 christos Exp $
|
||||
.\" $NetBSD: CMS_add1_recipient_cert.3,v 1.19 2019/06/09 18:44:31 christos Exp $
|
||||
.\"
|
||||
.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32)
|
||||
.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35)
|
||||
.\"
|
||||
.\" Standard preamble:
|
||||
.\" ========================================================================
|
||||
|
@ -56,16 +56,20 @@
|
|||
.\" Avoid warning from groff about undefined register 'F'.
|
||||
.de IX
|
||||
..
|
||||
.if !\nF .nr F 0
|
||||
.if \nF>0 \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
.nr rF 0
|
||||
.if \n(.g .if rF .nr rF 1
|
||||
.if (\n(rF:(\n(.g==0)) \{\
|
||||
. if \nF \{\
|
||||
. de IX
|
||||
. tm Index:\\$1\t\\n%\t"\\$2"
|
||||
..
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. if !\nF==2 \{\
|
||||
. nr % 0
|
||||
. nr F 2
|
||||
. \}
|
||||
. \}
|
||||
.\}
|
||||
.rr rF
|
||||
.\"
|
||||
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
|
||||
.\" Fear. Run. Save yourself. No user-serviceable parts.
|
||||
|
@ -131,7 +135,7 @@
|
|||
.\" ========================================================================
|
||||
.\"
|
||||
.IX Title "CMS_add1_recipient_cert 3"
|
||||
.TH CMS_add1_recipient_cert 3 "2018-09-17" "1.1.1" "OpenSSL"
|
||||
.TH CMS_add1_recipient_cert 3 "2018-09-23" "1.1.1c" "OpenSSL"
|
||||
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
|
||||
.\" way too many mistakes in technical documents.
|
||||
.if n .ad l
|
||||
|
@ -157,20 +161,20 @@ libcrypto, -lcrypto
|
|||
.Ve
|
||||
.SH "DESCRIPTION"
|
||||
.IX Header "DESCRIPTION"
|
||||
\&\fICMS_add1_recipient_cert()\fR adds recipient \fBrecip\fR to CMS_ContentInfo enveloped
|
||||
\&\fBCMS_add1_recipient_cert()\fR adds recipient \fBrecip\fR to CMS_ContentInfo enveloped
|
||||
data structure \fBcms\fR as a KeyTransRecipientInfo structure.
|
||||
.PP
|
||||
\&\fICMS_add0_recipient_key()\fR adds symmetric key \fBkey\fR of length \fBkeylen\fR using
|
||||
\&\fBCMS_add0_recipient_key()\fR adds symmetric key \fBkey\fR of length \fBkeylen\fR using
|
||||
wrapping algorithm \fBnid\fR, identifier \fBid\fR of length \fBidlen\fR and optional
|
||||
values \fBdate\fR, \fBotherTypeId\fR and \fBotherType\fR to CMS_ContentInfo enveloped
|
||||
data structure \fBcms\fR as a KEKRecipientInfo structure.
|
||||
.PP
|
||||
The CMS_ContentInfo structure should be obtained from an initial call to
|
||||
\&\fICMS_encrypt()\fR with the flag \fB\s-1CMS_PARTIAL\s0\fR set.
|
||||
\&\fBCMS_encrypt()\fR with the flag \fB\s-1CMS_PARTIAL\s0\fR set.
|
||||
.SH "NOTES"
|
||||
.IX Header "NOTES"
|
||||
The main purpose of this function is to provide finer control over a \s-1CMS\s0
|
||||
enveloped data structure where the simpler \fICMS_encrypt()\fR function defaults are
|
||||
enveloped data structure where the simpler \fBCMS_encrypt()\fR function defaults are
|
||||
not appropriate. For example if one or more KEKRecipientInfo structures
|
||||
need to be added. New attributes can also be added using the returned
|
||||
CMS_RecipientInfo structure and the \s-1CMS\s0 attribute utility functions.
|
||||
|
@ -186,13 +190,13 @@ If \fBnid\fR is set to \fBNID_undef\fR then an \s-1AES\s0 wrap algorithm will be
|
|||
consistent with \fBkeylen\fR.
|
||||
.SH "RETURN VALUES"
|
||||
.IX Header "RETURN VALUES"
|
||||
\&\fICMS_add1_recipient_cert()\fR and \fICMS_add0_recipient_key()\fR return an internal
|
||||
\&\fBCMS_add1_recipient_cert()\fR and \fBCMS_add0_recipient_key()\fR return an internal
|
||||
pointer to the CMS_RecipientInfo structure just added or \s-1NULL\s0 if an error
|
||||
occurs.
|
||||
.SH "SEE ALSO"
|
||||
.IX Header "SEE ALSO"
|
||||
\&\fIERR_get_error\fR\|(3), \fICMS_decrypt\fR\|(3),
|
||||
\&\fICMS_final\fR\|(3),
|
||||
\&\fBERR_get_error\fR\|(3), \fBCMS_decrypt\fR\|(3),
|
||||
\&\fBCMS_final\fR\|(3),
|
||||
.SH "COPYRIGHT"
|
||||
.IX Header "COPYRIGHT"
|
||||
Copyright 2008\-2016 The OpenSSL Project Authors. All Rights Reserved.
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue