sync with OpenBSD -current
This commit is contained in:
parent
2d01e1a152
commit
f6cff6bc9b
@ -1929,7 +1929,6 @@
|
||||
./usr/share/man/man3/EVP_PKEY_CTX_new.3
|
||||
./usr/share/man/man3/EVP_PKEY_CTX_set_hkdf_md.3
|
||||
./usr/share/man/man3/EVP_PKEY_CTX_set_tls1_prf_md.3
|
||||
./usr/share/man/man3/EVP_PKEY_add1_attr.3
|
||||
./usr/share/man/man3/EVP_PKEY_asn1_get_count.3
|
||||
./usr/share/man/man3/EVP_PKEY_asn1_new.3
|
||||
./usr/share/man/man3/EVP_PKEY_check.3
|
||||
@ -2178,7 +2177,6 @@
|
||||
./usr/share/man/man3/STACK_OF.3
|
||||
./usr/share/man/man3/SipHash24_Init.3
|
||||
./usr/share/man/man3/TS_REQ_new.3
|
||||
./usr/share/man/man3/UI_UTIL_read_pw.3
|
||||
./usr/share/man/man3/UI_create_method.3
|
||||
./usr/share/man/man3/UI_get_string_type.3
|
||||
./usr/share/man/man3/UI_new.3
|
||||
|
@ -11,7 +11,6 @@
|
||||
/usr/share/games/quiz.db/elements:symbol:number:weight:element
|
||||
/usr/share/games/quiz.db/europe:Europe{an}:cap{ital}
|
||||
/usr/share/games/quiz.db/flowers:flower{s}:meaning
|
||||
/usr/share/games/quiz.db/ship:description:part
|
||||
/usr/share/games/quiz.db/inca:inca:succ{essor}
|
||||
/usr/share/games/quiz.db/latin:latin:english
|
||||
/usr/share/games/quiz.db/locomotive:locomotive:name
|
||||
@ -26,6 +25,7 @@
|
||||
/usr/share/games/quiz.db/seq-easy:easy{-}{seq{uence}}:next:name
|
||||
/usr/share/games/quiz.db/seq-hard:hard{-}{seq{uence}}:next:name
|
||||
/usr/share/games/quiz.db/sexes:male:female
|
||||
/usr/share/games/quiz.db/ship:ship:part
|
||||
/usr/share/games/quiz.db/sov:sov{ereign}:cen{t{ury}}:succ{essor}
|
||||
/usr/share/games/quiz.db/state:state:cap{ital}:abbr{ev{iation}}:flower:bird:tree
|
||||
/usr/share/games/quiz.db/trek:star:trek
|
||||
|
@ -14,14 +14,14 @@
|
||||
2-323:form of bill of lading required in overseas shipment
|
||||
2-401:passing of title; reservation for security
|
||||
2-402:rights of seller's creditors against sold goods
|
||||
2-403:powr to transfer; good faith purchase of goods; entrusting
|
||||
2-403:power to transfer; good faith purchase of goods; entrusting
|
||||
2-501:insurable interest in goods; manner of identification of goods
|
||||
2-502:buyer's right to goods on seller's insolvency
|
||||
2-503:manner of seller's tender of delivery
|
||||
2-506:rights of financing agency
|
||||
2-507:effect of seller's tender; delivery on condition
|
||||
2-508:cure by seller of improper tender or delivery; replacement
|
||||
2-509:risk of loss in the absence ogf breach
|
||||
2-509:risk of loss in the absence of breach
|
||||
2-510:effect of breach on risk of loss
|
||||
2-513:buyer's right to inspection of goods
|
||||
2-601:buyer's rights on improper delivery
|
||||
@ -35,7 +35,7 @@
|
||||
2-610:anticipatory repudiation
|
||||
2-611:retraction of anticipatory repudiation
|
||||
2-612:installment contract; breach
|
||||
2-702:seller's remedies on discovery o buyer's insolvency
|
||||
2-702:seller's remedies on discovery of buyer's insolvency
|
||||
2-703:seller's remedies in general
|
||||
2-705:seller's stoppage of delivery in transit or otherwise
|
||||
2-706:seller's resale including contract for resale
|
||||
@ -92,7 +92,7 @@
|
||||
4-407:payor bank's right to subrogation on improper payment
|
||||
5-111:warranties on transfer and presentment (letters of credit)
|
||||
5-114:issuer's duty and privilege to honor; right to reimbursement
|
||||
5-115:remedy for improper dishonor or anticipatory repudiaion (letters of credit)
|
||||
5-115:remedy for improper dishonor or anticipatory repudiation (letters of credit)
|
||||
7-104:negotiable and non-negotiable warehouse receipt, bill of lading, other title
|
||||
7-204:duty of care; contractual limitation of warehouseperson's liability
|
||||
7-301:liability for non-receipt or misdescription
|
||||
@ -109,7 +109,7 @@
|
||||
9-109:classification of goods; consumer goods; equipment; farm products; inventory
|
||||
9-113:security interests arising under article on sales
|
||||
9-203:attachment and enforceability of security interest; proceeds; formal requisites
|
||||
9-206:agreement not to asserr defenses against assignee; modification of sales warranties
|
||||
9-206:agreement not to assert defenses against assignee; modification of sales warranties
|
||||
9-301:persons who take priority over unperfected security interests
|
||||
9-302:when filing is required to perfect security interest
|
||||
9-303:when security interest is perfected
|
||||
@ -117,7 +117,7 @@
|
||||
9-305:when possession by secured party perfects security interest without filing
|
||||
9-306:proceeds; secured party's rights on disposition of collateral
|
||||
9-307:protection of buyers of goods
|
||||
9-310:periority of certain liens arising by operation of law (mechanic's liens)
|
||||
9-310:priority of certain liens arising by operation of law (mechanic's liens)
|
||||
9-311:alienability of debtor's rights; judicial process
|
||||
9-312:priorities among conflicting security interests in the same collateral
|
||||
9-405:assignment of security interest
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: conf_def.c,v 1.35 2024/08/18 17:50:10 tb Exp $ */
|
||||
/* $OpenBSD: conf_def.c,v 1.36 2024/08/24 12:08:49 tb Exp $ */
|
||||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
|
||||
* All rights reserved.
|
||||
*
|
||||
@ -658,7 +658,7 @@ static CONF_METHOD default_method = {
|
||||
.dump = def_dump,
|
||||
.is_number = def_is_number,
|
||||
.to_int = def_to_int,
|
||||
.load = def_load
|
||||
.load = def_load,
|
||||
};
|
||||
|
||||
static CONF_METHOD WIN32_method = {
|
||||
@ -671,7 +671,7 @@ static CONF_METHOD WIN32_method = {
|
||||
def_dump,
|
||||
def_is_number,
|
||||
def_to_int,
|
||||
def_load
|
||||
def_load,
|
||||
};
|
||||
|
||||
CONF_METHOD *
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ui.h,v 1.3 2023/07/05 21:14:54 bcook Exp $ */
|
||||
/* $OpenBSD: ui.h,v 1.4 2024/08/24 07:51:19 tb Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2022 Bob Beck <beck@openbsd.org>
|
||||
*
|
||||
@ -75,8 +75,8 @@ LCRYPTO_USED(UI_get0_test_string);
|
||||
LCRYPTO_USED(UI_get_result_minsize);
|
||||
LCRYPTO_USED(UI_get_result_maxsize);
|
||||
LCRYPTO_USED(UI_set_result);
|
||||
LCRYPTO_USED(UI_UTIL_read_pw_string);
|
||||
LCRYPTO_USED(UI_UTIL_read_pw);
|
||||
LCRYPTO_UNUSED(UI_UTIL_read_pw_string);
|
||||
LCRYPTO_UNUSED(UI_UTIL_read_pw);
|
||||
LCRYPTO_USED(ERR_load_UI_strings);
|
||||
LCRYPTO_USED(UI_method_get_prompt_constructor);
|
||||
|
||||
|
@ -1,188 +0,0 @@
|
||||
.\" $OpenBSD: EVP_PKEY_add1_attr.3,v 1.3 2021/10/26 18:50:38 jmc Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
.\" Permission to use, copy, modify, and distribute this software for any
|
||||
.\" purpose with or without fee is hereby granted, provided that the above
|
||||
.\" copyright notice and this permission notice appear in all copies.
|
||||
.\"
|
||||
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: October 26 2021 $
|
||||
.Dt EVP_PKEY_ADD1_ATTR 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm EVP_PKEY_add1_attr ,
|
||||
.Nm EVP_PKEY_add1_attr_by_OBJ ,
|
||||
.Nm EVP_PKEY_add1_attr_by_NID ,
|
||||
.Nm EVP_PKEY_add1_attr_by_txt ,
|
||||
.Nm EVP_PKEY_delete_attr ,
|
||||
.Nm EVP_PKEY_get_attr ,
|
||||
.Nm EVP_PKEY_get_attr_count ,
|
||||
.Nm EVP_PKEY_get_attr_by_OBJ ,
|
||||
.Nm EVP_PKEY_get_attr_by_NID
|
||||
.Nd X.501 Attributes of private keys
|
||||
.Sh SYNOPSIS
|
||||
.In openssl/x509.h
|
||||
.Ft int
|
||||
.Fo EVP_PKEY_add1_attr
|
||||
.Fa "EVP_PKEY *key"
|
||||
.Fa "X509_ATTRIBUTE *attr"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_PKEY_add1_attr_by_OBJ
|
||||
.Fa "EVP_PKEY *key"
|
||||
.Fa "const ASN1_OBJECT *obj"
|
||||
.Fa "int type"
|
||||
.Fa "const unsigned char *data"
|
||||
.Fa "int len"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_PKEY_add1_attr_by_NID
|
||||
.Fa "EVP_PKEY *key"
|
||||
.Fa "int nid"
|
||||
.Fa "int type"
|
||||
.Fa "const unsigned char *data"
|
||||
.Fa "int len"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_PKEY_add1_attr_by_txt
|
||||
.Fa "EVP_PKEY *key"
|
||||
.Fa "const char *name"
|
||||
.Fa "int type"
|
||||
.Fa "const unsigned char *data"
|
||||
.Fa "int len"
|
||||
.Fc
|
||||
.Ft X509_ATTRIBUTE *
|
||||
.Fo EVP_PKEY_delete_attr
|
||||
.Fa "EVP_PKEY *key"
|
||||
.Fa "int index"
|
||||
.Fc
|
||||
.Ft X509_ATTRIBUTE *
|
||||
.Fo EVP_PKEY_get_attr
|
||||
.Fa "const EVP_PKEY *key"
|
||||
.Fa "int index"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_PKEY_get_attr_count
|
||||
.Fa "const EVP_PKEY *key"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_PKEY_get_attr_by_OBJ
|
||||
.Fa "const EVP_PKEY *key"
|
||||
.Fa "const ASN1_OBJECT *obj"
|
||||
.Fa "int start_after"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo EVP_PKEY_get_attr_by_NID
|
||||
.Fa "const EVP_PKEY *key"
|
||||
.Fa "int nid"
|
||||
.Fa "int start_after"
|
||||
.Fc
|
||||
.Sh DESCRIPTION
|
||||
These functions support associating an array of X.501 Attributes
|
||||
with a private key.
|
||||
Such attributes can for example be included in PKCS#12 structures.
|
||||
.Pp
|
||||
.Fn EVP_PKEY_add1_attr
|
||||
appends a deep copy of the
|
||||
.Fa attr
|
||||
using
|
||||
.Xr X509at_add1_attr 3 .
|
||||
.Pp
|
||||
.Fn EVP_PKEY_add1_attr_by_OBJ ,
|
||||
.Fn EVP_PKEY_add1_attr_by_NID ,
|
||||
and
|
||||
.Fn EVP_PKEY_add1_attr_by_txt
|
||||
create a new X.501 Attribute object using
|
||||
.Xr X509_ATTRIBUTE_create_by_OBJ 3 ,
|
||||
.Xr X509_ATTRIBUTE_create_by_NID 3 ,
|
||||
or
|
||||
.Xr X509_ATTRIBUTE_create_by_txt 3 ,
|
||||
respectively, and append it using
|
||||
.Xr X509at_add1_attr 3 .
|
||||
.Pp
|
||||
.Fn EVP_PKEY_delete_attr
|
||||
deletes the attribute with the zero-based
|
||||
.Fa index
|
||||
using
|
||||
.Xr X509at_delete_attr 3 .
|
||||
.Pp
|
||||
.Fn EVP_PKEY_get_attr
|
||||
returns the attribute with the zero-based
|
||||
.Fa index
|
||||
using
|
||||
.Xr X509at_get_attr 3 .
|
||||
.Pp
|
||||
.Fn EVP_PKEY_get_attr_count
|
||||
returns the number of attributes currently associated with the
|
||||
.Fa key
|
||||
using
|
||||
.Xr X509at_get_attr_count 3 .
|
||||
.Pp
|
||||
.Fn EVP_PKEY_get_attr_by_OBJ
|
||||
and
|
||||
.Fn EVP_PKEY_get_attr_by_NID
|
||||
search for an attribute of the type
|
||||
.Fa obj
|
||||
or
|
||||
.Fa nid
|
||||
using
|
||||
.Xr X509at_get_attr_by_OBJ 3
|
||||
or
|
||||
.Xr X509at_get_attr_by_NID 3 ,
|
||||
respectively.
|
||||
.Sh RETURN VALUES
|
||||
.Fn EVP_PKEY_add1_attr ,
|
||||
.Fn EVP_PKEY_add1_attr_by_OBJ ,
|
||||
.Fn EVP_PKEY_add1_attr_by_NID ,
|
||||
and
|
||||
.Fn EVP_PKEY_add1_attr_by_txt
|
||||
return 1 for success or 0 for failure.
|
||||
.Pp
|
||||
.Fn EVP_PKEY_delete_attr
|
||||
and
|
||||
.Fn EVP_PKEY_get_attr
|
||||
return the deleted or requested attribute or
|
||||
.Dv NULL
|
||||
if the requested index is negative or greater than or equal to
|
||||
the current number of attributes associated with the
|
||||
.Fa key .
|
||||
.Pp
|
||||
.Fn EVP_PKEY_get_attr_count
|
||||
returns the current number of attributes.
|
||||
.Pp
|
||||
.Fn EVP_PKEY_get_attr_by_OBJ
|
||||
and
|
||||
.Fn EVP_PKEY_get_attr_by_NID
|
||||
return the index of the first attribute that has an index greater than
|
||||
.Fa start_after
|
||||
and a type matching
|
||||
.Fa obj
|
||||
or
|
||||
.Fa nid ,
|
||||
respectively, or \-1 on failure.
|
||||
In addition,
|
||||
.Fn EVP_PKEY_get_attr_by_NID
|
||||
returns \-2 if
|
||||
.Xr OBJ_nid2obj 3
|
||||
fails on the requested
|
||||
.Fa nid .
|
||||
.Sh SEE ALSO
|
||||
.Xr EVP_PKEY_new 3 ,
|
||||
.Xr OBJ_nid2obj 3 ,
|
||||
.Xr PKCS12_create 3 ,
|
||||
.Xr X509_ATTRIBUTE_create_by_OBJ 3 ,
|
||||
.Xr X509_ATTRIBUTE_new 3 ,
|
||||
.Xr X509at_add1_attr 3 ,
|
||||
.Xr X509at_get_attr 3
|
||||
.Sh HISTORY
|
||||
These functions first appeared in OpenSSL 0.9.8
|
||||
and have been available since
|
||||
.Ox 4.5 .
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: EVP_PKEY_new.3,v 1.19 2024/07/21 08:36:43 tb Exp $
|
||||
.\" $OpenBSD: EVP_PKEY_new.3,v 1.20 2024/08/24 09:15:36 tb Exp $
|
||||
.\" full merge up to: OpenSSL 4dcfdfce May 27 11:50:05 2020 +0100
|
||||
.\"
|
||||
.\" This file is a derived work.
|
||||
@ -66,7 +66,7 @@
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: July 21 2024 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt EVP_PKEY_NEW 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -269,7 +269,6 @@ return 1 for success or 0 for failure.
|
||||
.Xr d2i_PrivateKey 3 ,
|
||||
.Xr evp 3 ,
|
||||
.Xr EVP_PKCS82PKEY 3 ,
|
||||
.Xr EVP_PKEY_add1_attr 3 ,
|
||||
.Xr EVP_PKEY_asn1_new 3 ,
|
||||
.Xr EVP_PKEY_check 3 ,
|
||||
.Xr EVP_PKEY_cmp 3 ,
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $OpenBSD: Makefile,v 1.289 2024/08/17 09:16:37 tb Exp $
|
||||
# $OpenBSD: Makefile,v 1.291 2024/08/24 09:15:36 tb Exp $
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
@ -177,7 +177,6 @@ MAN= \
|
||||
EVP_PKEY_CTX_new.3 \
|
||||
EVP_PKEY_CTX_set_hkdf_md.3 \
|
||||
EVP_PKEY_CTX_set_tls1_prf_md.3 \
|
||||
EVP_PKEY_add1_attr.3 \
|
||||
EVP_PKEY_asn1_get_count.3 \
|
||||
EVP_PKEY_asn1_new.3 \
|
||||
EVP_PKEY_check.3 \
|
||||
@ -300,7 +299,6 @@ MAN= \
|
||||
SMIME_write_PKCS7.3 \
|
||||
STACK_OF.3 \
|
||||
TS_REQ_new.3 \
|
||||
UI_UTIL_read_pw.3 \
|
||||
UI_create_method.3 \
|
||||
UI_get_string_type.3 \
|
||||
UI_new.3 \
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: OCSP_cert_to_id.3,v 1.12 2022/03/31 17:27:17 naddy Exp $
|
||||
.\" $OpenBSD: OCSP_cert_to_id.3,v 1.13 2024/08/24 19:31:09 tb Exp $
|
||||
.\" OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
|
||||
.\"
|
||||
.\" This file is a derived work.
|
||||
@ -65,7 +65,7 @@
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: March 31 2022 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt OCSP_CERT_TO_ID 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -162,19 +162,25 @@ issuer key hash
|
||||
and serial number
|
||||
.Fa serialNumber .
|
||||
.Pp
|
||||
.Fn OCSP_id_cmp
|
||||
compares
|
||||
.Fn OCSP_id_issuer_cmp
|
||||
compares the hash algorithms,
|
||||
the hashed issuer distinguished names and
|
||||
the hashed public keys of
|
||||
.Vt OCSP_CERTID
|
||||
.Fa a
|
||||
and
|
||||
.Fa b .
|
||||
.Pp
|
||||
.Fn OCSP_id_issuer_cmp
|
||||
compares only the issuer name of
|
||||
.Fn OCSP_id_cmp
|
||||
compares
|
||||
.Vt OCSP_CERTID
|
||||
.Fa a
|
||||
and
|
||||
.Fa b .
|
||||
.Fa b
|
||||
using
|
||||
.Fn OCSP_id_issuer_cmp
|
||||
followed by a comparison of the certificate serial numbers with
|
||||
.Xr ASN1_INTEGER_cmp 3 .
|
||||
.Pp
|
||||
.Fn OCSP_id_get0_info
|
||||
returns the issuer name hash, hash OID, issuer key hash and serial
|
||||
@ -214,6 +220,7 @@ return 0 for a match or non-zero otherwise.
|
||||
.Fn OCSP_id_get0_info
|
||||
returns 1 for success or 0 for failure.
|
||||
.Sh SEE ALSO
|
||||
.Xr ASN1_INTEGER_cmp 3 ,
|
||||
.Xr EVP_DigestInit 3 ,
|
||||
.Xr OCSP_request_add1_nonce 3 ,
|
||||
.Xr OCSP_REQUEST_new 3 ,
|
||||
|
@ -1,107 +0,0 @@
|
||||
.\" $OpenBSD: UI_UTIL_read_pw.3,v 1.3 2018/03/22 21:08:22 schwarze Exp $
|
||||
.\" full merge up to: OpenSSL 23103a52 Jan 12 15:17:42 2017 +0100
|
||||
.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
|
||||
.\"
|
||||
.\" This file was written by Richard Levitte <levitte@openssl.org>.
|
||||
.\" Copyright (c) 2017 The OpenSSL Project. All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\"
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\"
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in
|
||||
.\" the documentation and/or other materials provided with the
|
||||
.\" distribution.
|
||||
.\"
|
||||
.\" 3. All advertising materials mentioning features or use of this
|
||||
.\" software must display the following acknowledgment:
|
||||
.\" "This product includes software developed by the OpenSSL Project
|
||||
.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
|
||||
.\"
|
||||
.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
|
||||
.\" endorse or promote products derived from this software without
|
||||
.\" prior written permission. For written permission, please contact
|
||||
.\" openssl-core@openssl.org.
|
||||
.\"
|
||||
.\" 5. Products derived from this software may not be called "OpenSSL"
|
||||
.\" nor may "OpenSSL" appear in their names without prior written
|
||||
.\" permission of the OpenSSL Project.
|
||||
.\"
|
||||
.\" 6. Redistributions of any form whatsoever must retain the following
|
||||
.\" acknowledgment:
|
||||
.\" "This product includes software developed by the OpenSSL Project
|
||||
.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
|
||||
.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
|
||||
.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: March 22 2018 $
|
||||
.Dt UI_UTIL_READ_PW 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm UI_UTIL_read_pw ,
|
||||
.Nm UI_UTIL_read_pw_string
|
||||
.Nd get a password from the user
|
||||
.Sh SYNOPSIS
|
||||
.In openssl/ui.h
|
||||
.Ft int
|
||||
.Fo UI_UTIL_read_pw_string
|
||||
.Fa "char *buf"
|
||||
.Fa "int length"
|
||||
.Fa "const char *prompt"
|
||||
.Fa "int verify"
|
||||
.Fc
|
||||
.Ft int
|
||||
.Fo UI_UTIL_read_pw
|
||||
.Fa "char *buf"
|
||||
.Fa "char *buff"
|
||||
.Fa "int size"
|
||||
.Fa "const char *prompt"
|
||||
.Fa "int verify"
|
||||
.Fc
|
||||
.Sh DESCRIPTION
|
||||
.Fn UI_UTIL_read_pw_string
|
||||
asks for a passphrase, using
|
||||
.Fa prompt
|
||||
as a prompt, and stores it in
|
||||
.Fa buf .
|
||||
The maximum allowed size is given with
|
||||
.Fa length ,
|
||||
including the terminating NUL byte.
|
||||
If
|
||||
.Fa verify
|
||||
is non-zero, the password will be verified as well.
|
||||
.Pp
|
||||
.Fn UI_UTIL_read_pw
|
||||
does the same as
|
||||
.Fn UI_UTIL_read_pw_string ,
|
||||
but takes an external buffer
|
||||
.Fa buff
|
||||
for the verification passphrase.
|
||||
.Sh RETURN VALUES
|
||||
.Fn UI_UTIL_read_pw_string
|
||||
and
|
||||
.Fn UI_UTIL_read_pw
|
||||
return 0 on success or a negative value on error.
|
||||
.Sh SEE ALSO
|
||||
.Xr UI_new 3
|
||||
.Sh HISTORY
|
||||
.Fn UI_UTIL_read_pw
|
||||
and
|
||||
.Fn UI_UTIL_read_pw_string
|
||||
first appeared in OpenSSL 0.9.7 and have been available since
|
||||
.Ox 3.2 .
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: UI_new.3,v 1.11 2022/12/17 22:23:31 tb Exp $
|
||||
.\" $OpenBSD: UI_new.3,v 1.12 2024/08/24 07:48:37 tb Exp $
|
||||
.\" full merge up to: OpenSSL 78b19e90 Jan 11 00:12:01 2017 +0100
|
||||
.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800
|
||||
.\"
|
||||
@ -49,7 +49,7 @@
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: December 17 2022 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt UI_NEW 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -515,8 +515,7 @@ argument.
|
||||
.Sh SEE ALSO
|
||||
.Xr crypto 3 ,
|
||||
.Xr UI_create_method 3 ,
|
||||
.Xr UI_get_string_type 3 ,
|
||||
.Xr UI_UTIL_read_pw 3
|
||||
.Xr UI_get_string_type 3
|
||||
.Sh HISTORY
|
||||
These functions first appeared in OpenSSL 0.9.7
|
||||
and have been available since
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.16 2021/10/26 12:56:48 schwarze Exp $
|
||||
.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.17 2024/08/24 09:15:36 tb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
@ -14,7 +14,7 @@
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: October 26 2021 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt X509_ATTRIBUTE_NEW 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -111,7 +111,6 @@ fails on
|
||||
.Fa nid .
|
||||
.Sh SEE ALSO
|
||||
.Xr d2i_X509_ATTRIBUTE 3 ,
|
||||
.Xr EVP_PKEY_add1_attr 3 ,
|
||||
.Xr OBJ_nid2obj 3 ,
|
||||
.Xr PKCS12_SAFEBAG_new 3 ,
|
||||
.Xr PKCS7_add_attribute 3 ,
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: X509at_add1_attr.3,v 1.5 2021/10/26 12:56:48 schwarze Exp $
|
||||
.\" $OpenBSD: X509at_add1_attr.3,v 1.6 2024/08/24 09:15:36 tb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
@ -14,7 +14,7 @@
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: October 26 2021 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt X509AT_ADD1_ATTR 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -120,7 +120,6 @@ or if the requested
|
||||
is negative or greater than or equal to the number of objects in
|
||||
.Pf * Fa attrs .
|
||||
.Sh SEE ALSO
|
||||
.Xr EVP_PKEY_add1_attr 3 ,
|
||||
.Xr OBJ_nid2obj 3 ,
|
||||
.Xr PKCS8_pkey_add1_attr_by_NID 3 ,
|
||||
.Xr STACK_OF 3 ,
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: X509at_get_attr.3,v 1.7 2022/03/28 08:18:13 claudio Exp $
|
||||
.\" $OpenBSD: X509at_get_attr.3,v 1.9 2024/08/24 09:23:09 tb Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
|
||||
.\"
|
||||
@ -14,7 +14,7 @@
|
||||
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
.\"
|
||||
.Dd $Mdocdate: March 28 2022 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt X509AT_GET_ATTR 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -138,14 +138,12 @@ or
|
||||
.Dv NULL
|
||||
on failure.
|
||||
.Sh SEE ALSO
|
||||
.Xr EVP_PKEY_get_attr 3 ,
|
||||
.Xr OBJ_nid2obj 3 ,
|
||||
.Xr PKCS8_pkey_get0_attrs 3 ,
|
||||
.Xr STACK_OF 3 ,
|
||||
.Xr X509_ATTRIBUTE_get0_data 3 ,
|
||||
.Xr X509_ATTRIBUTE_new 3 ,
|
||||
.Xr X509_REQ_get_attr 3 ,
|
||||
.Xr X509at_add1_attr 3
|
||||
.Xr X509_REQ_get_attr 3
|
||||
.Sh HISTORY
|
||||
.Fn X509at_get_attr ,
|
||||
.Fn X509at_get_attr_count ,
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: des_read_pw.3,v 1.11 2023/09/10 13:58:46 schwarze Exp $
|
||||
.\" $OpenBSD: des_read_pw.3,v 1.12 2024/08/24 07:48:37 tb Exp $
|
||||
.\" full merge up to: OpenSSL doc/crypto/des.pod
|
||||
.\" 53934822 Jun 9 16:39:19 2016 -0400
|
||||
.\"
|
||||
@ -66,7 +66,7 @@
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: September 10 2023 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt DES_READ_PW 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -99,11 +99,6 @@
|
||||
.Ft char *
|
||||
.Fn EVP_get_pw_prompt void
|
||||
.Sh DESCRIPTION
|
||||
These functions are deprecated.
|
||||
Use
|
||||
.Xr UI_UTIL_read_pw 3
|
||||
instead.
|
||||
.Pp
|
||||
.Fn EVP_read_pw_string
|
||||
writes the
|
||||
.Fa prompt
|
||||
@ -185,8 +180,7 @@ returns an internal pointer to static memory containing the default prompt, or
|
||||
.Dv NULL
|
||||
if no default prompt is set.
|
||||
.Sh SEE ALSO
|
||||
.Xr UI_new 3 ,
|
||||
.Xr UI_UTIL_read_pw 3
|
||||
.Xr UI_new 3
|
||||
.Sh HISTORY
|
||||
.Fn EVP_read_pw_string
|
||||
first appeared in SSLeay 0.5.1 and
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: evp.3,v 1.30 2024/03/19 17:34:05 tb Exp $
|
||||
.\" $OpenBSD: evp.3,v 1.31 2024/08/24 09:15:36 tb Exp $
|
||||
.\" full merge up to: OpenSSL man7/evp 24a535ea Sep 22 13:14:20 2020 +0100
|
||||
.\"
|
||||
.\" This file was written by Ulf Moeller <ulf@openssl.org>,
|
||||
@ -51,7 +51,7 @@
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
.\" OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: March 19 2024 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt EVP 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -189,7 +189,6 @@ family of functions provides base64 encoding and decoding.
|
||||
.Xr EVP_MD_nid 3 ,
|
||||
.Xr EVP_OpenInit 3 ,
|
||||
.Xr EVP_PKCS82PKEY 3 ,
|
||||
.Xr EVP_PKEY_add1_attr 3 ,
|
||||
.Xr EVP_PKEY_asn1_get_count 3 ,
|
||||
.Xr EVP_PKEY_asn1_new 3 ,
|
||||
.Xr EVP_PKEY_check 3 ,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ui_util.c,v 1.15 2024/08/08 09:56:51 tb Exp $ */
|
||||
/* $OpenBSD: ui_util.c,v 1.16 2024/08/24 07:50:23 tb Exp $ */
|
||||
/* ====================================================================
|
||||
* Copyright (c) 2001-2002 The OpenSSL Project. All rights reserved.
|
||||
*
|
||||
@ -58,40 +58,18 @@
|
||||
|
||||
#include <openssl/ui.h>
|
||||
|
||||
/* XXX - remove in next bump. */
|
||||
|
||||
int
|
||||
UI_UTIL_read_pw_string(char *buf, int length, const char *prompt, int verify)
|
||||
{
|
||||
char buff[BUFSIZ];
|
||||
int ret;
|
||||
|
||||
ret = UI_UTIL_read_pw(buf, buff, (length > BUFSIZ) ? BUFSIZ : length,
|
||||
prompt, verify);
|
||||
explicit_bzero(buff, BUFSIZ);
|
||||
return (ret);
|
||||
return -1;
|
||||
}
|
||||
LCRYPTO_ALIAS(UI_UTIL_read_pw_string);
|
||||
|
||||
int
|
||||
UI_UTIL_read_pw(char *buf, char *buff, int size, const char *prompt, int verify)
|
||||
{
|
||||
int ok = 0;
|
||||
UI *ui;
|
||||
|
||||
if (size < 1)
|
||||
return -1;
|
||||
|
||||
ui = UI_new();
|
||||
if (ui) {
|
||||
ok = UI_add_input_string(ui, prompt, 0, buf, 0, size - 1);
|
||||
if (ok >= 0 && verify)
|
||||
ok = UI_add_verify_string(ui, prompt, 0, buff, 0,
|
||||
size - 1, buf);
|
||||
if (ok >= 0)
|
||||
ok = UI_process(ui);
|
||||
UI_free(ui);
|
||||
}
|
||||
if (ok > 0)
|
||||
ok = 0;
|
||||
return (ok);
|
||||
return -1;
|
||||
}
|
||||
LCRYPTO_ALIAS(UI_UTIL_read_pw);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: control.c,v 1.9 2021/03/20 16:46:03 kn Exp $ */
|
||||
/* $OpenBSD: control.c,v 1.11 2024/08/24 16:34:23 florian Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
|
||||
@ -225,6 +225,8 @@ control_dispatch_imsg(int fd, short event, void *bula)
|
||||
struct imsg imsg;
|
||||
ssize_t n;
|
||||
int verbose;
|
||||
uint32_t if_index, type;
|
||||
pid_t pid;
|
||||
|
||||
if ((c = control_connbyfd(fd)) == NULL) {
|
||||
log_warnx("%s: fd %d: not found", __func__, fd);
|
||||
@ -253,37 +255,34 @@ control_dispatch_imsg(int fd, short event, void *bula)
|
||||
if (n == 0)
|
||||
break;
|
||||
|
||||
switch (imsg.hdr.type) {
|
||||
type = imsg_get_type(&imsg);
|
||||
pid = imsg_get_pid(&imsg);
|
||||
switch (type) {
|
||||
case IMSG_CTL_LOG_VERBOSE:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(verbose))
|
||||
if (imsg_get_data(&imsg, &verbose,
|
||||
sizeof(verbose)) == -1)
|
||||
break;
|
||||
|
||||
/* Forward to all other processes. */
|
||||
frontend_imsg_compose_main(imsg.hdr.type, imsg.hdr.pid,
|
||||
imsg.data, IMSG_DATA_SIZE(imsg));
|
||||
frontend_imsg_compose_engine(imsg.hdr.type, 0,
|
||||
imsg.hdr.pid, imsg.data, IMSG_DATA_SIZE(imsg));
|
||||
frontend_imsg_compose_main(type, pid, &verbose,
|
||||
sizeof(verbose));
|
||||
frontend_imsg_compose_engine(type, 0, pid, &verbose,
|
||||
sizeof(verbose));
|
||||
|
||||
memcpy(&verbose, imsg.data, sizeof(verbose));
|
||||
log_setverbose(verbose);
|
||||
break;
|
||||
case IMSG_CTL_SHOW_INTERFACE_INFO:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(uint32_t))
|
||||
break;
|
||||
c->iev.ibuf.pid = imsg.hdr.pid;
|
||||
frontend_imsg_compose_engine(imsg.hdr.type, 0,
|
||||
imsg.hdr.pid, imsg.data, IMSG_DATA_SIZE(imsg));
|
||||
break;
|
||||
case IMSG_CTL_SEND_SOLICITATION:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(uint32_t))
|
||||
if (imsg_get_data(&imsg, &if_index,
|
||||
sizeof(if_index)) == -1)
|
||||
break;
|
||||
c->iev.ibuf.pid = imsg.hdr.pid;
|
||||
frontend_imsg_compose_engine(imsg.hdr.type, 0,
|
||||
imsg.hdr.pid, imsg.data, IMSG_DATA_SIZE(imsg));
|
||||
|
||||
c->iev.ibuf.pid = pid;
|
||||
frontend_imsg_compose_engine(type, 0, pid, &if_index,
|
||||
sizeof(if_index));
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: error handling imsg %d", __func__,
|
||||
imsg.hdr.type);
|
||||
log_debug("%s: error handling imsg %d", __func__, type);
|
||||
break;
|
||||
}
|
||||
imsg_free(&imsg);
|
||||
@ -297,10 +296,9 @@ control_imsg_relay(struct imsg *imsg)
|
||||
{
|
||||
struct ctl_conn *c;
|
||||
|
||||
if ((c = control_connbypid(imsg->hdr.pid)) == NULL)
|
||||
if ((c = control_connbypid(imsg_get_pid(imsg))) == NULL)
|
||||
return (0);
|
||||
|
||||
return (imsg_compose_event(&c->iev, imsg->hdr.type, 0, imsg->hdr.pid,
|
||||
-1, imsg->data, IMSG_DATA_SIZE(*imsg)));
|
||||
return (imsg_forward_event(&c->iev, imsg));
|
||||
}
|
||||
#endif /* SMALL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: engine.c,v 1.91 2024/07/13 16:06:34 florian Exp $ */
|
||||
/* $OpenBSD: engine.c,v 1.93 2024/08/24 16:35:05 florian Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
|
||||
@ -242,7 +242,7 @@ void engine_dispatch_frontend(int, short, void *);
|
||||
void engine_dispatch_main(int, short, void *);
|
||||
#ifndef SMALL
|
||||
void send_interface_info(struct slaacd_iface *, pid_t);
|
||||
void engine_showinfo_ctl(struct imsg *, uint32_t);
|
||||
void engine_showinfo_ctl(pid_t, uint32_t);
|
||||
void debug_log_ra(struct imsg_ra *);
|
||||
int in6_mask2prefixlen(struct in6_addr *);
|
||||
#endif /* SMALL */
|
||||
@ -462,7 +462,7 @@ engine_dispatch_frontend(int fd, short event, void *bula)
|
||||
#ifndef SMALL
|
||||
int verbose;
|
||||
#endif /* SMALL */
|
||||
uint32_t if_index;
|
||||
uint32_t if_index, type;
|
||||
|
||||
if (event & EV_READ) {
|
||||
if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
|
||||
@ -483,36 +483,36 @@ engine_dispatch_frontend(int fd, short event, void *bula)
|
||||
if (n == 0) /* No more messages. */
|
||||
break;
|
||||
|
||||
switch (imsg.hdr.type) {
|
||||
type = imsg_get_type(&imsg);
|
||||
|
||||
switch (type) {
|
||||
#ifndef SMALL
|
||||
case IMSG_CTL_LOG_VERBOSE:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(verbose))
|
||||
fatalx("%s: IMSG_CTL_LOG_VERBOSE wrong length: "
|
||||
"%lu", __func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&verbose, imsg.data, sizeof(verbose));
|
||||
if (imsg_get_data(&imsg, &verbose,
|
||||
sizeof(verbose)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
log_setverbose(verbose);
|
||||
break;
|
||||
case IMSG_CTL_SHOW_INTERFACE_INFO:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(if_index))
|
||||
fatalx("%s: IMSG_CTL_SHOW_INTERFACE_INFO wrong "
|
||||
"length: %lu", __func__,
|
||||
IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&if_index, imsg.data, sizeof(if_index));
|
||||
engine_showinfo_ctl(&imsg, if_index);
|
||||
if (imsg_get_data(&imsg, &if_index,
|
||||
sizeof(if_index)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
engine_showinfo_ctl(imsg_get_pid(&imsg), if_index);
|
||||
break;
|
||||
#endif /* SMALL */
|
||||
case IMSG_REMOVE_IF:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(if_index))
|
||||
fatalx("%s: IMSG_REMOVE_IF wrong length: %lu",
|
||||
__func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&if_index, imsg.data, sizeof(if_index));
|
||||
if (imsg_get_data(&imsg, &if_index,
|
||||
sizeof(if_index)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
remove_slaacd_iface(if_index);
|
||||
break;
|
||||
case IMSG_RA:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(ra))
|
||||
fatalx("%s: IMSG_RA wrong length: %lu",
|
||||
__func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&ra, imsg.data, sizeof(ra));
|
||||
if (imsg_get_data(&imsg, &ra, sizeof(ra)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
iface = get_slaacd_iface_by_id(ra.if_index);
|
||||
|
||||
/*
|
||||
@ -524,11 +524,10 @@ engine_dispatch_frontend(int fd, short event, void *bula)
|
||||
parse_ra(iface, &ra);
|
||||
break;
|
||||
case IMSG_CTL_SEND_SOLICITATION:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(if_index))
|
||||
fatalx("%s: IMSG_CTL_SEND_SOLICITATION wrong "
|
||||
"length: %lu", __func__,
|
||||
IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&if_index, imsg.data, sizeof(if_index));
|
||||
if (imsg_get_data(&imsg, &if_index,
|
||||
sizeof(if_index)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
iface = get_slaacd_iface_by_id(if_index);
|
||||
if (iface == NULL)
|
||||
log_warnx("requested to send solicitation on "
|
||||
@ -539,10 +538,10 @@ engine_dispatch_frontend(int fd, short event, void *bula)
|
||||
}
|
||||
break;
|
||||
case IMSG_DEL_ADDRESS:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(del_addr))
|
||||
fatalx("%s: IMSG_DEL_ADDRESS wrong length: %lu",
|
||||
__func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&del_addr, imsg.data, sizeof(del_addr));
|
||||
if (imsg_get_data(&imsg, &del_addr,
|
||||
sizeof(del_addr)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
iface = get_slaacd_iface_by_id(del_addr.if_index);
|
||||
if (iface == NULL) {
|
||||
log_debug("IMSG_DEL_ADDRESS: unknown interface"
|
||||
@ -562,10 +561,10 @@ engine_dispatch_frontend(int fd, short event, void *bula)
|
||||
free_address_proposal(addr_proposal);
|
||||
break;
|
||||
case IMSG_DEL_ROUTE:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(del_route))
|
||||
fatalx("%s: IMSG_DEL_ROUTE wrong length: %lu",
|
||||
__func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&del_route, imsg.data, sizeof(del_route));
|
||||
if (imsg_get_data(&imsg, &del_route,
|
||||
sizeof(del_route)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
iface = get_slaacd_iface_by_id(del_route.if_index);
|
||||
if (iface == NULL) {
|
||||
log_debug("IMSG_DEL_ROUTE: unknown interface"
|
||||
@ -582,10 +581,10 @@ engine_dispatch_frontend(int fd, short event, void *bula)
|
||||
}
|
||||
break;
|
||||
case IMSG_DUP_ADDRESS:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(dup_addr))
|
||||
fatalx("%s: IMSG_DUP_ADDRESS wrong length: %lu",
|
||||
__func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&dup_addr, imsg.data, sizeof(dup_addr));
|
||||
if (imsg_get_data(&imsg, &dup_addr,
|
||||
sizeof(dup_addr)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
iface = get_slaacd_iface_by_id(dup_addr.if_index);
|
||||
if (iface == NULL) {
|
||||
log_debug("IMSG_DUP_ADDRESS: unknown interface"
|
||||
@ -606,8 +605,7 @@ engine_dispatch_frontend(int fd, short event, void *bula)
|
||||
iface->rdomain);
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: unexpected imsg %d", __func__,
|
||||
imsg.hdr.type);
|
||||
log_debug("%s: unexpected imsg %d", __func__, type);
|
||||
break;
|
||||
}
|
||||
imsg_free(&imsg);
|
||||
@ -629,6 +627,7 @@ engine_dispatch_main(int fd, short event, void *bula)
|
||||
struct imsgbuf *ibuf = &iev->ibuf;
|
||||
struct imsg_ifinfo imsg_ifinfo;
|
||||
ssize_t n;
|
||||
uint32_t type;
|
||||
int shut = 0;
|
||||
|
||||
if (event & EV_READ) {
|
||||
@ -650,7 +649,9 @@ engine_dispatch_main(int fd, short event, void *bula)
|
||||
if (n == 0) /* No more messages. */
|
||||
break;
|
||||
|
||||
switch (imsg.hdr.type) {
|
||||
type = imsg_get_type(&imsg);
|
||||
|
||||
switch (type) {
|
||||
case IMSG_SOCKET_IPC:
|
||||
/*
|
||||
* Setup pipe and event handler to the frontend
|
||||
@ -681,15 +682,14 @@ engine_dispatch_main(int fd, short event, void *bula)
|
||||
fatal("pledge");
|
||||
break;
|
||||
case IMSG_UPDATE_IF:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(imsg_ifinfo))
|
||||
fatalx("%s: IMSG_UPDATE_IF wrong length: %lu",
|
||||
__func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&imsg_ifinfo, imsg.data, sizeof(imsg_ifinfo));
|
||||
if (imsg_get_data(&imsg, &imsg_ifinfo,
|
||||
sizeof(imsg_ifinfo)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
engine_update_iface(&imsg_ifinfo);
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: unexpected imsg %d", __func__,
|
||||
imsg.hdr.type);
|
||||
log_debug("%s: unexpected imsg %d", __func__, type);
|
||||
break;
|
||||
}
|
||||
imsg_free(&imsg);
|
||||
@ -862,26 +862,18 @@ send_interface_info(struct slaacd_iface *iface, pid_t pid)
|
||||
}
|
||||
|
||||
void
|
||||
engine_showinfo_ctl(struct imsg *imsg, uint32_t if_index)
|
||||
engine_showinfo_ctl(pid_t pid, uint32_t if_index)
|
||||
{
|
||||
struct slaacd_iface *iface;
|
||||
|
||||
switch (imsg->hdr.type) {
|
||||
case IMSG_CTL_SHOW_INTERFACE_INFO:
|
||||
if (if_index == 0) {
|
||||
LIST_FOREACH (iface, &slaacd_interfaces, entries)
|
||||
send_interface_info(iface, imsg->hdr.pid);
|
||||
} else {
|
||||
if ((iface = get_slaacd_iface_by_id(if_index)) != NULL)
|
||||
send_interface_info(iface, imsg->hdr.pid);
|
||||
}
|
||||
engine_imsg_compose_frontend(IMSG_CTL_END, imsg->hdr.pid, NULL,
|
||||
0);
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: error handling imsg", __func__);
|
||||
break;
|
||||
if (if_index == 0) {
|
||||
LIST_FOREACH (iface, &slaacd_interfaces, entries)
|
||||
send_interface_info(iface, pid);
|
||||
} else {
|
||||
if ((iface = get_slaacd_iface_by_id(if_index)) != NULL)
|
||||
send_interface_info(iface, pid);
|
||||
}
|
||||
engine_imsg_compose_frontend(IMSG_CTL_END, pid, NULL, 0);
|
||||
}
|
||||
|
||||
#endif /* SMALL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: frontend.c,v 1.67 2024/06/03 17:58:33 deraadt Exp $ */
|
||||
/* $OpenBSD: frontend.c,v 1.68 2024/08/24 09:44:41 florian Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
|
||||
@ -282,6 +282,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
|
||||
struct imsgev *iev = bula;
|
||||
struct imsgbuf *ibuf = &iev->ibuf;
|
||||
ssize_t n;
|
||||
uint32_t type;
|
||||
int shut = 0, icmp6sock, rdomain;
|
||||
|
||||
if (event & EV_READ) {
|
||||
@ -303,7 +304,9 @@ frontend_dispatch_main(int fd, short event, void *bula)
|
||||
if (n == 0) /* No more messages. */
|
||||
break;
|
||||
|
||||
switch (imsg.hdr.type) {
|
||||
type = imsg_get_type(&imsg);
|
||||
|
||||
switch (type) {
|
||||
case IMSG_SOCKET_IPC:
|
||||
/*
|
||||
* Setup pipe and event handler to the engine
|
||||
@ -335,10 +338,10 @@ frontend_dispatch_main(int fd, short event, void *bula)
|
||||
fatalx("%s: expected to receive imsg "
|
||||
"ICMPv6 fd but didn't receive any",
|
||||
__func__);
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(rdomain))
|
||||
fatalx("%s: IMSG_ICMP6SOCK wrong length: "
|
||||
"%lu", __func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&rdomain, imsg.data, sizeof(rdomain));
|
||||
if (imsg_get_data(&imsg, &rdomain,
|
||||
sizeof(rdomain)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
set_icmp6sock(icmp6sock, rdomain);
|
||||
break;
|
||||
case IMSG_ROUTESOCK:
|
||||
@ -346,6 +349,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
|
||||
fatalx("%s: expected to receive imsg "
|
||||
"routesocket fd but didn't receive any",
|
||||
__func__);
|
||||
|
||||
event_set(&ev_route, fd, EV_READ | EV_PERSIST,
|
||||
route_receive, NULL);
|
||||
break;
|
||||
@ -358,6 +362,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
|
||||
fatalx("%s: expected to receive imsg "
|
||||
"control fd but didn't receive any",
|
||||
__func__);
|
||||
|
||||
/* Listen on control socket. */
|
||||
control_listen(fd);
|
||||
break;
|
||||
@ -366,8 +371,7 @@ frontend_dispatch_main(int fd, short event, void *bula)
|
||||
break;
|
||||
#endif /* SMALL */
|
||||
default:
|
||||
log_debug("%s: error handling imsg %d", __func__,
|
||||
imsg.hdr.type);
|
||||
log_debug("%s: error handling imsg %d", __func__, type);
|
||||
break;
|
||||
}
|
||||
imsg_free(&imsg);
|
||||
@ -389,7 +393,7 @@ frontend_dispatch_engine(int fd, short event, void *bula)
|
||||
struct imsg imsg;
|
||||
ssize_t n;
|
||||
int shut = 0;
|
||||
uint32_t if_index;
|
||||
uint32_t if_index, type;
|
||||
|
||||
if (event & EV_READ) {
|
||||
if ((n = imsg_read(ibuf)) == -1 && errno != EAGAIN)
|
||||
@ -410,7 +414,9 @@ frontend_dispatch_engine(int fd, short event, void *bula)
|
||||
if (n == 0) /* No more messages. */
|
||||
break;
|
||||
|
||||
switch (imsg.hdr.type) {
|
||||
type = imsg_get_type(&imsg);
|
||||
|
||||
switch (type) {
|
||||
#ifndef SMALL
|
||||
case IMSG_CTL_END:
|
||||
case IMSG_CTL_SHOW_INTERFACE_INFO:
|
||||
@ -427,16 +433,14 @@ frontend_dispatch_engine(int fd, short event, void *bula)
|
||||
break;
|
||||
#endif /* SMALL */
|
||||
case IMSG_CTL_SEND_SOLICITATION:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(if_index))
|
||||
fatalx("%s: IMSG_CTL_SEND_SOLICITATION wrong "
|
||||
"length: %lu", __func__,
|
||||
IMSG_DATA_SIZE(imsg));
|
||||
if_index = *((uint32_t *)imsg.data);
|
||||
if (imsg_get_data(&imsg, &if_index,
|
||||
sizeof(if_index)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
send_solicitation(if_index);
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: error handling imsg %d", __func__,
|
||||
imsg.hdr.type);
|
||||
log_debug("%s: error handling imsg %d", __func__, type);
|
||||
break;
|
||||
}
|
||||
imsg_free(&imsg);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: slaacd.c,v 1.69 2024/04/21 17:33:05 florian Exp $ */
|
||||
/* $OpenBSD: slaacd.c,v 1.72 2024/08/24 16:34:23 florian Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
|
||||
@ -381,6 +381,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
|
||||
struct imsg imsg;
|
||||
struct imsg_ifinfo imsg_ifinfo;
|
||||
ssize_t n;
|
||||
uint32_t type;
|
||||
int shut = 0;
|
||||
int rdomain;
|
||||
#ifndef SMALL
|
||||
@ -408,29 +409,30 @@ main_dispatch_frontend(int fd, short event, void *bula)
|
||||
if (n == 0) /* No more messages. */
|
||||
break;
|
||||
|
||||
switch (imsg.hdr.type) {
|
||||
type = imsg_get_type(&imsg);
|
||||
|
||||
switch (type) {
|
||||
case IMSG_OPEN_ICMP6SOCK:
|
||||
log_debug("IMSG_OPEN_ICMP6SOCK");
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(rdomain))
|
||||
fatalx("%s: IMSG_OPEN_ICMP6SOCK wrong length: "
|
||||
"%lu", __func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&rdomain, imsg.data, sizeof(rdomain));
|
||||
if (imsg_get_data(&imsg, &rdomain,
|
||||
sizeof(rdomain)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
open_icmp6sock(rdomain);
|
||||
break;
|
||||
#ifndef SMALL
|
||||
case IMSG_CTL_LOG_VERBOSE:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(verbose))
|
||||
fatalx("%s: IMSG_CTL_LOG_VERBOSE wrong length: "
|
||||
"%lu", __func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&verbose, imsg.data, sizeof(verbose));
|
||||
if (imsg_get_data(&imsg, &verbose,
|
||||
sizeof(verbose)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
log_setverbose(verbose);
|
||||
break;
|
||||
#endif /* SMALL */
|
||||
case IMSG_UPDATE_IF:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(imsg_ifinfo))
|
||||
fatalx("%s: IMSG_UPDATE_IF wrong length: %lu",
|
||||
__func__, IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&imsg_ifinfo, imsg.data, sizeof(imsg_ifinfo));
|
||||
if (imsg_get_data(&imsg, &imsg_ifinfo,
|
||||
sizeof(imsg_ifinfo)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
if (get_soiikey(imsg_ifinfo.soiikey) == -1)
|
||||
log_warn("get_soiikey");
|
||||
else
|
||||
@ -438,8 +440,7 @@ main_dispatch_frontend(int fd, short event, void *bula)
|
||||
&imsg_ifinfo, sizeof(imsg_ifinfo));
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: error handling imsg %d", __func__,
|
||||
imsg.hdr.type);
|
||||
log_debug("%s: error handling imsg %d", __func__, type);
|
||||
break;
|
||||
}
|
||||
imsg_free(&imsg);
|
||||
@ -463,6 +464,7 @@ main_dispatch_engine(int fd, short event, void *bula)
|
||||
struct imsg_configure_dfr dfr;
|
||||
struct imsg_propose_rdns rdns;
|
||||
ssize_t n;
|
||||
uint32_t type;
|
||||
int shut = 0;
|
||||
|
||||
ibuf = &iev->ibuf;
|
||||
@ -486,54 +488,47 @@ main_dispatch_engine(int fd, short event, void *bula)
|
||||
if (n == 0) /* No more messages. */
|
||||
break;
|
||||
|
||||
switch (imsg.hdr.type) {
|
||||
type = imsg_get_type(&imsg);
|
||||
|
||||
switch (type) {
|
||||
case IMSG_CONFIGURE_ADDRESS:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(address))
|
||||
fatalx("%s: IMSG_CONFIGURE_ADDRESS wrong "
|
||||
"length: %lu", __func__,
|
||||
IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&address, imsg.data, sizeof(address));
|
||||
if (imsg_get_data(&imsg, &address,
|
||||
sizeof(address)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
configure_interface(&address);
|
||||
break;
|
||||
case IMSG_WITHDRAW_ADDRESS:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(address))
|
||||
fatalx("%s: IMSG_WITHDRAW_ADDRESS wrong "
|
||||
"length: %lu", __func__,
|
||||
IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&address, imsg.data, sizeof(address));
|
||||
if (imsg_get_data(&imsg, &address,
|
||||
sizeof(address)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
delete_address(&address);
|
||||
break;
|
||||
case IMSG_CONFIGURE_DFR:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(dfr))
|
||||
fatalx("%s: IMSG_CONFIGURE_DFR wrong "
|
||||
"length: %lu", __func__,
|
||||
IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&dfr, imsg.data, sizeof(dfr));
|
||||
if (imsg_get_data(&imsg, &dfr, sizeof(dfr)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
add_gateway(&dfr);
|
||||
break;
|
||||
case IMSG_WITHDRAW_DFR:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(dfr))
|
||||
fatalx("%s: IMSG_WITHDRAW_DFR wrong "
|
||||
"length: %lu", __func__,
|
||||
IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&dfr, imsg.data, sizeof(dfr));
|
||||
if (imsg_get_data(&imsg, &dfr, sizeof(dfr)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
|
||||
delete_gateway(&dfr);
|
||||
break;
|
||||
case IMSG_PROPOSE_RDNS:
|
||||
if (IMSG_DATA_SIZE(imsg) != sizeof(rdns))
|
||||
fatalx("%s: IMSG_PROPOSE_RDNS wrong "
|
||||
"length: %lu", __func__,
|
||||
IMSG_DATA_SIZE(imsg));
|
||||
memcpy(&rdns, imsg.data, sizeof(rdns));
|
||||
if (imsg_get_data(&imsg, &rdns, sizeof(rdns)) == -1)
|
||||
fatalx("%s: invalid %s", __func__, i2s(type));
|
||||
if ((2 + rdns.rdns_count * sizeof(struct in6_addr)) >
|
||||
sizeof(struct sockaddr_rtdns))
|
||||
fatalx("%s: rdns_count too big: %d", __func__,
|
||||
rdns.rdns_count);
|
||||
|
||||
send_rdns_proposal(&rdns);
|
||||
break;
|
||||
default:
|
||||
log_debug("%s: error handling imsg %d", __func__,
|
||||
imsg.hdr.type);
|
||||
log_debug("%s: error handling imsg %d", __func__, type);
|
||||
break;
|
||||
}
|
||||
imsg_free(&imsg);
|
||||
@ -592,6 +587,16 @@ imsg_compose_event(struct imsgev *iev, uint16_t type, uint32_t peerid,
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
imsg_forward_event(struct imsgev *iev, struct imsg *imsg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if ((ret = imsg_forward(&iev->ibuf, imsg)) != -1)
|
||||
imsg_event_add(iev);
|
||||
|
||||
return (ret);
|
||||
}
|
||||
static int
|
||||
main_imsg_send_ipc_sockets(struct imsgbuf *frontend_buf,
|
||||
struct imsgbuf *engine_buf)
|
||||
@ -899,3 +904,54 @@ open_icmp6sock(int rdomain)
|
||||
main_imsg_compose_frontend(IMSG_ICMP6SOCK, icmp6sock, &rdomain,
|
||||
sizeof(rdomain));
|
||||
}
|
||||
|
||||
#ifndef SMALL
|
||||
|
||||
#define I2S(x) case x: return #x
|
||||
|
||||
const char*
|
||||
i2s(uint32_t type)
|
||||
{
|
||||
static char unknown[sizeof("IMSG_4294967295")];
|
||||
|
||||
switch (type) {
|
||||
I2S(IMSG_NONE);
|
||||
I2S(IMSG_CTL_LOG_VERBOSE);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_RA);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_RA_PREFIX);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_RA_RDNS);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_ADDR_PROPOSALS);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_ADDR_PROPOSAL);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_DFR_PROPOSALS);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_DFR_PROPOSAL);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_RDNS_PROPOSALS);
|
||||
I2S(IMSG_CTL_SHOW_INTERFACE_INFO_RDNS_PROPOSAL);
|
||||
I2S(IMSG_CTL_END);
|
||||
I2S(IMSG_PROPOSE_RDNS);
|
||||
I2S(IMSG_REPROPOSE_RDNS);
|
||||
I2S(IMSG_CTL_SEND_SOLICITATION);
|
||||
I2S(IMSG_SOCKET_IPC);
|
||||
I2S(IMSG_OPEN_ICMP6SOCK);
|
||||
I2S(IMSG_ICMP6SOCK);
|
||||
I2S(IMSG_ROUTESOCK);
|
||||
I2S(IMSG_CONTROLFD);
|
||||
I2S(IMSG_STARTUP);
|
||||
I2S(IMSG_UPDATE_IF);
|
||||
I2S(IMSG_REMOVE_IF);
|
||||
I2S(IMSG_RA);
|
||||
I2S(IMSG_CONFIGURE_ADDRESS);
|
||||
I2S(IMSG_WITHDRAW_ADDRESS);
|
||||
I2S(IMSG_DEL_ADDRESS);
|
||||
I2S(IMSG_DEL_ROUTE);
|
||||
I2S(IMSG_CONFIGURE_DFR);
|
||||
I2S(IMSG_WITHDRAW_DFR);
|
||||
I2S(IMSG_DUP_ADDRESS);
|
||||
default:
|
||||
snprintf(unknown, sizeof(unknown), "IMSG_%u", type);
|
||||
return unknown;
|
||||
}
|
||||
}
|
||||
#undef I2S
|
||||
|
||||
#endif /* SMALL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: slaacd.h,v 1.38 2022/07/12 16:55:00 florian Exp $ */
|
||||
/* $OpenBSD: slaacd.h,v 1.40 2024/08/24 16:34:23 florian Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
|
||||
@ -27,8 +27,6 @@
|
||||
|
||||
#define MAX_RDNS_COUNT 8 /* max nameserver in a RTM_PROPOSAL */
|
||||
|
||||
#define IMSG_DATA_SIZE(imsg) ((imsg).hdr.len - IMSG_HEADER_SIZE)
|
||||
|
||||
struct imsgev {
|
||||
struct imsgbuf ibuf;
|
||||
void (*handler)(int, short, void *);
|
||||
@ -204,8 +202,11 @@ struct imsg_dup_addr {
|
||||
void imsg_event_add(struct imsgev *);
|
||||
int imsg_compose_event(struct imsgev *, uint16_t, uint32_t, pid_t,
|
||||
int, void *, uint16_t);
|
||||
int imsg_forward_event(struct imsgev *, struct imsg *);
|
||||
#ifndef SMALL
|
||||
const char *sin6_to_str(struct sockaddr_in6 *);
|
||||
const char *i2s(uint32_t);
|
||||
#else
|
||||
#define sin6_to_str(x...) ""
|
||||
#define i2s(x...) ""
|
||||
#endif /* SMALL */
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: uvm_km_alloc.9,v 1.2 2019/12/05 15:58:27 jmc Exp $
|
||||
.\" $OpenBSD: uvm_km_alloc.9,v 1.3 2024/08/24 10:47:59 mpi Exp $
|
||||
.\" $NetBSD: uvm.9,v 1.14 2000/06/29 06:08:44 mrg Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Matthew R. Green
|
||||
@ -25,104 +25,21 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: December 5 2019 $
|
||||
.Dt UVM_KM_ALLOC 9
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt UVM_KM_SUBALLOC 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm uvm_km_alloc ,
|
||||
.Nm uvm_km_zalloc ,
|
||||
.Nm uvm_km_alloc1 ,
|
||||
.Nm uvm_km_kmemalloc ,
|
||||
.Nm uvm_km_valloc ,
|
||||
.Nm uvm_km_valloc_wait ,
|
||||
.Nm uvm_km_suballoc ,
|
||||
.Nm uvm_km_free ,
|
||||
.Nm uvm_km_free_wakeup
|
||||
.Nm uvm_km_free
|
||||
.Nd raw kernel memory or address space allocator
|
||||
.Sh SYNOPSIS
|
||||
.In sys/param.h
|
||||
.In uvm/uvm.h
|
||||
.Ft vaddr_t
|
||||
.Fn uvm_km_alloc "vm_map_t map" "vsize_t size"
|
||||
.Ft vaddr_t
|
||||
.Fn uvm_km_zalloc "vm_map_t map" "vsize_t size"
|
||||
.Ft vaddr_t
|
||||
.Fn uvm_km_alloc1 "vm_map_t map" "vsize_t size" "vsize_t align" "boolean_t zeroit"
|
||||
.Ft vaddr_t
|
||||
.Fn uvm_km_kmemalloc "vm_map_t map" "struct uvm_object *obj" "vsize_t size" "int flags"
|
||||
.Ft vaddr_t
|
||||
.Fn uvm_km_valloc "vm_map_t map" "vsize_t size"
|
||||
.Ft vaddr_t
|
||||
.Fn uvm_km_valloc_wait "vm_map_t map" "vsize_t size"
|
||||
.Ft struct vm_map *
|
||||
.Fn uvm_km_suballoc "vm_map_t map" "vaddr_t *min" "vaddr_t *max " "vsize_t size" "int flags" "boolean_t fixed" "vm_map_t submap"
|
||||
.Ft void
|
||||
.Fn uvm_km_free "vm_map_t map" "vaddr_t addr" "vsize_t size"
|
||||
.Ft void
|
||||
.Fn uvm_km_free_wakeup "vm_map_t map" "vaddr_t addr" "vsize_t size"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Fn uvm_km_alloc
|
||||
and
|
||||
.Fn uvm_km_zalloc
|
||||
functions allocate
|
||||
.Fa size
|
||||
bytes of wired kernel memory in map
|
||||
.Fa map .
|
||||
In addition to allocation,
|
||||
.Fn uvm_km_zalloc
|
||||
zeros the memory.
|
||||
Both of these functions are defined as macros in terms of
|
||||
.Fn uvm_km_alloc1 ,
|
||||
and should almost always be used in preference to
|
||||
.Fn uvm_km_alloc1 .
|
||||
.Pp
|
||||
The
|
||||
.Fn uvm_km_alloc1
|
||||
function allocates and returns
|
||||
.Fa size
|
||||
bytes of wired memory in the kernel map aligned to the
|
||||
.Fa align
|
||||
boundary, zeroing the memory if the
|
||||
.Fa zeroit
|
||||
argument is non-zero.
|
||||
.Pp
|
||||
The
|
||||
.Fn uvm_km_kmemalloc
|
||||
function allocates and returns
|
||||
.Fa size
|
||||
bytes of wired kernel memory into
|
||||
.Fa obj .
|
||||
The flags can be any of:
|
||||
.Bd -literal
|
||||
#define UVM_KMF_NOWAIT 0x1 /* matches M_NOWAIT */
|
||||
#define UVM_KMF_VALLOC 0x2 /* allocate VA only */
|
||||
#define UVM_KMF_TRYLOCK UVM_FLAG_TRYLOCK /* try locking only */
|
||||
.Ed
|
||||
.Pp
|
||||
The
|
||||
.Dv UVM_KMF_NOWAIT
|
||||
flag causes
|
||||
.Fn uvm_km_kmemalloc
|
||||
to return immediately if no memory is available.
|
||||
.Dv UVM_KMF_VALLOC
|
||||
causes no pages to be allocated, only a virtual address.
|
||||
.Dv UVM_KMF_TRYLOCK
|
||||
causes
|
||||
.Fn uvm_km_kmemalloc
|
||||
to only try and not sleep when locking maps.
|
||||
.Pp
|
||||
The
|
||||
.Fn uvm_km_valloc
|
||||
and
|
||||
.Fn uvm_km_valloc_wait
|
||||
functions return a newly allocated zero-filled address in the kernel map of size
|
||||
.Fa size .
|
||||
.Fn uvm_km_valloc_wait
|
||||
will also wait for kernel memory to become available, if there is a
|
||||
memory shortage.
|
||||
.Pp
|
||||
The
|
||||
.Fn uvm_km_suballoc
|
||||
function allocates submap (with the specified
|
||||
.Fa flags ,
|
||||
@ -150,15 +67,9 @@ and
|
||||
.Pp
|
||||
The
|
||||
.Fn uvm_km_free
|
||||
and
|
||||
.Fn uvm_km_free_wakeup
|
||||
functions free
|
||||
function free
|
||||
.Fa size
|
||||
bytes of memory in the kernel map, starting at address
|
||||
.Fa addr .
|
||||
.Fn uvm_km_free_wakeup
|
||||
calls
|
||||
.Fn wakeup
|
||||
on the map before unlocking the map.
|
||||
.Sh SEE ALSO
|
||||
.Xr km_alloc 9
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $OpenBSD: uvm_pagealloc.9,v 1.2 2019/12/05 15:58:27 jmc Exp $
|
||||
.\" $OpenBSD: uvm_pagealloc.9,v 1.3 2024/08/24 10:47:59 mpi Exp $
|
||||
.\" $NetBSD: uvm.9,v 1.14 2000/06/29 06:08:44 mrg Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 1998 Matthew R. Green
|
||||
@ -25,7 +25,7 @@
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd $Mdocdate: December 5 2019 $
|
||||
.Dd $Mdocdate: August 24 2024 $
|
||||
.Dt UVM_PAGEALLOC 9
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -164,6 +164,3 @@ and
|
||||
.Fa end
|
||||
of the physical addresses of the segment, and the available start and end
|
||||
addresses of pages not already in use.
|
||||
.\" XXX expand on "system boot time"!
|
||||
.Sh SEE ALSO
|
||||
.Xr uvm_km_alloc 9
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: uvm_extern.h,v 1.175 2024/07/24 12:17:31 mpi Exp $ */
|
||||
/* $OpenBSD: uvm_extern.h,v 1.177 2024/08/24 10:46:43 mpi Exp $ */
|
||||
/* $NetBSD: uvm_extern.h,v 1.57 2001/03/09 01:02:12 chs Exp $ */
|
||||
|
||||
/*
|
||||
@ -256,10 +256,6 @@ extern struct vm_map *phys_map;
|
||||
/* base of kernel virtual memory */
|
||||
extern vaddr_t vm_min_kernel_address;
|
||||
|
||||
/* zalloc zeros memory, alloc does not */
|
||||
#define uvm_km_zalloc(MAP,SIZE) uvm_km_alloc1(MAP,SIZE,0,TRUE)
|
||||
#define uvm_km_alloc(MAP,SIZE) uvm_km_alloc1(MAP,SIZE,0,FALSE)
|
||||
|
||||
#define vm_resident_count(vm) (pmap_resident_count((vm)->vm_map.pmap))
|
||||
|
||||
struct plimit;
|
||||
@ -291,7 +287,9 @@ int uvm_io(vm_map_t, struct uio *, int);
|
||||
|
||||
#define UVM_IO_FIXPROT 0x01
|
||||
|
||||
vaddr_t uvm_km_alloc1(vm_map_t, vsize_t, vsize_t, boolean_t);
|
||||
#ifdef __i386__
|
||||
vaddr_t uvm_km_zalloc(vm_map_t, vsize_t);
|
||||
#endif
|
||||
void uvm_km_free(vm_map_t, vaddr_t, vsize_t);
|
||||
vaddr_t uvm_km_kmemalloc_pla(struct vm_map *,
|
||||
struct uvm_object *, vsize_t, vsize_t, int,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: uvm_km.c,v 1.152 2024/03/27 15:41:40 kurt Exp $ */
|
||||
/* $OpenBSD: uvm_km.c,v 1.154 2024/08/24 10:46:43 mpi Exp $ */
|
||||
/* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
@ -117,10 +117,10 @@
|
||||
* address minus the vm_map_min(kernel_map).
|
||||
* example:
|
||||
* suppose kernel_map starts at 0xf8000000 and the kernel does a
|
||||
* uvm_km_alloc(kernel_map, PAGE_SIZE) [allocate 1 wired down page in the
|
||||
* kernel map]. if uvm_km_alloc returns virtual address 0xf8235000,
|
||||
* then that means that the page at offset 0x235000 in kernel_object is
|
||||
* mapped at 0xf8235000.
|
||||
* km_alloc(PAGE_SIZE, &kv_any, &kp_none, &kd_waitok)) [allocate 1 wired
|
||||
* down page in the kernel map]. if km_alloc() returns virtual address
|
||||
* 0xf8235000, then that means that the page at offset 0x235000 in
|
||||
* kernel_object is mapped at 0xf8235000.
|
||||
*
|
||||
* kernel objects have one other special property: when the kernel virtual
|
||||
* memory mapping them is unmapped, the backing memory in the object is
|
||||
@ -433,13 +433,14 @@ uvm_km_free(struct vm_map *map, vaddr_t addr, vsize_t size)
|
||||
uvm_unmap(map, trunc_page(addr), round_page(addr+size));
|
||||
}
|
||||
|
||||
#ifdef __i386__
|
||||
/*
|
||||
* uvm_km_alloc1: allocate wired down memory in the kernel map.
|
||||
* uvm_km_zalloc: allocate wired down memory in the kernel map.
|
||||
*
|
||||
* => we can sleep if needed
|
||||
*/
|
||||
vaddr_t
|
||||
uvm_km_alloc1(struct vm_map *map, vsize_t size, vsize_t align, boolean_t zeroit)
|
||||
uvm_km_zalloc(struct vm_map *map, vsize_t size)
|
||||
{
|
||||
vaddr_t kva, loopva;
|
||||
voff_t offset;
|
||||
@ -452,7 +453,7 @@ uvm_km_alloc1(struct vm_map *map, vsize_t size, vsize_t align, boolean_t zeroit)
|
||||
|
||||
/* allocate some virtual space */
|
||||
if (__predict_false(uvm_map(map, &kva, size, uvm.kernel_object,
|
||||
UVM_UNKNOWN_OFFSET, align,
|
||||
UVM_UNKNOWN_OFFSET, 0,
|
||||
UVM_MAPFLAG(PROT_READ | PROT_WRITE,
|
||||
PROT_READ | PROT_WRITE | PROT_EXEC,
|
||||
MAP_INHERIT_NONE, MADV_RANDOM, 0)) != 0)) {
|
||||
@ -483,7 +484,7 @@ uvm_km_alloc1(struct vm_map *map, vsize_t size, vsize_t align, boolean_t zeroit)
|
||||
uvm_unmap(map, kva, loopva - kva);
|
||||
return (0);
|
||||
} else {
|
||||
uvm_wait("km_alloc1w"); /* wait for memory */
|
||||
uvm_wait("km_zallocw"); /* wait for memory */
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -506,11 +507,11 @@ uvm_km_alloc1(struct vm_map *map, vsize_t size, vsize_t align, boolean_t zeroit)
|
||||
* zero on request (note that "size" is now zero due to the above loop
|
||||
* so we need to subtract kva from loopva to reconstruct the size).
|
||||
*/
|
||||
if (zeroit)
|
||||
memset((caddr_t)kva, 0, loopva - kva);
|
||||
memset((caddr_t)kva, 0, loopva - kva);
|
||||
|
||||
return kva;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__HAVE_PMAP_DIRECT)
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: sync.c,v 1.24 2022/01/05 11:01:59 tb Exp $ */
|
||||
/* $OpenBSD: sync.c,v 1.25 2024/08/24 08:35:24 sthen Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Bob Beck <beck@openbsd.org>
|
||||
@ -307,7 +307,7 @@ sync_recv(void)
|
||||
sizeof(lp->ip_addr));
|
||||
memcpy(&lp->hardware_addr, &lv->lv_hardware_addr,
|
||||
sizeof(lp->hardware_addr));
|
||||
log_info("DHCP_SYNC_LEASE from %s for hw %s -> ip %s, "
|
||||
log_debug("DHCP_SYNC_LEASE from %s for hw %s -> ip %s, "
|
||||
"start %lld, end %lld",
|
||||
inet_ntoa(addr.sin_addr),
|
||||
print_hw_addr(lp->hardware_addr.htype,
|
||||
@ -431,7 +431,7 @@ sync_lease(struct lease *lease)
|
||||
memcpy(&lv.lv_ip_addr, &lease->ip_addr, sizeof(lv.lv_ip_addr));
|
||||
memcpy(&lv.lv_hardware_addr, &lease->hardware_addr,
|
||||
sizeof(lv.lv_hardware_addr));
|
||||
log_info("sending DHCP_SYNC_LEASE for hw %s -> ip %s, start %d, "
|
||||
log_debug("sending DHCP_SYNC_LEASE for hw %s -> ip %s, start %d, "
|
||||
"end %d", print_hw_addr(lv.lv_hardware_addr.htype,
|
||||
lv.lv_hardware_addr.hlen, lv.lv_hardware_addr.haddr),
|
||||
piaddr(lease->ip_addr), ntohl(lv.lv_starts), ntohl(lv.lv_ends));
|
||||
|
Loading…
Reference in New Issue
Block a user