work/ 0000775 0000000 0000000 00000000000 15063477206 006742 5 ustar work/.dir-locals.el 0000664 0000000 0000000 00000000342 15063477206 011372 0 ustar ;;; Directory Local Variables
;;; See Info node `(emacs) Directory Variables' for more information.
((c-mode
(c-basic-offset . 4))
(python-mode
(indent-tabs-mode . t)
(python-indent-offset . 8)
(python-indent . 8)))
work/.gitignore 0000664 0000000 0000000 00000001340 15063477206 010730 0 ustar *.o
.*.d
*.pyc
conffile.tab.[ch]
conffile.yy.[ch]
pubkeys.fl
pubkeys.yy.[ch]
/version.c
/secnet
/eax-*-test
/eax-*-test.confirm
/ipaddrset-test.new
/ipaddrset.confirm
/config.log
/config.h
/config.status
/config.stamp
/config.stamp.in
Makefile
/common.make
/test-common.make
msgcode-test
msgcode-test.confirm
autom4te.cache
*~
*.tmp
TAGS
.makefiles.stamp
Dir.mk
/main.mk
/Final.mk
debian/files
debian/secnet.debhelper.log
debian/*.debhelper
debian/secnet
debian/secnet.substvars
*.xcodeproj
/build
test-example/*.key
test-example/*.privkeys
test-example/pubkeys
test-example/sites.conf
test-example/sites-nonego.conf
test-example/bogus-setup-request
build-stamp
[sm]test/d-*
stest/udp-preload.so
base91s/*.[ch]
base91s/base91s
work/COPYING 0000664 0000000 0000000 00000104513 15063477206 010001 0 ustar GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
work/CREDITS 0000664 0000000 0000000 00000003075 15063477206 007767 0 ustar Stephen Early - original author
Ian Jackson - current maintainer
Mark Wooding - much useful stuff
Ross Anderson, Eli Biham, Lars Knudsen - serpent
Colin Plumb, Ian Jackson - MD5 implementation
Steve Reid, James H. Brown, Saul Kravitz - SHA1 implementation
Vincent Rijmen, Antoon Bosselaers, Paulo Barreto - Rijndael (AES) implementation
Guido Draheim - ac_prog_cc_no_writeable_strings.m4
Free Software Foundation and Scott G. Miller - SHA-512 implementation
Free Software Foundation and Paul Eggert - u64.h
Massachusetts Institute of Technology - install-sh
Omnifarious, btel (StackOverflow uers) - Python argparse --[no-]foo options
Joachim Henkea - base91 specificaation and C implementation
Adrien Béraud, Guillaume Jacquenot, SunDwarf aka eyesismine - base91 python
Simon Tatham, Jonathan Amery, Ian Jackson - testing and debugging
Simon Tatham - RSA signatures using Chinese Remainder Theorem
Simon Tatham - endianness cleanups in transform.c
Richard Kettlewell, Matthew Vernon, Peter Benie - assorted bugfixes
"Omnifarious" and "btel" on Stackoverflow - python yes/no arg parsing
Joachim Henke - basE91 encoding format and the corresponding C library
Adrien Béraud, Guillaume Jacquenot, SunDwarf - python basE91 library
Joey Hess - some elements of the Debian packaging
Miquel van Smoorenburg, Ian Murdock - original init script example
--
This file is part of secnet.
See LICENCE and this file CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/DEVELOPER-CERTIFICATE 0000777 0000000 0000000 00000000000 15063477206 016535 2subdirmk/DEVELOPER-CERTIFICATE ustar work/Dir.sd.mk 0000664 0000000 0000000 00000017677 15063477206 010440 0 ustar # Makefile for secnet
#
# This file is part of secnet.
# See README for full list of copyright holders.
#
# secnet is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# secnet is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# version 3 along with secnet; if not, see
# https://www.gnu.org/licenses/gpl.html.
.PHONY: all clean realclean distclean dist install
PACKAGE:=secnet
VERSION=0.6.7
VPATH:=@srcdir@
srcdir:=@srcdir@
include common.make
INSTALL:=@INSTALL@
INSTALL_PROGRAM:=@INSTALL_PROGRAM@
INSTALL_SCRIPT:=@INSTALL_SCRIPT@
INSTALL_DATA:=@INSTALL_DATA@
prefix:=$(DESTDIR)@prefix@
exec_prefix:=@exec_prefix@
sbindir:=@sbindir@
sysconfdir:=$(DESTDIR)@sysconfdir@
datarootdir:=@datarootdir@
transform:=@program_transform_name@
mandir:=@mandir@
ALL_CFLAGS:=@DEFS@ -I$(srcdir) -I. $(CFLAGS) $(EXTRA_CFLAGS)
CPPFLAGS:=@CPPFLAGS@ -DDATAROOTDIR='"$(datarootdir)"' $(EXTRA_CPPFLAGS)
LDFLAGS:=@LDFLAGS@ $(EXTRA_LDFLAGS)
LDLIBS:=@LIBS@ $(EXTRA_LDLIBS)
&:local+global OBJECTS TARGETS
TARGETS:=secnet
OBJECTS:=secnet.o util.o conffile.yy.o conffile.tab.o conffile.o modules.o \
resolver.o random.o udp.o site.o transform-cbcmac.o transform-eax.o \
comm-common.o polypath.o privcache.o pubkeys.o pubkeys.yy.o \
netlink.o rsa.o dh.o serpent.o serpentbe.o \
md5.o sha512.o tun.o slip.o sha1.o ipaddr.o log.o \
process.o osdep.o @LIBOBJS@ \
hackypar.o base91s/base91.o
# version.o is handled specially below and in the link rule for secnet.
PYMODULES := ipaddrset.py argparseactionnoyes.py base91.py
TEST_OBJECTS:=eax-aes-test.o eax-serpent-test.o eax-serpentbe-test.o \
eax-test.o aes.o
ifeq (version.o,$(MAKECMDGOALS))
OBJECTS:=
TEST_OBJECTS:=
endif
&OBJECTS += $(OBJECTS) $(TEST_OBJECTS)
STALE_PYTHON_FILES= $(foreach e, py pyc, \
$(foreach p, /usr /usr/local, \
$(foreach l, ipaddr, \
$(DESTDIR)$p/share/secnet/$l.$e \
)))
%.yy.c %.yy.h: %.fl
flex --header=$*.yy.h -o$*.yy.c $<
%.c: %.y
# make has a builtin rule to run yacc, but we don't want that because
# our conffile.c is handwritten, and we use conffile.yy.c for the
# bison output. There is no need to do likewise for flex because
# our flex input files are end in .fl, not .l.
%.tab.c %.tab.h: %.y
bison -d -o $@ $<
%.o: %.c
$(CC) $(CPPFLAGS) $(ALL_CFLAGS) $(CDEPS_CFLAGS) -c $< -o $@
$(OBJECTS): conffile.yy.h pubkeys.yy.h base91s/base91.h
# ^ we can't write this as a dependency on the %.o %.c rule
# because (say) conffile.yy.c isn't mentioned so doesn't "ought
# to exist" in make's mind. But specifying it explicitly like this
# works.
all:: $(TARGETS)
${srcdir}/config.h.in: configure.ac
cd ${srcdir} && autoheader
touch $@
MAKEFILE_TEMPLATES += config.h.in
CONFIG_STATUS_OUTPUTS += config.h
# Manual dependencies section
conffile.yy.c: conffile.tab.c
%.tab.c: %.y
# End of manual dependencies section
%.yy.o: ALL_CFLAGS += -Wno-sign-compare -Wno-unused-function
secnet: $(OBJECTS)
$(MAKE) -f main.mk version.o # *.o $(filter-out %.o, $^)
$(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $(OBJECTS) version.o $(LDLIBS)
# We (always) regenerate the version, but only if we regenerate the
# binary. (This is necessary as the version string is can depend on
# any of the source files, eg to see whether "+" is needed.)
ifneq (,$(wildcard .git/HEAD))
# If we have (eg) committed, relink and thus regenerate the version
# with the new info from git describe.
secnet: Makefile .git/HEAD $(wildcard $(shell sed -n 's#^ref: #.git/#p' .git/HEAD))
secnet: $(wildcard .git/packed-refs)
endif
TESTDIRS=stest mtest
&TARGETS_check = eax-aes-test.confirm eax-serpent-test.confirm \
eax-serpentbe-test.confirm ipaddrset.confirm
&TARGETS_fullcheck += $(&TARGETS_check)
&TARGETS_fullcheck += msgcode-test.confirm
RECHECK_RM += $(&TARGETS_check)
recheck: check
.PHONY: FORCE
version.c: FORCE
echo "#include \"secnet.h\"" >$@.new
@set -ex; if test -e .git && type -p git >/dev/null; then \
v=$$(git describe --match 'v*'); v=$${v#v}; \
if ! git diff --quiet HEAD; then v="$$v+"; fi; \
else \
v="$(VERSION)"; \
fi; \
echo "char version[]=\"secnet $$v\";" >>$@.new
mv -f $@.new $@
eax-%-test: eax-%-test.o eax-test.o %.o
$(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $^
eax-%-test.confirm: eax-%-test eax-%-test.vectors
./$< <$(srcdir)/eax-$*-test.vectors >$@.new
mv -f $@.new $@
&CDEPS_OBJECTS += msgcode-test.o
msgcode-test: msgcode-test.o
$(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $^
msgcode-test.confirm: msgcode-test
./msgcode-test
touch $@
ipaddrset.confirm: ipaddrset-test.py ipaddrset.py ipaddrset-test.expected
$(srcdir)/ipaddrset-test.py >ipaddrset-test.new
diff -u $(srcdir)/ipaddrset-test.expected ipaddrset-test.new
touch $@
&CLEAN += & pubkeys.fl
pubkeys.fl: ${srcdir}/pubkeys.fl.pl
${srcdir}/pubkeys.fl.pl >$@.tmp && mv -f $@.tmp $@
.PRECIOUS: eax-%-test
installdirs:
$(INSTALL) -d $(prefix)/share/secnet $(sbindir)
$(INSTALL) -d $(mandir)/man8
$(INSTALL) -d $(datarootdir)/secnet
install: installdirs
set -e; ok=true; for f in $(STALE_PYTHON_FILES); do \
if test -e $$f; then \
echo >&\&2 "ERROR: $$f still exists "\
"- try \`make install-force'"; \
ok=false; \
fi; \
done; \
$$ok
$(INSTALL_PROGRAM) secnet $(sbindir)/`echo secnet|sed '$(transform)'`
$(INSTALL_PROGRAM) ${srcdir}/make-secnet-sites $(sbindir)/`echo make-secnet-sites|sed '$(transform)'`
set -e; for m in $(PYMODULES); do \
$(INSTALL_DATA) ${srcdir}/$$m $(prefix)/share/secnet/$$m; \
done
$(INSTALL_SCRIPT) ${srcdir}/polypath-interface-monitor-linux \
$(datarootdir)/secnet/.
$(INSTALL_DATA) ${srcdir}/secnet.8 $(mandir)/man8/secnet.8
install-force:
rm -f $(STALE_PYTHON_FILES)
$(MAKE) -f main.mk install
&CLEAN += .version.d
&CLEAN += $(TARGETS) $(&TARGETS_check) $(&TARGETS_fullcheck)
clean::
$(RM) -f *.o *.yy.[ch] *.tab.[ch] core version.c
$(RM) -f *.pyc *~ eax-*-test.confirm eax-*-test
$(RM) -rf __pycache__
$(RM) -f msgcode-test.confirm msgcode-test
realclean:: clean
$(RM) -f *~ Makefile config.h \
config.log config.status config.cache \
config.stamp Makefile.bak
distclean:: realclean
include subdirmk/regen.mk
&:warn !single-char-var
# Release checklist:
#
# 0. Use this checklist from Dir.sd.mk
#
# 1. Check that the tree has what you want
#
# 2. Update changelog:
# gbp dch --since=
# and then edit debian/changelog.
#
# 3. Update VERSION (in this file, above) and
# finalise debian/changelog (removing ~ from version) and commit.
#
# 4. Build source and binaries:
# dgit -wgf sbuild -A -c stretch -j8
#
# 5. dpkg -i on zealot just to check
# dpkg -i ~ian/things/Fvpn/bpd/secnet_${VERSION}_amd64.deb
#
# 6. run it on chiark
# check we can still ping davenant and chiark
#
# 7. Make git tag and source tarball signature:
# git-tag -u general -m "secnet $VERSION" -s v${VERSION//\~/_}
# gpg -u general --detach-sign ../bpd/secnet_$VERSION.tar.gz
#
# 8. Publish the branch and distriubtion files:
# git-push origin v${VERSION//\~/_} v${VERSION//\~/_}~0:master
# dcmd rsync -v ../bpd/secnet_${VERSION}_multi.changes chiark:/home/ianmdlvl/public-html/secnet/download/
#
# 8a. Upload to Debian:
# dgit push-source
#
# 9. Sort out html. On chiark as user secnet:
# cd ~secnet/public-html/release/
# mkdir $VERSION
# cd $VERSION
# ln -s /home/ianmdlvl/public-html/secnet/download/secnet?$VERSION* .
# ln -sfn $VERSION ../current
#
# 10. write and post a release announcement
# cd ../bpd
# dcmd sha256sum secnet_${VERSION}_multi.changes
# ...
# gpg --clearsign ../release-announcement
# rsync -vP ../release-announcement.asc c:mail/d/
#
# 11. bump changelog version in master, to new version with ~
work/Final.sd.mk 0000664 0000000 0000000 00000002101 15063477206 010723 0 ustar # Final.sd.mk for secnet
#
# This file is part of secnet.
# See README for full list of copyright holders.
#
# secnet is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# secnet is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# version 3 along with secnet; if not, see
# https://www.gnu.org/licenses/gpl.html.
# This contrives to delete things before make starts, if the user
# said "recheck". The alternative is having recheck be a target
# which contains the rm's and then runs $(MAKE) again but then
# we recursively re-enter make in parallel, which is Bad.
$(eval $(if $(filter recheck,$(MAKECMDGOALS)), \
$(shell set -x; rm -rf $(RECHECK_RM) )))
work/INSTALL 0000664 0000000 0000000 00000016154 15063477206 010002 0 ustar INSTALLATION INSTRUCTIONS for SECNET
USE AT YOUR OWN RISK. THIS IS ALPHA TEST SOFTWARE. I DO NOT
GUARANTEE THAT THERE WILL BE PROTOCOL COMPATIBILITY BETWEEN DIFFERENT
VERSIONS.
* Preparation
** System software support
Ensure that you have libgmp3-dev and adns installed (and bison and
flex, and for that matter gcc...).
[On BSD install /usr/ports/devel/bison]
If you intend to configure secnet to obtain packets from the kernel
through userv-ipif, install and configure userv-ipif. It is part of
userv-utils, available from ftp.chiark.greenend.org.uk in
/users/ian/userv
If you intend to configure secnet to obtain packets from the kernel
using the universal TUN/TAP driver, make sure it's configured in your
kernel (it's under "network device support" in Linux-2.4) and that
you've created the appropriate device files; see
linux/Documentation/networking/tuntap.txt
If you're using TUN/TAP on a platform other than Linux-2.4, see
http://vtun.sourceforge.net/tun/
You will probably be using the supplied `make-secnet-sites' program to
generate your VPN's list of sites as a secnet configuration from a
more-human-writeable form.
** System and network configuration
If you intend to start secnet as root, I suggest you create a userid
for it to run as once it's ready to drop its privileges. Example (on
Debian):
# adduser --system --no-create-home secnet
If you're using the 'soft routes' feature (for some classes of mobile
device) you'll have to run as root all the time, to enable secnet to
add and remove routes from your kernel's routing table. (This
restriction may be relaxed later if someone writes a userv service to
modify the routing table.)
If you are joining an existing VPN, read that VPN's documentation now.
It may supersede the next paragraph.
In most configurations, you will need to allocate two IP addresses for
use by secnet. One will be for the tunnel interface on your tunnel
endpoint machine (i.e. the address you see in 'ifconfig' when you look
at the tunnel interface). The other will be for secnet itself. These
addresses should probably be allocated from the range used by your
internal network: if you do this, you should provide appropriate
proxy-ARP on the internal network interface of the machine running
secnet (eg. add an entry net/ipv4/conf/eth_whatever/proxy_arp = 1 to
/etc/sysctl.conf on Debian systems and run sysctl -p). Alternatively
the addresses could be from some other range - this works well if the
machine running secnet is the default route out of your network - but
this requires more thought.
http://www.ucam.org/cam-grin/ may be useful.
* Installation
If you installed the Debian package of secnet, skip to "If installing
for the first time", below, and note that example.conf can be found in
/usr/share/doc/secnet/examples.
To install secnet do
$ ./configure
$ make
# make install
# mkdir /etc/secnet
(Note: you may see the following warning while compiling
conffile.tab.c; this is a bug in bison-1.28:
/usr/share/bison/bison.simple: In function `yyparse':
/usr/share/bison/bison.simple:285: warning: `yyval' might be used
uninitialized in this function
You may if you wish apply the following patch to bison.simple:
diff -pu -r1.28.0.1 -r1.28.0.3
--- bison.s1 1999/08/30 19:23:24 1.28.0.1
+++ bison.s1 1999/08/30 21:15:18 1.28.0.3
@@ -523,8 +523,14 @@ yydefault:
/* Do a reduction. yyn is the number of a rule to reduce with. */
yyreduce:
yylen = yyr2[yyn];
- if (yylen > 0)
- yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+ /* If yylen is nonzero, implement the default value of the action.
+ Otherwise, the following line sets yyval to the semantic value of
+ the lookahead token. This behavior is undocumented and bison
+ users should not rely upon it. Assigning to yyval
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that yyval may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
#if YYDEBUG != 0
if (yydebug)
)
Any other warnings or errors should be reported to
steve@greenend.org.uk.
If installing for the first time, do
# cp example.conf /etc/secnet/secnet.conf
# cd /etc/secnet
# ssh-keygen -f key -t rsa1 -N ""
(You may need ssh-keygen1, instead, which might be found in
openssh-client-ssh1.)
[On BSD use
$ LDFLAGS="-L/usr/local/lib" ./configure
$ gmake CFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib"
XXX this should eventually be worked out automatically by 'configure'.]
Generate a site file fragment for your site (see your VPN's
documentation, or see below), and submit it for inclusion in your
VPN's 'sites' file. Download the vpn-sites file to /etc/secnet/sites
- MAKE SURE YOU GET AN AUTHENTIC COPY because the sites file contains
public keys for all the sites in the VPN. Use the make-secnet-sites
program provided with the secnet distribution to convert the
distributed sites file into one that can be included in a secnet
configuration file:
# make-secnet-sites /etc/secnet/sites /etc/secnet/sites.conf
* Configuration
Should be reasonably obvious - edit /etc/secnet/secnet.conf as
prompted by the comments in example.conf. XXX Fuller documentation of
the configuration file format should be forthcoming in time. Its
syntax is described in the README file at the moment.
* Constructing your site file fragment
You need the following information:
1. the name of your VPN.
2. the name of your location(s).
3. a short name for your site, eg. "sinister". This is used to
identify your site in the vpn-sites file, and should probably be the
same as its hostname.
4. the DNS name of the machine that will be the "front-end" for your
secnet installation. This will typically be the name of the gateway
machine for your network, eg. sinister.dynamic.greenend.org.uk
secnet does not actually have to run on this machine, as long as the
machine can be configured to forward UDP packets to the machine that
is running secnet.
5. the port number used to contact secnet at your site. This is the
port number on the front-end machine, and does not necessarily have to
match the port number on the machine running secnet. If you want to
use a privileged port number we suggest 410. An appropriate
unprivileged port number is 51396.
6. the list of networks accessible at your site over the VPN.
7. the public part of the RSA key you generated during installation
(in /etc/secnet/key.pub if you followed the installation
instructions). This file contains three numbers and a comment on one
line.
If you are running secnet on a particularly slow machine, you may like
to specify a larger value for the key setup retry timeout than the
default, to prevent unnecessary retransmissions of key setup packets.
See the notes in the example configuration file for more on this.
The site file fragment should look something like this:
vpn sgo
location greenend
contact steve@greenend.org.uk
site sinister
networks 192.168.73.0/24 192.168.1.0/24 172.19.71.0/24
address sinister.dynamic.greenend.org.uk 51396
pubkey 1024 35 142982503......[lots more].....0611 steve@sinister
--
This file is part of secnet.
See LICENCE and CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/LICENCE 0000664 0000000 0000000 00000034676 15063477206 007747 0 ustar secnet - flexible VPN software
==============================
secnet is
Copyright 1995-2003 Stephen Early
Copyright 2002-2023 Ian Jackson
Copyright 1991 Massachusetts Institute of Technology
Copyright 1998 Ross Anderson, Eli Biham, Lars Knudsen
Copyright 1993 Colin Plumb
Copyright 1998 James H. Brown, Steve Reid
Copyright 1998 Miquel van Smoorenburg, Ian Murdock
Copyright 2000 Vincent Rijmen, Antoon Bosselaers, Paulo Barreto
Copyright 2001 Joey Hess
Copyright 2000-2006 Joachim Henkea
Copyright 2012-2016 Adrien Béraud
Copyright 2015 Guillaume Jacquenot
Copyright 2016 SunDwarf aka eyesismine
Copyright 2001 Saul Kravitz
Copyright 2004 Fabrice Bellard
Copyright 2002 Guido Draheim
Copyright 2005-2010 Free Software Foundation, Inc.
Copyright 1995-2001 Jonathan Amery
Copyright 1995-2003 Peter Benie
Copyright 2011 Richard Kettlewell
Copyright 2012 Matthew Vernon
Copyright 2013-2019 Mark Wooding
Copyright 1995-2013 Simon Tatham
Copyright 2012,2013 "Omnifarious" and "btel" on Stackoverflow
GPLv3+
======
secnet is distributed under the terms of the GNU General Public
License, version 3 or later.
secnet is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
The file COPYING in the source tree contains a copy of the GNU GPL v3.
A copy of this licence can be found on Debian systems (and
derivatives) in /usr/share/common-licenses/GPL-3.
Some files contain a notice with the abbreviated form:
SPDX-License-Identifier: GPL-3.0-or-later
As is conventional, this should be read as a licence grant.
Some included libraries contain CC-BY-SA 4.0 code, which is not
necessarily compatibile with future GPL versions, so the effective
licence for a built and distributed secnet package is GPLv3 only.
Contributing
============
Contributions to secnet are accepted based on the git commit
Signed-off-by convention, by which the contributors' certify their
contributions according to the Developer Certificate of Origin version
1.1 - see the file DEVELOPER-CERTIFICATE.
In accordance with the Developer Certificate of Origin, if you make a
contribution to one of the incorporated works with a more liberal
licence, you will be taken to have made your contribution under that
more liberal licence.
If you create a new file please be sure to add an appropriate licence
header. In the main parts of secnet this should be something like:
* This file is part of secnet.
* See LICENCE and CREDITS for full list of copyright holders.
* SPDX-License-Identifier: GPL-3.0-or-later
* There is NO WARRANTY.
Incorporated works
==================
Some of the source code has more liberal licences, all of which are
GPLv3-compatible, and potentially GPLv3+-compatible.
These portions can be used, distributed, and modified, separately,
under the more liberal licence. But when they are used or distributed
as part of secnet, the GPL applies to the combination.
ac_prog_cc_no_writeable_strings.m4
-----------------------------------
This is a version of ax_cflags_no_writable_strings.m4 which is
now in the Autoconf Archive, where it has this permission notice:
Copyright (c) 2008 Guido U. Draheim
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, see .
As a special exception, the respective Autoconf Macro's copyright owner
gives unlimited permission to copy, distribute and modify the configure
scripts that are the output of Autoconf when processing the Macro. You
need not follow the terms of the GNU General Public License when using
or distributing such scripts, even though portions of the text of the
Macro appear in them. The GNU General Public License (GPL) does govern
all other use of the material that constitutes the Autoconf Macro.
This special exception to the GPL applies to versions of the Autoconf
Macro released by the Autoconf Archive. When you make and distribute a
modified version of the Autoconf Macro, you may extend this special
exception to the GPL to apply to your modified version as well.
argparseactionnoyes.py
----------------------
Copyright 2012 "Omnifarious" (a user on StackOverFlow)
Copyright 2013 "btel" (a user on StackOverFlow)
https://stackoverflow.com/questions/9234258/in-python-argparse-is-it-possible-to-have-paired-no-something-something-arg/20422915#20422915
CC-BY-SA 4.0
https://creativecommons.org/licenses/by-sa/4.0/legalcode
by virtue of
https://stackoverflow.com/legal/terms-of-service#licensing
which says everything is CC-BY-SA and has a link to v4.0
(And which is therefore compatible with secnet's GPLv3)
all retrieved 4.11.2019 and rechecked 12.11.2022
aes.[ch]
--------
Copyright 2000 Vincent Rijmen, Antoon Bosselaers, Paulo Barreto
Copyright 2004 Fabrice Bellard
Copyright 2013 Ian Jackson
Original licence:
This code is hereby placed in the public domain.
THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
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 AUTHORS OR 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.
base91-c/
---------
Copyright (c) 2000-2006 Joachim Henke
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
- Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
- 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.
- Neither the name of Joachim Henke nor the names of his
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS 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
COPYRIGHT OWNER OR 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.
base91-python/
---------------
Copyright (c) 2012 Adrien Beraud
Copyright (c) 2015 Guillaume Jacquenot
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of Adrien Beraud, Wisdom Vibes Pte. Ltd., nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS 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
COPYRIGHT OWNER OR 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.
configure
---------
This is autogenerated from various other inputs, including FSF code in
utotools, regarding which the FSF say this:
Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
However, in fact, the script is GPLv3+ because it contains pieces
derived from secnet's aclocal.m4, etc.
debian/
-------
debian/init is from an original init script example by Miquel van
Smoorenburg and Ian Murdock. Modified by Richard Kettlewell.
debian/rules was once from an example from Joey Hess and is now
(after most of it was deleted) probably entirely the work of Ian
Jackson.
The remainder of debian/ is by the authors of Secnet (with possible
future changes made by Debian contributors).
install-sh
----------
Copyright 1991 by the Massachusetts Institute of Technology
Permission to use, copy, modify, distribute, and sell this software
and its documentation for any purpose is hereby granted without fee,
provided that the above copyright notice appear in all copies and
that both that copyright notice and this permission notice appear in
supporting documentation, and that the name of M.I.T. not be used in
advertising or publicity pertaining to distribution of the software
without specific, written prior permission. M.I.T. makes no
representations about the suitability of this software for any
purpose. It is provided "as is" without express or implied
warranty.
md5.[ch]
--------
Authored by Colin Plumb in 1993. Public domain statement:
This code implements the MD5 message-digest algorithm.
The algorithm is due to Ron Rivest. This code was
written by Colin Plumb in 1993, no copyright is claimed.
This code is in the public domain; do with it what you wish.
I interpet this as a blanket permision.
serpent.c, serpentsboxes.h
---------------------------
Authored by Ross Anderson, Eli Biham, Lars Knudsen.
Quoting the Serpent web page:
Serpent is now completely in the public domain, and we impose no
restrictions on its use. This was announced on the 21st August at
the First AES Candidate Conference. The optimised implementations
in the submission package are now under the General Public License
(GPL), although some comments in the code still say otherwise. You
are welcome to use Serpent for any application. If you do use it,
we would appreciate it if you would let us know!
https://www.cl.cam.ac.uk/~rja14/serpent.html
I have indeed corresponded with Ross Anderson about the use of Serpent
in secnet, and have updated the source comments to reflect the licence
upgrade.
sha1.c
------
Authored by Steve Reid and modified by James H. Brown,
Saul Kravitz, and Ian Jackson.
100% Public Domain
I interpet this as a blanket permision.
sha512.[ch]
-----------
Copyright (C) 2005, 2006, 2008, 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Written by David Madore, considerably copypasting from
Scott G. Miller's sha1.c
subdirmk/
---------
Copyright 2019-2020 Ian Jackson
Copyright 2019 Mark Wooding
subdirmk and its example is free software; you can redistribute it
and/or modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library as the file LGPL-2.
If not, see https://www.gnu.org/.
A copy of this licence can be found on Debian systems (and
derivatives) in /usr/share/common-licenses/LGPL-3.
u64.h
-----
uint64_t-like operations that work even on hosts lacking uint64_t
Copyright (C) 2006, 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
Written by Paul Eggert.
work/LICENSE 0000777 0000000 0000000 00000000000 15063477206 010727 2LICENCE ustar work/NOTES 0000664 0000000 0000000 00000045251 15063477206 007564 0 ustar * Design of new, multi-subnet secnet protocol
Like the first (1995/6) version, we're tunnelling IP packets inside
UDP packets. To defeat various restrictions which may be imposed on us
by network providers (like the prohibition of incoming TCP
connections) we're sticking with UDP for everything this time,
including key setup. This means we have to handle retries, etc.
Other new features include being able to deal with subnets hidden
behind changing 'real' IP addresses, and the ability to choose
algorithms and keys per pair of communicating sites.
** Configuration and structure
[The original plan]
The network is made up from a number of 'sites'. These are collections
of machines with private IP addresses. The new secnet code runs on
machines which have interfaces on the private site network and some
way of accessing the 'real' internet.
Each end of a tunnel is identified by a name. Often it will be
convenient for every gateway machine to use the same name for each
tunnel endpoint, but this is not vital. Individual tunnels are
identified by their two endpoint names.
[The new plan]
It appears that people want to be able to use secnet on mobile
machines like laptops as well as to interconnect sites. In particular,
they want to be able to use their laptop in three situations:
1) connected to their internal LAN by a cable; no tunnel involved
2) connected via wireless, using a tunnel to protect traffic
3) connected to some other network, using a tunnel to access the
internal LAN.
They want the laptop to keep the same IP address all the time.
Case (1) is simple.
Case (2) requires that the laptop run a copy of secnet, and have a
tunnel configured between it and the main internal LAN default
gateway. secnet must support the concept of a 'soft' tunnel where it
adds a route and causes the gateway to do proxy-ARP when the tunnel is
up, and removes the route again when the tunnel is down.
The usual prohibition of packets coming in from one tunnel and going
out another must be relaxed in this case (in particular, the
destination address of packets from these 'mobile station' tunnels may
be another tunnel as well as the host).
(Quick sanity check: if chiark's secnet address was in
192.168.73.0/24, would this work properly? Yes, because there will be
an explicit route to it, and proxy ARP will be done for it. Do we want
packets from the chiark tunnel to be able to go out along other
routes? No. So, spotting a 'local' address in a remote site's list of
networks isn't sufficient to switch on routing for a site. We need an
explicit option. NB packets may be routed if the source OR the
destination is marked as allowing routing [otherwise packets couldn't
get back from eg. chiark to a laptop at greenend]).
[the even newer plan]
secnet sites are configured to grant access to particular IP address
ranges to the holder of a particular public key. The key can certify
other keys, which will then be permitted to use a subrange of the IP
address range of the certifying key.
This means that secnet won't know in advance (i.e. at configuration
time) how many tunnels it might be required to support, so we have to
be able to create them (and routes, and so on) on the fly.
** VPN-level configuration
At a high level we just want to be able to indicate which groups of
users can claim ownership of which ranges of IP addresses. Assuming
these users (or their representatives) all have accounts on a single
machine, we can automate the submission of keys and other information
to make up a 'sites' file for the entire VPN.
The distributed 'sites' file should be in a more restricted format
than the secnet configuration file, to prevent attackers who manage to
distribute bogus sites files from taking over their victim's machines.
The distributed 'sites' file is read one line at a time. Each line
consists of a keyword followed by other information. It defines a
number of VPNs; within each VPN it defines a number of locations;
within each location it defines a number of sites. These VPNs,
locations and sites are turned into a secnet.conf file fragment using
a script.
Some keywords are valid at any 'level' of the distributed 'sites'
file, indicating defaults.
The keywords are:
vpn n: we are now declaring information to do with VPN 'n'. Must come first.
location n: we are now declaring information for location 'n'.
site n: we are now declaring information for site 'n'.
endsite: we're finished declaring information for the current site
restrict-nets a b c ...: restrict the allowable 'networks' for the current
level to those in this list.
end-definitions: prevent definition of further vpns and locations, and
modification of defaults at VPN level
dh x y: the current VPN uses the specified group; x=modulus, y=generator
hash x: which hash function to use. Valid options are 'md5' and 'sha1'.
admin n: administrator email address for current level
key-lifetime n
setup-retries n
setup-timeout n
wait-time n
renegotiate-time n
address a b: a=dnsname, b=port
networks a b c ...
pubkey x y z: x=keylen, y=encryption key, z=modulus
mobile: declare this to be a 'mobile' site
** Logging etc.
There are several possible ways of running secnet:
'reporting' only: --version, --help, etc. command line options and the
--just-check-config mode.
'normal' run: perform setup in the foreground, and then background.
'failed' run: setup in the foreground, and terminate with an error
before going to background.
'reporting' modes should never output anything except to stdout/stderr.
'normal' and 'failed' runs output to stdout/stderr before
backgrounding, then thereafter output only to log destinations.
** Site long-term keys
We use authenticated DH. Sites identify themselves to each other
using long-term signing keys.
These signing keys may be for a variety of algorithms. (An algorithm
specifies completely how to do a signature and verification.)
Each site may have several keys. This helps support key rollover and
algorithm agility. Several keys of different algorithms can form a
key group. Usually a key group consists of keys generated at the same
time. A key is identified by a 4-byte group id (invented by its
publisher and opaque) plus a 1-byte algorithm id (defined by the
protocol spec for each algorithm).
Keys are published in key sets. A key set is a collection of key
groups (including older keys as well as newer ones) published at a
particular time. Key sets have their own 4-byte ids; these are
invented by the publisher but are ordered using sequence number
arithmetic. This allows reliers to favour new sets over old ones.
Within each key set, some groups may be marked as `fallback'. This
means a group that should be tolerated by a relier only if the relier
doesn't support any non-fallback keys.
Keys within groups, and groups within sets, are ordered (by the
publisher of the set), from most to least preferred.
When deciding which public keys to accept, a relier should:
Process each group within the key set.
Discard unknown algorithms.
Choose a preferred algorithm:
Earliest in the group
(or local config could have algorithm prefererence).
Discard empty groups.
Discard unneeded fallback groups:
If any (non-empty) non-fallback groups found, discard all
fallback groups. Otherwise there are only fallback groups;
discard all but first group in the set.
Discard any keys exceeding limit on number of keys honoured:
Limit is at least 4
Discard keys later in the set
In wire protocol, offer the resulting subset of keyids to
the peer and a allow the signer to select which key to use
from that subset.
In configuration and key management, long-term private and public keys
are octet strings. Private keys are generally stored in disk files,
one key per file. The octet string for a private key should identify
the algorithm so that passing the private key to the code for the
wrong algorithm does not produce results which would leak or weaken
the key. The octet string for a public key need not identify the
algorithm; when it's loaded the algorithm will be known from context.
The group id 00000000 is special. It should contain only one key,
algorithm 00. Key 0000000000 refers to the rsa1 key promulgated
before the key rollover/advertisement protocols, or the key which
should be used by sites running old software.
The key set id 00000000 is special and is considered older than all
othere key sets (ie this is an exception to the sequence number
arithmetic). It is the implied key set id of the rsa1 key
promulgated before the key rollover/advertisement protocols.
The algorithm 00 is special and refers to the old rsa1 signature
protocol but unusually does not identify the hash function. The hash
function is conventional and must be specified out of band. In known
existing installations it is SHA-1.
** Protocols
*** Protocol environment:
Each gateway machine serves a particular, well-known set of private IP
addresses (i.e. the agreement over which addresses it serves is
outside the scope of this discussion). Each gateway machine has an IP
address on the interconnecting network (usually the Internet), which
may be dynamically allocated and may change at any point.
Each gateway knows the RSA public keys of the other gateways with
which it wishes to communicate. The mechanism by which this happens is
outside the scope of this discussion. There exists a means by which
each gateway can look up the probable IP address of any other.
*** Protocol goals:
The ultimate goal of the protocol is for the originating gateway
machine to be able to forward packets from its section of the private
network to the appropriate gateway machine for the destination
machine, in such a way that it can be sure that the packets are being
sent to the correct destination machine, the destination machine can
be sure that the source of the packets is the originating gateway
machine, and the contents of the packets cannot be understood other
than by the two communicating gateways.
XXX not sure about the address-change stuff; leave it out of the first
version of the protocol. From experience, IP addresses seem to be
quite stable so the feature doesn't gain us much.
**** Protocol sub-goal 1: establish a shared key
Definitions:
A is the originating gateway machine name
B is the destination gateway machine name
A+ and B+ are the names with optional additional data, see below
PK_A is the public RSA key of A
PK_B is the public RSA key of B
PK_A^-1 is the private RSA key of A
PK_B^-1 is the private RSA key of B
x is the fresh private DH key of A
y is the fresh private DH key of B
k is g^xy mod m
g and m are generator and modulus for Diffie-Hellman
nA is a nonce generated by A
nB is a nonce generated by B
iA is an index generated by A, to be used in packets sent from B to A
iB is an index generated by B, to be used in packets sent from A to B
i? is appropriate index for receiver
Note that 'i' may be re-used from one session to the next, whereas 'n'
is always fresh.
The optional additional data after the sender's name consists of some
initial subset of the following list of items:
* A 32-bit integer with a set of capability flags, representing the
abilities of the sender.
* In MSG3/MSG4: a 16-bit integer being the sender's MTU, or zero.
(In other messages: nothing.) See below.
* In MSG2/MSG3: a list of the peer's public keys that the sender will
accept: (i) a 1-byte integer count (ii) that many 5-byte key ids.
If not present, implicitly only the special key id 0000000000.
* In MSG3/MSG4: an 8-bit integer being an index into the
receiver's public key acceptance list, with which the message
is signed. If not present, implicitly the key id 00000000000.
* More data which is yet to be defined and which must be ignored
by receivers.
The optional additional data after the receiver's name is not
currently used. If any is seen, it must be ignored.
Capability flag bits must be in one the following two categories:
1. Early capability flags must be advertised in MSG1 or MSG2, as
applicable. If MSG3 or MSG4 advertise any "early" capability bits,
MSG1 or MSG3 (as applicable) must have advertised them too.
2. Late capability flags may be advertised only in MSG2 or MSG3, as
applicable. They are only in MSG1 with newer secnets; older
versions omit them. MSG4 must advertise the same set as MSG2.
Currently, the low 16 bits are allocated for negotiating bulk-crypto
transforms. Bits 8 to 15 are used by Secnet as default capability
numbers for the various kinds of transform closures: bit 8 is for the
original CBCMAC-based transform, and bit 9 for the new EAX transform;
bits 10 to 15 are reserved for future expansion. The the low eight bits
are reserved for local use, e.g., to allow migration from one set of
parameters for a particular transform to a different, incompatible set
of parameters for the same transform. Bit 31, if advertised by both
ends, indicates that a mobile end gets priority in case of crossed MSG1.
The remaining bits have not yet been assigned a purpose.
Whether a capability number is early depends on its meaning, rather than
being a static property of its number. That said, the mobile-end-gets
priority bit (31) is always sent as an `early' capability bit.
MTU handling
In older versions of secnet, secnet was not capable of fragmentation
or sending ICMP Frag Needed. Administrators were expected to configure
consistent MTUs across the network.
It is still the case in the current version that the MTUs need to be
configured reasonably coherently across the network: the allocated
buffer sizes must be sufficient to cope with packets from all other
peers.
However, provided the buffers are sufficient, all packets will be
processed properly: a secnet receiving a packet larger than the
applicable MTU for its delivery will either fragment it, or reject it
with ICMP Frag Needed.
The MTU additional data field allows secnet to advertise an MTU to the
peer. This allows the sending end to handle overlarge packets, before
they are transmitted across the underlying public network. This can
therefore be used to work around underlying network braindamage
affecting large packets.
If the MTU additional data field is zero or not present, then the peer
should use locally-configured MTU information (normally, its local
netlink MTU) instead.
If it is nonzero, the peer may send packets up to the advertised size
(and if that size is bigger than the peer's administratively
configured size, the advertiser promises that its buffers can handle
such a large packet).
A secnet instance should not assume that just because it has
advertised an mtu which is lower than usual for the vpn, the peer will
honour it, unless the administrator knows that the peers are
sufficiently modern to understand the mtu advertisement option. So
secnet will still accept packets which exceed the link MTU (whether
negotiated or assumed).
Messages:
1) A->B: i*,iA,msg1,A+,B+,nA
i* must be encoded as 0. (However, it is permitted for a site to use
zero as its "index" for another site.)
2) B->A: iA,iB,msg2,B+,A+,nB,nA
(The order of B and A reverses in alternate messages so that the same
code can be used to construct them...)
3) A->B: {iB,iA,msg3,A+,B+,[chosen-transform],nA,nB,g^x mod m}_PK_A^-1
If message 1 was a replay then A will not generate message 3, because
it doesn't recognise nA.
If message 2 was from an attacker then B will not generate message 4,
because it doesn't recognise nB.
4) B->A: {iA,iB,msg4,B+,A+,nB,nA,g^y mod m}_PK_B^-1
At this point, A and B share a key, k. B must keep retransmitting
message 4 until it receives a packet encrypted using key k.
5) A: iB,iA,msg5,(ping/msg5)_k
6) B: iA,iB,msg6,(pong/msg6)_k
(Note that these are encrypted using the same transform that's used
for normal traffic, so they include sequence number, MAC, etc.)
The ping and pong messages can be used by either end of the tunnel at
any time, but using msg0 as the unencrypted message type indicator.
**** Protocol sub-goal 2: end the use of a shared key
7) i?,i?,msg0,(end-session/msg7,A,B)_k
This message can be sent by either party. Once sent, k can be
forgotten. Once received and checked, k can be forgotten. No need to
retransmit or confirm reception. It is suggested that this message be
sent when a key times out, or the tunnel is forcibly terminated for
some reason.
**** Protocol sub-goal 3: send a packet
8) i?,i?,msg0,(send-packet/msg9,packet)_k
**** Other messages
9) i?,i?,NAK (NAK is encoded as zero)
If the link-layer can't work out what to do with a packet (session has
gone away, etc.) it can transmit a NAK back to the sender.
This can alert the sender to the situation where the sender has a key
but the receiver doesn't (eg because it has been restarted). The
sender, on receiving the NAK, will try to initiate a key exchange.
Forged (or overly delayed) NAKs can cause wasted resources due to
spurious key exchange initiation, but there is a limit on this because
of the key exchange retry timeout.
10) i?,i?,msg8,A,B,nA,nB,msg?
This is an obsolete form of NAK packet which is not sent by any even
vaguely recent version of secnet. (In fact, there is no evidence in
the git history of it ever being sent.)
This message number is reserved.
11) *,*,PROD,A,B
Sent in response to a NAK from B to A. Requests that B initiates a
key exchange with A, if B is willing and lacks a transport key for A.
(If B doesn't have A's address configured, implicitly supplies A's
public address.)
This is necessary because if one end of a link (B) is restarted while
a key exchange is in progress, the following bad state can persist:
the non-restarted end (A) thinks that the key is still valid and keeps
sending packets, but B either doesn't realise that a key exchange with
A is necessary or (if A is a mobile site) doesn't know A's public IP
address.
Normally in these circumstances B would send NAKs to A, causing A to
initiate a key exchange. However if A and B were already in the
middle of a key exchange then A will not want to try another one until
the first one has timed out ("setup-time" x "setup-retries") and then
the key exchange retry timeout ("wait-time") has elapsed.
However if B's setup has timed out, B would be willing to participate
in a key exchange initiated by A, if A could be induced to do so.
This is the purpose of the PROD packet.
We send no more PRODs than we would want to send data packets, to
avoid a traffic amplification attack. We also send them only in state
WAIT, as in other states we wouldn't respond favourably. And we only
honour them if we don't already have a key.
With PROD, the period of broken communication due to a key exchange
interrupted by a restart is limited to the key exchange total
retransmission timeout, rather than also including the key exchange
retry timeout.
--
This file is part of secnet.
See LICENCE and CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/NOTES.peer-keys 0000664 0000000 0000000 00000011462 15063477206 011464 0 ustar peerkeys files
--------------
live file, loaded on startup, updated by secnet
(only). * in-memory peerkeys_current is kept
synced with this file
~update update file from config manager, checked before
every key exchange. config manager must rename
this file into place; it will be renamed and
then removed by secnet.
~proc update file being processed by secnet.
only secnet may write or remove.
~incoming update file from peer, being received by secnet
may be incomplete, unverified, or even malicious
only secnet may write or remove.
~tmp update file from config manager, only mss may
write or rename
secnet discards updates that are not more recent than (by
serial) the live file. But it may not process updates
immediately.
The implied keyset to be used is MAX(live, proc, update).
secnet does:
check live vs proc, either mv proc live or rm proc
if proc doesn't exist, mv update proc
make-secnet-sites does:
write: rename something onto update
read: read update,proc,live in that order and take max
We support only one concurrent secnet, one concurrent
writing make-secnet-sites, and any number of readers.
We want to maintain a live file at all times as that
is what secnet actually reads at startup and uses.
Proof that this is sound:
Let us regard update,proc,live as i=0,1,2
Files contain public key sets and are manipulated as
a whole, and we may regard key sets with the same
serial as equivalent.
We talk below about reading as if it were atomic.
Actually the atomic operation is open(2); the
reading gets whatever that name refers to. So
we can model this as an atomic read.
secnet eventually moves all data into the live file
or deletes it, so there should be no indefinitely
stale data; informally this means we can disregard
the possibility of very old serials and regard
serials as fully ordered. (We don't bother with
a formal proof of this property.)
Consequently we will only think about the serial
and not the contents. We treat absent files as
minimal (we will write -1 for convenience although
we don't mean a numerical value). We write S(i).
Invariant 1 for secnet's transformations is as follows:
Each file S(i) is only reduced (to S'(i)) if for some j S'(j)
>= S(i), with S'(j) either being >= S(i) beforehand, or
updated atomically together with S(i).
Proof of invariant 1 for the secnet operations:
(a) check live vs proc, proc>live, mv:
j=2, i=1; S'(i)=-1, so S(i) is being reduced. S'(j) is
equal to S(i), and the rename is atomic [1], so S'(j) and
S'(i) are updated simultaneously. S(j) is being
increased. (There are no hazards from concurrent writers;
only we ourselves (secnet) write to live or proc.)
(b) check live vs proc, proc<=live, rm:
j=2, i=1; S'(i)=-1, so S(i) is being reduced. But
S(j) is >= $(i) throughout. (Again, no concurrent
writer hazards.)
(c) mv update proc (when proc does not exist):
j=1, i=0; S(i) is being reduced to -1. But simultaneously
S(j) is being increased to the old S(i). Our precondition
(proc not existing) is not subject to a concurrent writer
hazards because only we write to proc; our action is
atomic and takes whatever update is available (if any).
Proof of soundness for the mss reading operation:
Let M be MAX(\forall S) at the point where mss reads update.
Invariant 2: when mss reads S(k), MAX(K, S(k)..S(2)) >= M,
where K is the max S it has seen so far. Clearly this is
true for k=0 (with K==-1). secnet's operations never break
this invariant because if any S() is reduced, another one
counted must be increased. mss's step operation
updates K with S(k), so MAX(K', S(k+1)..)=MAX(K, S(k)..),
and updates k to k+1, preserving the invariant.
At the end we have k=3 and K=>M. Since secnet never
invents serials, K=M in the absence of an mss update
with a bigger S.
Consideration of the mss update operation:
Successive serials from sites file updates etc. are supposed
to be increasing. When this is true, M is increased. A
concurrent reading mss which makes its first read after the
update will get the new data (by the proofs above). This
seems to be the required property.
QED.
[1] From "Base Specifications issue 7",
2.9.7 Thread Interactions with Regular File Operations
All of the following functions shall be atomic with respect to
each other in the effects specified in POSIX.1-2017 when they
operate on regular files or symbolic links:
... rename ... open ...
--
This file is part of secnet.
See LICENCE and CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/OLD-BUGS 0000664 0000000 0000000 00000001033 15063477206 010036 0 ustar Known bugs in secnet
(Complaints from Ian:)
Your init.d script makes it hard to start secnet as non-root, too.
secnet -jv has printed a large routing table full of stuff I wasn't
interested in.
Make explicit in the documentation that -n causes all log output to go
to stderr. Provide an option that is _really_ just "don't fork()" for
people who want to run secnet from init.
--
This file is part of secnet.
See LICENCE and CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/OLD-NEWS 0000664 0000000 0000000 00000030030 15063477206 010051 0 ustar * Planned for the future
Please note that the 0.1 series of secnet releases is now 'maintenance
only'; further development continues in secnet-0.2.
Debconf support - if you are using the Debian packaged version and
your secnet configuration is autogenerated using debconf then the
upgrade to version 0.2.0 should just involve installing the package;
an appropriate 0.2-style configuration file will be generated
automatically.
* New in version 0.1.18
ipaddr.py now declares its character encoding; required by recent
versions of Python
* New in version 0.1.17
autoconf updates for cross-compilation / more modern autoconf from
Ross Younger
MacOS X support from Richard Kettlewell
Makefile fix: Update bison pattern rule to indicate that both the
.tab.c and .tab.h files are generated by the same command.
i386 ip_csum implementation updated to work with modern gcc
Rename global 'log' to 'slilog' to avoid conflict with gcc built-in
log() function.
* New in version 0.1.16
XXX XXX PROTOCOL COMPATIBILITY IS BROKEN BETWEEN VERSION 0.1.16 AND
XXX XXX ALL PREVIOUS VERSIONS.
Bugfix: rsa.c private-key now works properly when you choose not to
verify it.
Bugfix: serpent key setup was only using the first 8 bytes of the key
material. (Oops!) Ian Jackson contributed a fix so the full 32 bytes
are used, in big-endian mode.
Debatable-bugfix: RSA operations now use PKCS1 v1.5-style padding
"Hacky parallelism" contributed by Ian Jackson; this permits
public-key operations to be performed in a subprocess during key
exchange, to make secnet more usable on very slow machines. This is
not compiled in by default; if you find you need it (because key
exchanges are taking more than a second or two) then add
-DHACKY_PARALLEL to FLAGS in the Makefile.in and recompile.
udp module updates from Peter Benie:
1) Handle the case where authbind-helper terminates with a signal
2) Cope with signals being delivered during waitpid
3) Add 'address' (optional) to the udp settings. This is an IP address
that the socket will be bound to.
4) Change the endianess of the arguments to authbind-helper.
sprintf("%04X") already translates from machine repesentation to most
significant octet first so htons reversed it again.
All uses of alloca() expunged by Peter Benie.
make-secnet-sites now supports configurations where each tunnel gets
its own interface on the host, and the IP router code in secnet is
disabled. make-secnet-sites has been rewritten for clarity. For
information on how to configure secnet for one-interface-per-tunnel,
see the example.conf file.
* New in version 0.1.15
Now terminates with an error when an "include" filename is not
specified in the configuration file (thanks to RJK).
RSA private key operations optimised using CRT. Thanks to SGT.
Now compiles cleanly with -Wwrite-strings turned on in gcc.
Anything sent to stderr once secnet has started running in the
background is now redirected to the system/log facility.
* New in version 0.1.14
The --help and --version options now send their output to stdout.
Bugfix: TUN flavour "BSD" no longer implies a BSD-style ifconfig and
route command invocation. Instead "ioctl"-style is used, which should
work on both BSD and linux-2.2 systems.
If no "networks" parameter is specified for a netlink device then it
is assumed to be 0.0.0.0/0 rather than the empty set. So, by default
there is a default route from each netlink device to the host machine.
The "networks" parameter can be used to implement a primitive
firewall, restricting the destination addresses of packets received
through tunnels; if a more complex firewall is required then implement
it on the host.
* New in version 0.1.13
site.c code cleaned up; no externally visible changes
secnet now calls setsid() after becoming a daemon.
secnet now supports TUN on Solaris 2.5 and above (and possibly other
STREAMS-based systems as well).
The TUN code now tries to auto-detect the type of "TUN" in use
(BSD-style, Linux-style or STREAMS-style). If your configuration file
specifies "tun-old" then it defaults to BSD-style; however, since
"tun-old" will be removed in a future release, you should change your
configuration file to specify "tun" and if there's a problem also
specify the flavour in use.
Example:
netlink tun-old {
...
};
should be rewritten as
netlink tun {
flavour "bsd";
...
};
The flavours currently defined are "bsd", "linux" and "streams".
The TUN code can now be configured to configure interfaces and
add/delete routes using one of several methods: invoking a
"linux"-style ifconfig/route command, a "bsd"-style ifconfig/route
command, "solaris-2.5"-style ifconfig/route command or calling ioctl()
directly. These methods can be selected using the "ifconfig-type" and
"route-type" options.
Example:
netlink tun {
ifconfig-type "ioctl";
route-type "ioctl";
...
};
The ioctl-based method is now the default for Linux systems.
Magic numbers used within secnet are now collected in the header file
"magic.h".
netlink now uses ICMP type=0 code=13 for 'administratively prohibited'
instead of code 9. See RFC1812 section 5.2.7.1.
The UDP comm module now supports a proxy server, "udpforward". This
runs on a machine which is directly accessible by secnet and which can
send packets to appropriate destinations. It's useful when the proxy
machine doesn't support source- and destination-NAT. The proxy server
is specified using the "proxy" key in the UDP module configuration;
parameters are IP address (string) and port number.
Bugfix: ipset_to_subnet_list() in ipaddr.c now believed to work in all
cases, including 0.0.0.0/0
* New in version 0.1.12
IMPORTANT: fix calculation of 'now' in secnet.c; necessary for correct
operation.
(Only interesting for people building and modifying secnet by hand:
the Makefile now works out most dependencies automatically.)
The netlink code no longer produces an internal routing table sorted
by netmask length. Instead, netlink instances have a 'priority'; the
table of routes is sorted by priority. Devices like laptops that have
tunnels that must sometimes 'mask' parts of other tunnels should be
given higher priorities. If a priority is not specified it is assumed
to be zero.
Example usage:
site laptop { ...
link netlink {
route "192.168.73.74/31";
priority 10;
};
};
* New in version 0.1.11
Lists of IP addresses in the configuration file can now include
exclusions as well as inclusions. For example, you can specify all
the hosts on a subnet except one as follows:
networks "192.168.73.0/24","!192.168.73.70";
(If you were only allowed inclusions, you'd have to specify that like
this:
networks "192.168.73.71/32","192.168.73.68/31","192.168.73.64/30",
"192.168.73.72/29","192.168.73.80/28","192.168.73.96/27",
"192.168.73.0/26","192.168.73.128/25";
)
secnet now ensures that it invokes userv-ipif with a non-overlapping
list of subnets.
There is a new command-line option, --sites-key or -s, that enables
the configuration file key that's checked to determine the list of
active sites (default "sites") to be changed. This enables a single
configuration file to contain multiple cofigurations conveniently.
NAKs are now sent when packets arrive that are not understood. The
tunnel code initiates a key setup if it sees a NAK. Future
developments should include configuration options that control this.
The tunnel code notifies its peer when secnet is terminating, so the
peer can close the session.
The netlink "exclude-remote-networks" option has now been replaced by
a "remote-networks" option; instead of specifying networks that no
site may access, you specify the set of networks that remote sites are
allowed to access. A sensible example: "192.168.0.0/16",
"172.16.0.0/12", "10.0.0.0/8", "!your-local-network"
* New in version 0.1.10
WARNING: THIS VERSION MAKES A CHANGE TO THE CONFIGURATION FILE FORMAT
THAT IS NOT BACKWARD COMPATIBLE. However, in most configurations the
change only affects the sites.conf file, which is generated by the
make-secnet-sites script; after you regenerate your sites.conf using
version 0.1.10, everything should continue to work.
Netlink devices now interact slightly differently with the 'site'
code. When you invoke a netlink closure like 'tun' or 'userv-ipif',
you get another closure back. You then invoke this closure (usually
in the site definitions) to specify things like routes and options.
The result of this invocation should be used as the 'link' option in
site configurations.
All this really means is that instead of site configurations looking
like this:
foo {
name "foo";
networks "a", "b", "c";
etc.
};
...they look like this:
foo {
name "foo";
link netlink { routes "a", "b", "c"; };
etc.
};
This change was made to enable the 'site' code to be completely free
of any knowledge of the contents of the packets it transmits. It
should now be possible in the future to tunnel other protocols like
IPv6, IPX, raw Ethernet frames, etc. without changing the 'site' code
at all.
Point-to-point netlink devices work slightly differently; when you
apply the 'tun', 'userv-ipif', etc. closure and specify the
ptp-address option, you must also specify the 'routes' option. The
result of this invocation should be passed directly to the 'link'
option of the site configuration. You can do things like this:
sites site {
name "foo";
link tun {
networks "192.168.73.76/32";
local-address "192.168.73.76"; # IP address of interface
ptp-address "192.168.73.75"; # IP address of other end of link
routes "192.168.73.74/32";
mtu 1400;
buffer sysbuffer();
};
etc.
};
The route dump obtained by sending SIGUSR1 to secnet now includes
packet counts.
Point-to-point mode has now been tested.
tun-old has now been tested, and the annoying 'untested' message has
been removed. Thanks to SGT and JDA.
secnet now closes its stdin, stdout and stderr just after
backgrounding.
Bugfix: specifying network "0.0.0.0/0" (or "default") now works
correctly.
* New in version 0.1.9
The netlink code may now generate ICMP responses to ICMP messages that
are not errors, eg. ICMP echo-request. This makes Windows NT
traceroute output look a little less strange.
configure.in and config.h.bot now define uint32_t etc. even on systems
without stdint.h and inttypes.h (needed for Solaris 2.5.1)
GNU getopt is included for systems that lack it.
We check for LOG_AUTHPRIV before trying to use it in log.c (Solaris
2.5.1 doesn't have it.)
Portable snprintf.c from http://www.ijs.si/software/snprintf/ is
included for systems that lack snprintf/vsnprintf.
make-secnet-sites.py renamed to make-secnet-sites and now installed in
$prefix/sbin/make-secnet-sites; ipaddr.py library installed in
$prefix/share/secnet/ipaddr.py. make-secnet-sites searches
/usr/local/share/secnet and /usr/share/secnet for ipaddr.py
* New in version 0.1.8
Netlink devices now support a 'point-to-point' mode. In this mode the
netlink device does not require an IP address; instead, the IP address
of the other end of the tunnel is specified using the 'ptp-address'
option. Precisely one site must be configured to use the netlink
device. (I haven't had a chance to test this because 0.1.8 turned into
a 'quick' release to enable secnet to cope with the network problems
affecting connections going via LINX on 2001-10-16.)
The tunnel code in site.c now initiates a key setup if the
reverse-transform function fails (wrong key, bad MAC, too much skew,
etc.) - this should make secnet more reliable on dodgy links, which
are much more common than links with active attackers... (an attacker
can now force a new key setup by replaying an old packet, but apart
from minor denial of service on slow links or machines this won't
achieve them much). This should eventually be made configurable.
The sequence number skew detection code in transform.c now only
complains about 'reverse skew' - replays of packets that are too
old. 'Forward skew' (gaps in the sequence numbers of received packets)
is now tolerated silently, to cope with large amounts of packet loss.
--
This file is part of secnet.
See LICENCE and CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/README 0000664 0000000 0000000 00000056336 15063477206 007637 0 ustar secnet - flexible VPN software
See LICENCE for legal information and CREDITS for a list of
contributors.
* Introduction
secnet allows large virtual private networks to be constructed
spanning multiple separate sites. It is designed for the case where a
private network connecting many hosts is 'hidden' behind a single
globally-routable IP address, but can also be applied in other
circumstances. It communicates entirely using UDP, and works well
with gateways that implement network address translation.
If you are installing secnet to join an existing VPN, you should read
the 'INSTALL' file and your particular VPN's documentation now. You
may need to refer back to this file for information on the netlink and
comm sections of the configuration file.
If you are thinking about setting up a new VPN of any size (from one
providing complete links between multiple sites to a simple
laptop-to-host link), read the section in this file on 'Creating a
VPN'.
* Mailing lists and bug reporting
There are two mailing lists associated with secnet: an 'announce' list
and a 'discuss' list. Their addresses are:
http://www.chiark.greenend.org.uk/mailman/listinfo/secnet-announce
http://www.chiark.greenend.org.uk/mailman/listinfo/secnet-discuss
The -announce list receives one message per secnet release. The
-discuss list is for general discussion, including help with
configuration, bug reports, feature requests, etc.
Bug reports should be sent to ; they will be
forwarded to the -discuss list by me.
* Creating a VPN
XXX TODO
* secnet configuration file format
By default secnet on linux reads /etc/secnet/secnet.conf. The default
may be different on other platforms.
This file defines a dictionary (a mapping from keys to values) full of
configuration information for secnet. Two keys must be defined in
this file for secnet to start. One is "system", a dictionary
containing systemwide control parameters. The other is "sites", a
list of all the sites that you intend to communicate with.
The configuration file has a very simple syntax; keys are defined as
follows:
key definition;
or
key = definition;
(the "=" is optional)
Keys must match the following regular expression:
[[:alpha:]_][[:alnum:]\-_]*
i.e. the first character must be an alpha or an underscore, and the
remaining characters may be alphanumeric, '-' or '_'.
Keys can be defined to be a comma-separated list of any of the
following types:
a boolean
a string, in quotes
a number, in decimal
a dictionary of definitions, enclosed in { }
a "closure", followed by arguments
a path to a key that already exists, to reference that definition
Note that dictionaries can be nested: a key in one dictionary can
refer to another dictionary. When secnet looks for a key in a
particular directory and can't find it, it looks in the dictionary's
lexical 'parents' in turn until it finds it (or fails to find it at
all and stops with an error).
Definitions can refer to previous definitions by naming them with a
path. Paths are key1/key2/key3... (starting from wherever we find
key1, i.e. in the current dictionary or any of its parents), or
alternatively /key1/key2/key3... (to start from the root).
Definitions cannot refer to future definitions.
Example:
a=1;
b=2;
c={ d=3; e=a; };
f={ a=4; g=c; };
The following paths are valid:
a is 1
b is 2
c is a dictionary:
c/d is 3
c/e is 1
f is a dictionary:
f/a is 4
f/g is a dictionary:
f/g/d is 3
f/g/e is 1
Note that f/g/e is NOT 4.
Elements that are lists are inserted into lists in definitions, not
referenced by them (i.e. you can't have lists of lists).
Some closures may be followed by an argument list in ( ), and may
return any number of whatever type they like (including other
closures). Some types of closure (typically those returned from
invokations of other closures) cannot be invoked.
closure { definitions } is short for closure({definitions}).
The main body of secnet, and all the additional modules, predefine
some keys in the root dictionary. The main ones are:
yes, true, True, TRUE, on: the boolean value True
no, false, False, FALSE, off: the boolean value False
makelist: turns a dictionary (arg1) into a list of definitions
(ignoring the keys)
readfile: reads a file (arg1) and returns it as a string
map: applies the closure specified as arg1 to each of the
remaining elements in the list in turn. Returns a list
made up of the outputs of the closure.
Keys defined by modules are described below, in the module
documentation.
Other configuration files can be included inline by writing "include
filename" at the start of a line.
After the configuration file is read, secnet looks for particular keys
in configuration space to tell it what to do:
system: a dictionary which can contain the following keys:
log (log closure): a destination for system messages
userid (string): the userid for secnet to run as once it drops privileges
pidfile (string): where to store its PID
sites: a list of closures of type 'site', which define other tunnel
endpoints that secnet will attempt to communicate with
* secnet command line options
Usage: secnet [OPTION]...
-f, --silent, --quiet suppress error messages
-w, --nowarnings suppress warnings
-v, --verbose output extra diagnostics
-c, --config=filename specify a configuration file
-j, --just-check-config stop after reading configfile
-n, --nodetach do not run in background
-d, --debug=item,... set debug options
--help display this help and exit
--version output version information and exit
* base91s
secnet defines a variant of the base91 encoding `basE91', from
http://base91.sourceforge.net/
base91s is the same as baseE91 except that:
- in the encoded charset, `"' is replaced with `-'
- spaces, newlines etc. and other characters outside the charset
are not permitted (although in some places they may be ignored,
this is not guaranteed).
* secnet builtin modules
** resolver
Defines:
adns (closure => resolver closure)
adns: dict argument
config (string): optional, a resolv.conf for ADNS to use
** random
Defines:
randomsrc (closure => randomsrc closure)
randomsrc: string[,bool]
arg1: filename of random source
arg2: if True then source is blocking
** udp
Defines:
udp (closure => comm closure)
udp: dict argument
address (string list): IPv6 or IPv4 addresses to listen and send on;
default is all local addresses
port (integer): UDP port to listen and send on; optional if you
don't need to have a stable address for your peers to talk to
(in which case your site ought probably to have `local-mobile true').
buffer (buffer closure): buffer for incoming packets
authbind (string): optional, path to authbind-helper program
** polypath
Defines:
polypath (closure => comm closure)
polypath: dict argument
port (integer): UDP port to listen and send on
buffer (buffer closure): buffer for incoming packets
authbind (string): optional, path to authbind-helper program
max-interfaces (number): optional, max number of different interfaces to
use (also, maximum steady-state amount of packet multiplication);
interfaces marked with `@' do not count.
interfaces (string list): which interfaces to process; each entry is
optionally `!' or `+' or `@' followed by a glob pattern (which is
applied to a prospective interface using fnmatch with no flags).
`+' or nothing means to process normally. `!' means to ignore;
`@' means to use only in conjunction with dedicated-interface-addr.
If no list is specified, or the list ends with a `!' entry, a
default list is used/appended:
"!tun*","!tap*","!sl*","!userv*","!lo","@hippo*","*".
Patterns which do not start with `*' or an alphanumeric need to be
preceded by `!' or `+' or `@'.
monitor-command (string list): Program to use to monitor appearance
and disappearance of addresses on local network interfaces. Should
produce lines of the form `+|- 4|6 ' where is
an address literal. Each - line should relate to a previously
printed + line. On startup, should produce a + line for each
currently existing address. secnet does filtering so there is no
need to strip out tun interfaces, multicast addresses, and so on.
The command is run as the user secnet is started as (not the one
which secnet may drop privilege to due to the configured `userid').
The default depends on the operating system.
permit-loopback (boolean): Normally, loopback IPv6 and IPv4
addresses on local interfaces are disregarded, because such
interfaces are not interesting for communicating with distant
hosts. Setting this option will ignore that check, which can be
useful for testing. Setting this option also removes "!lo*" from
the default interface pattern list.
When using this comm, packets are sent out of every active interface
on the host (where possible). It is important that interfaces created
by secnet itself are not included! secnet's default filter list tries
to do this.
This comm only makes sense for sites which are mobile. That is, the
site closures used with this comm should all have the `local-mobile'
parameter set to `true'. When the local site site is not marked
mobile the address selection machinery might fixate on an unsuitable
address.
polypath takes site-specific informtion as passed to the `comm-info'
site closure parameter. The entries understood in the dictionary
are:
dedicated-interface-addr (string): IPv4 or IPv6 address
literal. Interfaces specified with `@' in `interfaces' will be
used for the corresponding site iff the interface local address
is this address.
For an interface to work with polypath, it must either have a suitable
default route, or be a point-to-point interface. In the general case
this might mean that the host would have to have multiple default
routes. However in practice the most useful configuration is two
interfaces being (1) wifi (2) mobile internet.
I have had success on Linux by using network-manager for wifi and
invoking ppp directly for mobile internet. ppp sets up a
point-to-point link, and does not add a default route if there already
is one. network-manager always sets up a default route. The result
is that the wifi always has a default route (so is useable); ppp
(being a point-to-point link) does not need one.
The use of polypath requires that secnet be started with root
privilege, to make the setsockopt(,,SO_BINDTODEVICE,) calls. If the
configuration specifies that secnet should drop privilege (see
`userid' above), secnet will keep a special process around for this
purpose; that process will handle local network interface changes but
does not deal with any packets, key exchange, etc.
polypath support is only available when secnet is built against an
IPv6-capable version of adns (because it wants features in the newer
adns).
** log
Defines:
logfile (closure => log closure)
syslog (closure => log closure)
logfile: dict argument
filename (string): where to log to; default is stderr
prefix (string): added to messages [""]
class (string list): what type of messages to log
{ "debug-config", M_DEBUG_CONFIG },
{ "debug-phase", M_DEBUG_PHASE },
{ "debug", M_DEBUG },
{ "all-debug", M_DEBUG|M_DEBUG_PHASE|M_DEBUG_CONFIG },
{ "info", M_INFO },
{ "notice", M_NOTICE },
{ "warning", M_WARNING },
{ "error", M_ERROR },
{ "security", M_SECURITY },
{ "fatal", M_FATAL },
{ "default", M_WARNING|M_ERROR|M_SECURITY|M_FATAL },
{ "verbose", M_INFO|M_NOTICE|M_WARNING|M_ERROR|M_SECURITY|M_FATAL },
{ "quiet", M_FATAL }
logfile will close and reopen its file upon receipt of SIGHUP.
syslog: dict argument
ident (string): include this string in every log message
facility (string): facility to log as
{ "authpriv", LOG_AUTHPRIV },
{ "cron", LOG_CRON },
{ "daemon", LOG_DAEMON },
{ "kern", LOG_KERN },
{ "local0", LOG_LOCAL0 },
{ "local1", LOG_LOCAL1 },
{ "local2", LOG_LOCAL2 },
{ "local3", LOG_LOCAL3 },
{ "local4", LOG_LOCAL4 },
{ "local5", LOG_LOCAL5 },
{ "local6", LOG_LOCAL6 },
{ "local7", LOG_LOCAL7 },
{ "lpr", LOG_LPR },
{ "mail", LOG_MAIL },
{ "news", LOG_NEWS },
{ "syslog", LOG_SYSLOG },
{ "user", LOG_USER },
{ "uucp", LOG_UUCP }
** util
Defines:
sysbuffer (closure => buffer closure)
sysbuffer: integer[,dict]
arg1: buffer length
arg2: options:
lockdown (boolean): if True, mlock() the buffer
** site
Defines:
site (closure => site closure)
site: dict argument
local-name (string): this site's name for itself
name (string): the name of the site's peer
link (netlink closure)
comm (one or more comm closures): if there is more than one, the
first one will be used for any key setups initiated by us using the
configured address. Others are only used if our peer talks to
them.
resolver (resolver closure)
random (randomsrc closure)
key-cache (privcache closure)
local-key (sigprivkey closure): Deprecated; use key-cache instead.
address (string list): optional, DNS name(s) used to find our peer;
address literals are supported too if enclosed in `[' `]'.
port (integer): mandatory if 'address' is specified: the port used
to contact our peer
peer-keys (string): path (prefix) for peer public key set file(s);
see README.make-secnet-sites re `pub' etc. and NOTES.peer-keys.
key (sigpubkey closure): our peer's public key (obsolete)
transform (transform closure): how to mangle packets sent between sites
dh (dh closure)
key-lifetime (integer): max lifetime of a session key, in ms
[one hour; mobile: 2 days]
setup-retries (integer): max number of times to transmit a key negotiation
packet [5; mobile: 30]
setup-timeout (integer): time between retransmissions of key negotiation
packets, in ms [2000; mobile: 1000]
wait-time (integer): after failed key setup, wait roughly this long
(in ms) before allowing another attempt [20000; mobile: 10000]
Actual wait time is randomly chosen between ~0.5x and ~1.5x this.
renegotiate-time (integer): if we see traffic on the link after this time
then renegotiate another session key immediately (in ms)
[half key-lifetime, or key-lifetime minus 5 mins (mobile: 12 hours),
whichever is longer].
keepalive (bool): if True then attempt always to keep a valid session key.
[false]
log-events (string list): types of events to log for this site
unexpected: unexpected key setup packets (may be late retransmissions)
setup-init: start of attempt to setup a session key
setup-timeout: failure of attempt to setup a session key, through timeout
activate-key: activation of a new session key
timeout-key: deletion of current session key through age
security: anything potentially suspicious
state-change: steps in the key setup protocol
packet-drop: whenever we throw away an outgoing packet
dump-packets: every key setup packet we see
errors: failure of name resolution, internal errors
peer-addrs: changes to sets of peer addresses (interesting for mobile peers)
all: everything (too much!)
mobile (bool): if True then peer is "mobile" ie we assume it may
change its apparent IP address and port number without either it
or us being aware of the change; so, we remember the last several
port/addr pairs we've seen and send packets to all of them
(subject to a timeout). We maintain one set of addresses for key
setup exchanges, and another for data traffic. Two communicating
peers must not each regard the other as mobile, or all the traffic
in each direction will be triplicated (strictly, transmitted
mobile-peers-max times) and anyway two peers whose public contact
address may suddenly change couldn't communicate reliably because
their contact addresses might both change at once. [false]
mobile-peers-max (integer): Maximum number of peer port/addr pairs we
remember and send to. Must be at least 1 and no more than 5.
[4 if any address is configured, otherwise 3]
static-peers-max (integer): Maximum number of peer port/addr pairs
we can try for a static site. Must be at least 1 and no more
than 5. [4 or 3, as above]
mobile-peer-expiry (integer): For "mobile" peers only, the length
of time (in seconds) for which we will keep sending to multiple
address/ports from which we have not seen incoming traffic. [120]
local-mobile (bool): if True then other peers have been told we are
"mobile". This should be True iff the peers' site configurations
for us have "mobile True" (and if we find a site configuration for
ourselves in the config, we insist on this). The effect is to
check that there are no links both ends of which are allegedly
mobile (which is not supported, so those links are ignored) and
to change some of the tuning parameter defaults. [false]
mtu-target (integer): Desired value of the inter-site MTU for this
peering. This value will be advertised to the peer (which ought
to affect incoming packets), and if the peer advertises an MTU its
value will be combined with this setting to compute the inter-site
MTU. (secnet will still accept packets which exceed the
(negotiated or assumed) inter-site MTU.) Setting a lower
inter-site MTU can be used to try to restrict the sizes of the
packets sent over the underlying public network (e.g. to work
around network braindamage). It is not normally useful to set a
larger value for mtu-target than the VPN's general MTU (which
should be reflected in the local private interface MTU, ie the mtu
parameter to netlink). If this parameter is not set, or is set
to 0, the default is to use the local private link mtu.
comm-info (dict): Information for the comm, used when this site
wants to transmit. If the comm does not support this, it is
ignored.
Links involving mobile peers have some different tuning parameter
default values, which are generally more aggressive about retrying key
setup but more relaxed about using old keys. These are noted with
"mobile:", above, and apply whether the mobile peer is local or
remote.
** transform-eax
Defines:
eax-serpent (closure => transform closure)
** transform-cbcmac
Defines:
serpent256-cbc (closure => transform closure)
** netlink
Defines:
null-netlink (closure => closure or netlink closure)
null-netlink: dict argument
name (string): name for netlink device, used in log messages
networks (string list): networks on the host side of the netlink device
remote-networks (string list): networks that may be claimed
by the remote site using this netlink device
local-address (string): IP address of host's tunnel interface
secnet-address (string): IP address of this netlink device
ptp-address (string): IP address of the other end of a point-to-point link
mtu (integer): MTU of host's tunnel interface
Only one of secnet-address or ptp-address may be specified. If
point-to-point mode is in use then the "routes" option must also be
specified, and netlink returns a netlink closure that should be used
directly with the "link" option to the site closure. If
point-to-point mode is not in use then netlink returns a closure that
may be invoked using a dict argument with the following keys to yield
a netlink closure:
routes (string list): networks reachable down the tunnel attached to
this instance of netlink
options (string list):
allow-route: allow packets coming from this tunnel to be routed to
other tunnels as well as the host (used for mobile devices like laptops)
soft: remove these routes from the host's routing table when
the tunnel link quality is zero
mtu (integer): MTU of host's tunnel interface
Netlink will dump its current routing table to the system/log on
receipt of SIGUSR1.
** slip
Defines:
userv-ipif (closure => netlink closure)
userv-ipif: dict argument
userv-path (string): optional, where to find userv ["userv"]
service-user (string): optional, username for userv-ipif service ["root"]
service-name (string): optional, name of userv-ipif service ["ipif"]
buffer (buffer closure): buffer for assembly of host->secnet packets
plus generic netlink options, as for 'null-netlink'
** tun
Defines:
tun (closure => netlink closure) [only on linux-2.4]
tun-old (closure => netlink closure)
tun: dict argument
flavour (string): optional, type of TUN interface to use
("guess","linux","bsd","streams")
device (string): optional, path of TUN/TAP device file ["/dev/net/tun"]
interface (string): optional, name of tunnel network interface
ifconfig-path (string): optional, path to ifconfig command
route-path (string): optional, path to route command
ifconfig-type (string): optional, how to perform ifconfig
route-type (string): optional, how to add and remove routes
types are: "guess", "ioctl", "bsd", "linux", "solaris-2.5"
buffer (buffer closure): buffer for host->secnet packets
plus generic netlink options, as for 'null-netlink'
I recommend you don't specify the 'interface' option unless you're
doing something that requires the interface name to be constant.
** privcache
Cache of dynamically loaded private keys.
Defines:
priv-cache (closure => privcache closure)
priv-cache: dict argument
privkeys (string): path prefix for private keys. Each key is
looked for at this path prefix followed by the 10-character
hex key id.
privcache-size (integer): optional, maximum number of private
keys to retain at once. [5]
privkey-max (integer): optional, maximum size of private key
file in bytes. [4095]
** pubkeys
Defines:
make-public (closure => sigpubkey closure)
make-public: (
arg1: sigscheme name
arg2: base91s encoded public key data, according to algorithm
** rsa
Defines:
sigscheme algorithm 00 "rsa1"
rsa-private (closure => sigprivkey closure)
rsa-public (closure => sigpubkey closure)
rsa1 sigscheme algorithm:
private key: SSH private key file, version 1, no password
public key: SSH public key file, version 1
(length, restrictions, email, etc., ignored)
rsa-private: string[,bool]
arg1: filename of SSH private key file (version 1, no password)
arg2: whether to check that the key is usable [default True]
rsa-public: string,string
arg1: encryption key (decimal)
arg2: modulus (decimal)
The sigscheme is hardcoded to use sha1. Both rsa-private and
rsa-public look for the following config key in their context:
hash (hash closure): hash function [sha1]
** dh
Defines:
diffie-hellman (closure => dh closure)
diffie-hellman: string,string[,bool]
arg1: modulus (hex)
arg2: generator (hex)
arg3: whether to check that the modulus is prime [default True]
** md5
Defines:
md5 (hash closure)
** sha1
Defines:
sha1 (hash closure)
** conffile
Defines:
makelist (dictionary => list of definitions)
readfile (string => string)
map (closure,list => list)
makelist: dictionary
returns a list consisting of the definitions in the dictionary. The keys
are discarded.
readfile: string
reads the named file and returns its contents as a string
map:
applies the closure specified as arg1 to each of the elements in the list.
Returns a list made up of the outputs of the closure.
* Legal
This file is part of secnet.
See LICENCE and CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/README.mac 0000664 0000000 0000000 00000006006 15063477206 010363 0 ustar How to install secnet on a Fink-equipped OS X system:
- Install GMP:
fink install gmp
- Download and install ADNS:
./configure --disable-dynamic
make
sudo make install
- Build secnet:
./configure
make
sudo make install
- Install tuntap for OSX from http://tuntaposx.sourceforge.net/
- Create /etc/secnet/{key,secnet.conf,sites.conf} as usual
- If you don't want secnet 'always on', edit
uk.org.greenend.secnet.plist and remove *both* these two lines:
RunAtLoad
- Create the 'secnet' user and install the job configuration:
./setup.mac.
To start secnet:
sudo launchctl start uk.org.greenend.secnet
To stop secnet:
sudo launchctl stop uk.org.greenend.secnet
To uninstall:
sudo launchctl unload /Library/LaunchDaemons/uk.org.greenend.secnet.plist
sudo rm -f /Library/LaunchDaemons/uk.org.greenend.secnet.plist
If you need to enable IP forwarding:
sudo sysctl -w net.inet.ip.forwarding=1
(Note that on a Mac, you need to enable IP forwarding if you want to
route to addresses on one interface via another; i.e. if you expect to
be able to reach an address on en0 with a packet delivered through
tun0, IP forwarding must be turned on.)
How to import secnet into XCode 3.2:
- Set up build directories as follows:
$ mkdir build/Debug build/Release
$ cd build/Debug
$ ~/src/secnet/configure CFLAGS="-g -O0"
$ cd ../Release
$ ~/src/secnet/configure
$ cd ../..
(Replace ~/src/secnet with the *absolute* path to your secnet tree -
XCode cannot map the relative paths in errors to the source files
otherwise.)
- Start XCode
- Menubar -> File -> New Project
- Choose the Mac OS X -> Other -> External Build System template
- Choose the *parent* of the secnet directory and call the project
secnet
- OK the overwrite (it won't overwrite anything that matters)
- This creates 'build' and 'secnet.xcodeproj' directories in your
secnet tree.
- Right-click Groups & Files -> secnet -> Add -> Existing files and
select all the *.c, *.h, *.y and *.fl files.
- Omit the following files:
- *.yy.[ch] \
- *.tab.[ch] | generated during build
- version.c |
- config.h /
- snprintf.[ch] - unnecessary on OSX
- Sort by 'kind' may make this easier
- Leave 'Copy items...' unchecked
- Add To Targets should have 'secnet' checked
- For conffile.fl, right click Get Info -> General, and set File
Type to sourcecode.lex.
- Under Groups & Files -> secnet, select all source files and right
click Get Info -> General, and set:
- Tab Width to 8
- Indent Width to 4
- Check Editor uses tabs
- Double click click Groups & Files -> Targets secnet
- Add '-C $TARGET_BUILD_DIR' to the start of the arguments.
You should now be able to build both debug and release configurations
using ⌘B.
Richard Kettlewell 2011-07-23
--
This file is part of secnet.
See LICENCE and this file CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/README.make-secnet-sites 0000664 0000000 0000000 00000025035 15063477206 013147 0 ustar USAGE
make-secnet-sites [-P PREFIX] [--conf] [IN [OUTCONF]]
make-secnet-sites --filter [IN [OUT]]
make-secnet-sites -u|--userv HEADER GRPDIR SITESFILE GROUP
The `-P' option sets the PREFIX string, mentioned below in
`OUTPUT STRUCTURE'; the default is empty.
In --conf mode, `make-secnet-sites' reads a single input
file from IN (defaulting to standard input), and writes a Secnet
configuration fragment to OUTCONF (defaulting to standard output).
In --filter mode, `make-secnet-sites' reads a single input
file from IN (defaulting to standard input), and writes a
version of that sites file to OUT (defaulting to standard
output). The output is filtered according to --output-version.
In --userv mode, `make-secnet-sites' expects to have been invoked
via GNU Userv. It verifies that GROUP is listed in the
`USERV_GROUP' environment variable. It then processes the
HEADER input, which should say `end-defintions' somewhere, to
enable restrictions, and then user input on standard input. If
the combination of the two is acceptable, it writes a copy of
the user input to the file `GRPDIR/RGROUP' (the `R' is literal)
preceded by a comment logging the time and the value of the
`USERV_USER' environment variable, and writes a file named
SITESFILE consisting of the concatenation of:
* a header comment logging the time and the value of the
`USERV_USER' environment variable, and a reminder that this
is `make-secnet-sites' input;
* the HEADER, with any `include' lines replaced by the files
they include; and
* each of the `GRPDIR/R*' files, in some arbitrary order.
This SITESFILE can later be processed in the former mode to
produce Secnet configuration.
OPTIONS
--output-version NUMBER
Write backward-compatible sites file output,
targeting a particular sites format. Values of
NUMBER that are understood are:
1 The original format, pre signing key
negotiation.
2 Signing key algorithm agility and negotiation.
If NUMBER is higher than make-secnet-sites supports,
it writes out what it can.
--pubkeys-install
Specifies that public keys are to be installed in the
live pubkeys area (and not hardcoded in secnet conf
files). With this option, generated site configs
refer to keys in PUBKEYS; also, the generated secnet
configuration enables live peer public update.
--pubkeys-single
Specifies that one public key per site is to be
written directly into the sites.conf output. If
--output-version=1, this is the rsa1 key 0000000000.
Otherwise it is an error if there are multiple public
keys defined for any site, in the input.
--pubkeys-single is the default.
--pubkeys-elide
In the sites.conf output, just write the peer-keys
entry referring to keys in PUBKEYS. But do not write
public keys anywhere.
--pubkeys-dir PUBKEYS
Specifies the live pubkeys area pathname.
The default is /var/lib/secnet/pubkeys.
Key files are named
PUBKEYS/peer.[~...]
mangled-peer-name is chosen by make-secnet-sites
/ => ,
--debug | -D
Increase amount of debugging output.
INPUT SYNTAX
The input files have a simple line-based syntax. Blank lines,
and lines beginning with a `#' character, are ignored. Other
lines consist of a keyword followed by arguments, and separated
by horizontal whitespace. There is no quoting, and it is not
possible to include horizontal whitespace in an argument.
An input file describes a number of virtual private networks
(`VPNs'). Each VPN consists of a number of locations, and each
location consists of a number of sites, thus forming (together
with the root) a fixed four-level hierarchy. The root, VPNs,
locations, and sites can each have a number of properties
attached to them: each level in the hierarchy has a different
set of permissable properties.
Most keywords define properties on a `current' item in the
hierarchy. Some change which item is current, possibly creating
a new item. A few are special.
First, the navigation keywords.
vpn NAME
Switch to the VPN called NAME, which is a direct child
of the root, creating it if necessary. Subsequent
properties, up until the next navigation keyword, are
attached directly to the VPN.
A VPN item becomes a dictionary named `NAME' within the
`PREFIXvpn-data' dictionary in the generated output.
location NAME [GROUP]
Switch to the location called NAME, which is a direct
child of the most recently mentioned VPN, creating it if
necessary. The GROUP name may be omitted (and is anyway
ignored) if the location already exists. It is an error
if there is no current VPN. Subsequent properties, up
until the next navigation keyword, are attached directly
to the location.
A location item becomes a dictionary named `NAME' within
its parent VPN's dictionary in the generated output.
site NAME
Switch to the site called NAME, which is a direct
child of the most recently mentioned location, creating
it if necessary. It is an error if there is no current
location. Subsequent properties, up until the next
navigation keyword, are attached directly to the site.
A location item becomes a dictionary named `NAME' within
its parent location's dictionary in the generated
output.
Now, the special keywords.
include FILE
Read lines from FILE, as if they'd appeared at this
point in the input. If the FILE name is relative, it is
interpreted relative to the directory containing the
most recently opened file. (This seems to be a bug.)
The `include' keyword is only permitted before the
`end-defintions' marker in a HEADER file processed using
the `-u' option.
end-definitions
After this keyword, the following restrictions apply.
* The `include' keyword can no longer be used.
* It is not permitted to define new VPNs and
locations.
* It is not permitted to append new items to root,
VPN, and location properties which are already
defined. (Assigning new properties is permitted.)
* It is not permitted to define new VPN-level
properties.
Finally, the properties.
Usually, if a property has already been defined on an item, then
it is an error to try to redefine it. But some properties are
list-like: the values are accumulated into a single list.
Mostly, properties are written to corresponding assignments in
the generated Secnet configuration file, . The entries below
describe how properties are translated into assignments.
contact EMAIL
Becomes a `Contact address' comment in the output.
Acceptable at all levels; required separately at VPN and
location levels.
dh P G
Assigns a Diffie--Hellman closure to the `dh' key,
constructed as `diffie-hellman(P, G)'. Acceptable at all
levels; required at site level.
hash HASH-NAME
Assigns the HASH-NAME to the `hash' key. The HASH-NAME
must be one of `md5' or `sha1', and the corresponding
hash closure is used. Acceptable at all levels;
required at site level.
key-lifetime INT
setup-timeout INT
setup-retries INT
wait-time INT
renegotiate-time INT
Assign integers to the like-named key. Acceptable at
all levels.
restrict-nets NETWORK NETWORK ...
This item and its descendents may only define `networks'
and `peer' properties with addresses within the listed
NETWORKs, each of which has the form IPADDR/MASK, where
the IPADDR is an IPv4 address in dotted-quad form, and
the MASK is either a netmask in dotted-quad form or a
prefix length. Becomes a comment n the output.
Acceptable at all levels.
networks NETWORK NETWORK ...
Assigns a list of NETWORKs to the `routes' key in a
netlink application (see below). See `restrict-nets'
for the syntax of a NETWORK. Acceptable only at site
level; required at site level.
address HOSTNAME PORT
Assigns HOSTNAME to the `address' key and PORT (an
integer) to the `port' key. Acceptable only at site
level. May be omitted for mobile sites.
peer IPADDR
Assigns IPADDR to the `ptp-address' key in a netlink
application (see below). IPADDR must be an IPv4 address
in dotted-quad form. Acceptable only at site level;
required at site level.
pubkey HUNOZ E N
Assigns a public-key closure to the `key' key,
constructed as `rsa-public(E, N)'. The argument HUNOZ
must be an integer, but is otherwise ignored; it's
conventionally the length of N in bits.
Acceptable only at site level. See `pub'.
mobile BOOL
Assigns BOOL to the `mobile' key. Acceptable only at
site level, but optional.
Properties which can also appear in public key files.
(named by `peer-keys' key to secnet sites closure.)
These are acceptable to make-secnet-sites only at
site level. See also `Site long-term keys' in NOTES.
pub ALG DATAB91S
Defines a public key. ALG is an algorithm name and
DATA91S is the public key data, encoded according to
secnet-base91 (see below).
Gives make-public("ALG","DATAB91S") in sites.conf;
at least one `pub' or `pubkey' must be specified.
serial SETIDHEX
Specifies the key set id (8 hex digits representing
4 bytes: each pair is the value of the next byte).
May appear at most once. If not present, 00000000.
pkg GROUPIDHEX
pkgf GROUPIDHEX
Specifies the key group id for subsequent keys.
pkgf indicates a fallback group.
May be repeated (with different id values).
If not specified, 00000000.
OUTPUT STRUCTURE
The program produces a Secnet configuration fragment with the
structure described below, suitable for inclusion using the
`include' keyword.
PREFIXvpn-data {
VPN {
# Contact email address: EMAIL
[ # restrict-nets: NETWORKS ]
[ VPN-PROPERTIES ]
LOCATION {
# Contact email address: EMAIL
[ # restrict-nets: NETWORKS ]
[ LOCATION-PROPERTIES ]
SITE {
[ # Contact email address: EMAIL ]
[ # restrict-nets: NETWORKS ]
name "VPN/LOCATION/NAME";
SITE-PROPERTIES
link netlink {
routes NETWORK ...;
ptp-address IPADDR;
};
};
[ MORE SITES ... ]
};
[ MORE LOCATIONS ... ]
};
[ MORE VPNS ... ]
};
PREFIXvpn {
VPN {
LOCATION PREFIXvpn-data/VPN/LOCATION/SITE, ...;
[ MORE LOCATIONS ]
all-sites LOCATION, ...;
};
};
PREFIXall-sites PREFIXvpn/VPN/all-sites, ...;
Note in particular the implicit dependency on a pure closure
named `netlink' used to set the `link' key in each site
definition. Usually, this will be constructed by a partial
application of the built-in `userv-ipif' or `tun' closures.
--
This file is part of secnet.
See LICENCE and this file CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/Suffix.sd.mk 0000664 0000000 0000000 00000000423 15063477206 011143 0 ustar # This file is part of secnet.
# See LICENCE and this file CREDITS for full list of copyright holders.
# SPDX-License-Identifier: GPL-3.0-or-later
# There is NO WARRANTY.
&TARGETS_check +=
&TARGETS_fullcheck +=
&:include subdirmk/cdeps.sd.mk
&:include subdirmk/clean.sd.mk
work/TODO 0000664 0000000 0000000 00000002614 15063477206 007435 0 ustar dh.c: change format to binary from decimal string (without introducing
endianness problems)
netlink.c: test the 'allow_route' option properly.
Add fragmentation code. Check that we comply with RFC1812.
random.c: test properly
resolver.c: ought to return a list of addresses for each address; the
site code ought to remember them and try contacting them in turn.
rsa.c: check padding type, change format to binary from decimal string
(without introducing endianness problems)
site.c: Abandon key exchanges when a bad packet is received. Modify
protocol to include version fields, as described in the NOTES
file. Implement keepalive mode. Make policy about when to initiate key
exchanges more configurable (how many NAKs / bad reverse-transforms
does it take to prompt a key exchange?)
slip.c: restart userv-ipif to cope with soft routes? Restart it if it
fails in use?
transform.c: separate the transforms into multiple parts, which can
then be combined in the configuration file. Will allow the user to
plug in different block ciphers, invent an authenticity-only mode,
etc. (similar to udptunnel)
udp.c: option for path-MTU discovery (once fragmentation support is
implemented in netlink)
global:
consider using liboop for the event loop
--
This file is part of secnet.
See LICENCE and this file CREDITS for full list of copyright holders.
SPDX-License-Identifier: GPL-3.0-or-later
There is NO WARRANTY.
work/ac_prog_cc_no_writeable_strings.m4 0000664 0000000 0000000 00000011333 15063477206 015567 0 ustar dnl @synopsis AC_PROG_CC_NO_WRITEABLE_STRINGS(substvar [,hard])
dnl
dnl Try to find a compiler option that warns when a stringliteral is
dnl used in a place that could potentially modify the address. This
dnl should warn on giving an stringliteral to a function that asks of
dnl a non-const-modified char-pointer.
dnl
dnl The sanity check is done by looking at string.h which has a set
dnl of strcpy definitions that should be defined with const-modifiers
dnl to not emit a warning in all so many places.
dnl
dnl Currently this macro knows about GCC.
dnl hopefully will evolve to use: Solaris C compiler,
dnl Digital Unix C compiler, C for AIX Compiler, HP-UX C compiler,
dnl and IRIX C compiler.
dnl
dnl @version $Id: ac_prog_cc_no_writeable_strings.m4,v 1.1 2002/02/20 16:18:18 steve Exp $
dnl @author Guido Draheim
dnl This is an older version of ax_cflags_no_writable_strings.m4
dnl which is nowadays to be found in the Autoconf Archive. Nowadays,
dnl this file has this permission notice there::
dnl
dnl Copyright (c) 2008 Guido U. Draheim
dnl
dnl This program is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by the
dnl Free Software Foundation; either version 3 of the License, or (at your
dnl option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
dnl Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License along
dnl with this program. If not, see .
dnl
dnl As a special exception, the respective Autoconf Macro's copyright owner
dnl gives unlimited permission to copy, distribute and modify the configure
dnl scripts that are the output of Autoconf when processing the Macro. You
dnl need not follow the terms of the GNU General Public License when using
dnl or distributing such scripts, even though portions of the text of the
dnl Macro appear in them. The GNU General Public License (GPL) does govern
dnl all other use of the material that constitutes the Autoconf Macro.
dnl
dnl This special exception to the GPL applies to versions of the Autoconf
dnl Macro released by the Autoconf Archive. When you make and distribute a
dnl modified version of the Autoconf Macro, you may extend this special
dnl exception to the GPL to apply to your modified version as well.
AC_DEFUN([AC_PROG_CC_NO_WRITEABLE_STRINGS], [
pushdef([CV],ac_cv_prog_cc_no_writeable_strings)dnl
hard=$2
if test -z "$hard"; then
msg="C to warn about writing to stringliterals"
else
msg="C to prohibit any write to stringliterals"
fi
AC_CACHE_CHECK($msg, CV, [
cat > conftest.c <
int main (void)
{
char test[[16]];
if (strcpy (test, "test")) return 0;
return 1;
}
EOF
dnl GCC
if test "$GCC" = "yes";
then
if test -z "$hard"; then
CV="-Wwrite-strings"
else
CV="-fno-writable-strings -Wwrite-strings"
fi
if test -n "`${CC-cc} -c $CV conftest.c 2>&1`" ; then
CV="suppressed: string.h"
fi
dnl Solaris C compiler
elif $CC -flags 2>&1 | grep "Xc.*strict ANSI C" > /dev/null 2>&1 &&
$CC -c -xstrconst conftest.c > /dev/null 2>&1 &&
test -f conftest.o
then
# strings go into readonly segment
CV="-xstrconst"
rm conftest.o
if test -n "`${CC-cc} -c $CV conftest.c 2>&1`" ; then
CV="suppressed: string.h"
fi
dnl HP-UX C compiler
elif $CC > /dev/null 2>&1 &&
$CC -c +ESlit conftest.c > /dev/null 2>&1 &&
test -f conftest.o
then
# strings go into readonly segment
CV="+ESlit"
rm conftest.o
if test -n "`${CC-cc} -c $CV conftest.c 2>&1`" ; then
CV="suppressed: string.h"
fi
dnl Digital Unix C compiler
elif ! $CC > /dev/null 2>&1 &&
$CC -c -readonly_strings conftest.c > /dev/null 2>&1 &&
test -f conftest.o
then
# strings go into readonly segment
CV="-readonly_strings"
rm conftest.o
if test -n "`${CC-cc} -c $CV conftest.c 2>&1`" ; then
CV="suppressed: string.h"
fi
dnl C for AIX Compiler
dnl IRIX C compiler
# -use_readonly_const is the default for IRIX C,
# puts them into .rodata, but they are copied later.
# need to be "-G0 -rdatashared" for strictmode but
# I am not sure what effect that has really.
fi
rm -f conftest.*
])
if test -z "[$]$1" ; then
if test -n "$CV" ; then
case "$CV" in
suppressed*) $1="" ;; # known but suppressed
*) $1="$CV" ;;
esac
fi
fi
AC_SUBST($1)
popdef([CV])dnl
])
work/aclocal.m4 0000664 0000000 0000000 00000002221 15063477206 010577 0 ustar # aclocal.m4 - package-specific macros for autoconf
dnl This file is part of secnet.
dnl See README for full list of copyright holders.
dnl
dnl secnet is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl secnet is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl version 3 along with secnet; if not, see
dnl https://www.gnu.org/licenses/gpl.html.
dnl This next macro came from adns.git,
dnl (d8fa191ed7774818862febd6ade774cb7e149ab9).
define(ADNS_C_GETFUNC,[
AC_CHECK_FUNC([$1],,[
AC_CHECK_LIB([$2],[$1],[$3],[
AC_MSG_ERROR([cannot find library function $1])
])
])
])
define(SECNET_C_GETFUNC,[
ADNS_C_GETFUNC($1,$2,[
LIBS="-l$2 $LIBS";
AC_MSG_WARN([$1 is in lib$2, urgh. Must use -l$2.])
])
])
work/aes.c 0000664 0000000 0000000 00000172267 15063477206 007675 0 ustar /*
* aes.c - implementation of Rijndael
*/
/*
* This file is Free Software. It has been modified to as part of its
* incorporation into secnet.
*
* Copyright 2000 Vincent Rijmen, Antoon Bosselaers, Paulo Barreto
* Copyright 2004 Fabrice Bellard
* Copyright 2013 Ian Jackson
*
* You may redistribute this file and/or modify it under the terms of
* the permissive licence shown below.
*
* You may redistribute secnet as a whole and/or modify it under the
* terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see
* https://www.gnu.org/licenses/gpl.html.
*/
/*
* Integrated in QEMU by Fabrice Bellard from the OpenSSL project.
*
* Copied to the secnet tree by Ian Jackson from the upstream qemu git
* tree revision 55616505876d6683130076b810a27c7889321560
* and modified only to remove the include of qemu-common.h.
*
* (The changes by various qemu contributors between
* e4d4fe3c34cdd6e26f9b9975efec7d1e81ad00b6, where this file appeared
* in qemu in a commit by Fabrice Bellard, and 55616505 are too
* trivial to attract copyright, which is just as well because some of
* the commits are lacking a S-o-b.)
*/
/*
* rijndael-alg-fst.c
*
* @version 3.0 (December 2000)
*
* Optimised ANSI C code for the Rijndael cipher (now AES)
*
* @author Vincent Rijmen
* @author Antoon Bosselaers
* @author Paulo Barreto
*
* This code is hereby placed in the public domain.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
* 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 AUTHORS OR 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.
*/
#include "aes.h"
#ifndef NDEBUG
#define NDEBUG
#endif
typedef uint32_t u32;
typedef uint16_t u16;
typedef uint8_t u8;
/* This controls loop-unrolling in aes_core.c */
#undef FULL_UNROLL
# define GETU32(pt) (((u32)(pt)[0] << 24) ^ ((u32)(pt)[1] << 16) ^ ((u32)(pt)[2] << 8) ^ ((u32)(pt)[3]))
# define PUTU32(ct, st) { (ct)[0] = (u8)((st) >> 24); (ct)[1] = (u8)((st) >> 16); (ct)[2] = (u8)((st) >> 8); (ct)[3] = (u8)(st); }
/*
Te0[x] = S [x].[02, 01, 01, 03];
Te1[x] = S [x].[03, 02, 01, 01];
Te2[x] = S [x].[01, 03, 02, 01];
Te3[x] = S [x].[01, 01, 03, 02];
Te4[x] = S [x].[01, 01, 01, 01];
Td0[x] = Si[x].[0e, 09, 0d, 0b];
Td1[x] = Si[x].[0b, 0e, 09, 0d];
Td2[x] = Si[x].[0d, 0b, 0e, 09];
Td3[x] = Si[x].[09, 0d, 0b, 0e];
Td4[x] = Si[x].[01, 01, 01, 01];
*/
static const u32 Te0[256] = {
0xc66363a5U, 0xf87c7c84U, 0xee777799U, 0xf67b7b8dU,
0xfff2f20dU, 0xd66b6bbdU, 0xde6f6fb1U, 0x91c5c554U,
0x60303050U, 0x02010103U, 0xce6767a9U, 0x562b2b7dU,
0xe7fefe19U, 0xb5d7d762U, 0x4dababe6U, 0xec76769aU,
0x8fcaca45U, 0x1f82829dU, 0x89c9c940U, 0xfa7d7d87U,
0xeffafa15U, 0xb25959ebU, 0x8e4747c9U, 0xfbf0f00bU,
0x41adadecU, 0xb3d4d467U, 0x5fa2a2fdU, 0x45afafeaU,
0x239c9cbfU, 0x53a4a4f7U, 0xe4727296U, 0x9bc0c05bU,
0x75b7b7c2U, 0xe1fdfd1cU, 0x3d9393aeU, 0x4c26266aU,
0x6c36365aU, 0x7e3f3f41U, 0xf5f7f702U, 0x83cccc4fU,
0x6834345cU, 0x51a5a5f4U, 0xd1e5e534U, 0xf9f1f108U,
0xe2717193U, 0xabd8d873U, 0x62313153U, 0x2a15153fU,
0x0804040cU, 0x95c7c752U, 0x46232365U, 0x9dc3c35eU,
0x30181828U, 0x379696a1U, 0x0a05050fU, 0x2f9a9ab5U,
0x0e070709U, 0x24121236U, 0x1b80809bU, 0xdfe2e23dU,
0xcdebeb26U, 0x4e272769U, 0x7fb2b2cdU, 0xea75759fU,
0x1209091bU, 0x1d83839eU, 0x582c2c74U, 0x341a1a2eU,
0x361b1b2dU, 0xdc6e6eb2U, 0xb45a5aeeU, 0x5ba0a0fbU,
0xa45252f6U, 0x763b3b4dU, 0xb7d6d661U, 0x7db3b3ceU,
0x5229297bU, 0xdde3e33eU, 0x5e2f2f71U, 0x13848497U,
0xa65353f5U, 0xb9d1d168U, 0x00000000U, 0xc1eded2cU,
0x40202060U, 0xe3fcfc1fU, 0x79b1b1c8U, 0xb65b5bedU,
0xd46a6abeU, 0x8dcbcb46U, 0x67bebed9U, 0x7239394bU,
0x944a4adeU, 0x984c4cd4U, 0xb05858e8U, 0x85cfcf4aU,
0xbbd0d06bU, 0xc5efef2aU, 0x4faaaae5U, 0xedfbfb16U,
0x864343c5U, 0x9a4d4dd7U, 0x66333355U, 0x11858594U,
0x8a4545cfU, 0xe9f9f910U, 0x04020206U, 0xfe7f7f81U,
0xa05050f0U, 0x783c3c44U, 0x259f9fbaU, 0x4ba8a8e3U,
0xa25151f3U, 0x5da3a3feU, 0x804040c0U, 0x058f8f8aU,
0x3f9292adU, 0x219d9dbcU, 0x70383848U, 0xf1f5f504U,
0x63bcbcdfU, 0x77b6b6c1U, 0xafdada75U, 0x42212163U,
0x20101030U, 0xe5ffff1aU, 0xfdf3f30eU, 0xbfd2d26dU,
0x81cdcd4cU, 0x180c0c14U, 0x26131335U, 0xc3ecec2fU,
0xbe5f5fe1U, 0x359797a2U, 0x884444ccU, 0x2e171739U,
0x93c4c457U, 0x55a7a7f2U, 0xfc7e7e82U, 0x7a3d3d47U,
0xc86464acU, 0xba5d5de7U, 0x3219192bU, 0xe6737395U,
0xc06060a0U, 0x19818198U, 0x9e4f4fd1U, 0xa3dcdc7fU,
0x44222266U, 0x542a2a7eU, 0x3b9090abU, 0x0b888883U,
0x8c4646caU, 0xc7eeee29U, 0x6bb8b8d3U, 0x2814143cU,
0xa7dede79U, 0xbc5e5ee2U, 0x160b0b1dU, 0xaddbdb76U,
0xdbe0e03bU, 0x64323256U, 0x743a3a4eU, 0x140a0a1eU,
0x924949dbU, 0x0c06060aU, 0x4824246cU, 0xb85c5ce4U,
0x9fc2c25dU, 0xbdd3d36eU, 0x43acacefU, 0xc46262a6U,
0x399191a8U, 0x319595a4U, 0xd3e4e437U, 0xf279798bU,
0xd5e7e732U, 0x8bc8c843U, 0x6e373759U, 0xda6d6db7U,
0x018d8d8cU, 0xb1d5d564U, 0x9c4e4ed2U, 0x49a9a9e0U,
0xd86c6cb4U, 0xac5656faU, 0xf3f4f407U, 0xcfeaea25U,
0xca6565afU, 0xf47a7a8eU, 0x47aeaee9U, 0x10080818U,
0x6fbabad5U, 0xf0787888U, 0x4a25256fU, 0x5c2e2e72U,
0x381c1c24U, 0x57a6a6f1U, 0x73b4b4c7U, 0x97c6c651U,
0xcbe8e823U, 0xa1dddd7cU, 0xe874749cU, 0x3e1f1f21U,
0x964b4bddU, 0x61bdbddcU, 0x0d8b8b86U, 0x0f8a8a85U,
0xe0707090U, 0x7c3e3e42U, 0x71b5b5c4U, 0xcc6666aaU,
0x904848d8U, 0x06030305U, 0xf7f6f601U, 0x1c0e0e12U,
0xc26161a3U, 0x6a35355fU, 0xae5757f9U, 0x69b9b9d0U,
0x17868691U, 0x99c1c158U, 0x3a1d1d27U, 0x279e9eb9U,
0xd9e1e138U, 0xebf8f813U, 0x2b9898b3U, 0x22111133U,
0xd26969bbU, 0xa9d9d970U, 0x078e8e89U, 0x339494a7U,
0x2d9b9bb6U, 0x3c1e1e22U, 0x15878792U, 0xc9e9e920U,
0x87cece49U, 0xaa5555ffU, 0x50282878U, 0xa5dfdf7aU,
0x038c8c8fU, 0x59a1a1f8U, 0x09898980U, 0x1a0d0d17U,
0x65bfbfdaU, 0xd7e6e631U, 0x844242c6U, 0xd06868b8U,
0x824141c3U, 0x299999b0U, 0x5a2d2d77U, 0x1e0f0f11U,
0x7bb0b0cbU, 0xa85454fcU, 0x6dbbbbd6U, 0x2c16163aU,
};
static const u32 Te1[256] = {
0xa5c66363U, 0x84f87c7cU, 0x99ee7777U, 0x8df67b7bU,
0x0dfff2f2U, 0xbdd66b6bU, 0xb1de6f6fU, 0x5491c5c5U,
0x50603030U, 0x03020101U, 0xa9ce6767U, 0x7d562b2bU,
0x19e7fefeU, 0x62b5d7d7U, 0xe64dababU, 0x9aec7676U,
0x458fcacaU, 0x9d1f8282U, 0x4089c9c9U, 0x87fa7d7dU,
0x15effafaU, 0xebb25959U, 0xc98e4747U, 0x0bfbf0f0U,
0xec41adadU, 0x67b3d4d4U, 0xfd5fa2a2U, 0xea45afafU,
0xbf239c9cU, 0xf753a4a4U, 0x96e47272U, 0x5b9bc0c0U,
0xc275b7b7U, 0x1ce1fdfdU, 0xae3d9393U, 0x6a4c2626U,
0x5a6c3636U, 0x417e3f3fU, 0x02f5f7f7U, 0x4f83ccccU,
0x5c683434U, 0xf451a5a5U, 0x34d1e5e5U, 0x08f9f1f1U,
0x93e27171U, 0x73abd8d8U, 0x53623131U, 0x3f2a1515U,
0x0c080404U, 0x5295c7c7U, 0x65462323U, 0x5e9dc3c3U,
0x28301818U, 0xa1379696U, 0x0f0a0505U, 0xb52f9a9aU,
0x090e0707U, 0x36241212U, 0x9b1b8080U, 0x3ddfe2e2U,
0x26cdebebU, 0x694e2727U, 0xcd7fb2b2U, 0x9fea7575U,
0x1b120909U, 0x9e1d8383U, 0x74582c2cU, 0x2e341a1aU,
0x2d361b1bU, 0xb2dc6e6eU, 0xeeb45a5aU, 0xfb5ba0a0U,
0xf6a45252U, 0x4d763b3bU, 0x61b7d6d6U, 0xce7db3b3U,
0x7b522929U, 0x3edde3e3U, 0x715e2f2fU, 0x97138484U,
0xf5a65353U, 0x68b9d1d1U, 0x00000000U, 0x2cc1ededU,
0x60402020U, 0x1fe3fcfcU, 0xc879b1b1U, 0xedb65b5bU,
0xbed46a6aU, 0x468dcbcbU, 0xd967bebeU, 0x4b723939U,
0xde944a4aU, 0xd4984c4cU, 0xe8b05858U, 0x4a85cfcfU,
0x6bbbd0d0U, 0x2ac5efefU, 0xe54faaaaU, 0x16edfbfbU,
0xc5864343U, 0xd79a4d4dU, 0x55663333U, 0x94118585U,
0xcf8a4545U, 0x10e9f9f9U, 0x06040202U, 0x81fe7f7fU,
0xf0a05050U, 0x44783c3cU, 0xba259f9fU, 0xe34ba8a8U,
0xf3a25151U, 0xfe5da3a3U, 0xc0804040U, 0x8a058f8fU,
0xad3f9292U, 0xbc219d9dU, 0x48703838U, 0x04f1f5f5U,
0xdf63bcbcU, 0xc177b6b6U, 0x75afdadaU, 0x63422121U,
0x30201010U, 0x1ae5ffffU, 0x0efdf3f3U, 0x6dbfd2d2U,
0x4c81cdcdU, 0x14180c0cU, 0x35261313U, 0x2fc3ececU,
0xe1be5f5fU, 0xa2359797U, 0xcc884444U, 0x392e1717U,
0x5793c4c4U, 0xf255a7a7U, 0x82fc7e7eU, 0x477a3d3dU,
0xacc86464U, 0xe7ba5d5dU, 0x2b321919U, 0x95e67373U,
0xa0c06060U, 0x98198181U, 0xd19e4f4fU, 0x7fa3dcdcU,
0x66442222U, 0x7e542a2aU, 0xab3b9090U, 0x830b8888U,
0xca8c4646U, 0x29c7eeeeU, 0xd36bb8b8U, 0x3c281414U,
0x79a7dedeU, 0xe2bc5e5eU, 0x1d160b0bU, 0x76addbdbU,
0x3bdbe0e0U, 0x56643232U, 0x4e743a3aU, 0x1e140a0aU,
0xdb924949U, 0x0a0c0606U, 0x6c482424U, 0xe4b85c5cU,
0x5d9fc2c2U, 0x6ebdd3d3U, 0xef43acacU, 0xa6c46262U,
0xa8399191U, 0xa4319595U, 0x37d3e4e4U, 0x8bf27979U,
0x32d5e7e7U, 0x438bc8c8U, 0x596e3737U, 0xb7da6d6dU,
0x8c018d8dU, 0x64b1d5d5U, 0xd29c4e4eU, 0xe049a9a9U,
0xb4d86c6cU, 0xfaac5656U, 0x07f3f4f4U, 0x25cfeaeaU,
0xafca6565U, 0x8ef47a7aU, 0xe947aeaeU, 0x18100808U,
0xd56fbabaU, 0x88f07878U, 0x6f4a2525U, 0x725c2e2eU,
0x24381c1cU, 0xf157a6a6U, 0xc773b4b4U, 0x5197c6c6U,
0x23cbe8e8U, 0x7ca1ddddU, 0x9ce87474U, 0x213e1f1fU,
0xdd964b4bU, 0xdc61bdbdU, 0x860d8b8bU, 0x850f8a8aU,
0x90e07070U, 0x427c3e3eU, 0xc471b5b5U, 0xaacc6666U,
0xd8904848U, 0x05060303U, 0x01f7f6f6U, 0x121c0e0eU,
0xa3c26161U, 0x5f6a3535U, 0xf9ae5757U, 0xd069b9b9U,
0x91178686U, 0x5899c1c1U, 0x273a1d1dU, 0xb9279e9eU,
0x38d9e1e1U, 0x13ebf8f8U, 0xb32b9898U, 0x33221111U,
0xbbd26969U, 0x70a9d9d9U, 0x89078e8eU, 0xa7339494U,
0xb62d9b9bU, 0x223c1e1eU, 0x92158787U, 0x20c9e9e9U,
0x4987ceceU, 0xffaa5555U, 0x78502828U, 0x7aa5dfdfU,
0x8f038c8cU, 0xf859a1a1U, 0x80098989U, 0x171a0d0dU,
0xda65bfbfU, 0x31d7e6e6U, 0xc6844242U, 0xb8d06868U,
0xc3824141U, 0xb0299999U, 0x775a2d2dU, 0x111e0f0fU,
0xcb7bb0b0U, 0xfca85454U, 0xd66dbbbbU, 0x3a2c1616U,
};
static const u32 Te2[256] = {
0x63a5c663U, 0x7c84f87cU, 0x7799ee77U, 0x7b8df67bU,
0xf20dfff2U, 0x6bbdd66bU, 0x6fb1de6fU, 0xc55491c5U,
0x30506030U, 0x01030201U, 0x67a9ce67U, 0x2b7d562bU,
0xfe19e7feU, 0xd762b5d7U, 0xabe64dabU, 0x769aec76U,
0xca458fcaU, 0x829d1f82U, 0xc94089c9U, 0x7d87fa7dU,
0xfa15effaU, 0x59ebb259U, 0x47c98e47U, 0xf00bfbf0U,
0xadec41adU, 0xd467b3d4U, 0xa2fd5fa2U, 0xafea45afU,
0x9cbf239cU, 0xa4f753a4U, 0x7296e472U, 0xc05b9bc0U,
0xb7c275b7U, 0xfd1ce1fdU, 0x93ae3d93U, 0x266a4c26U,
0x365a6c36U, 0x3f417e3fU, 0xf702f5f7U, 0xcc4f83ccU,
0x345c6834U, 0xa5f451a5U, 0xe534d1e5U, 0xf108f9f1U,
0x7193e271U, 0xd873abd8U, 0x31536231U, 0x153f2a15U,
0x040c0804U, 0xc75295c7U, 0x23654623U, 0xc35e9dc3U,
0x18283018U, 0x96a13796U, 0x050f0a05U, 0x9ab52f9aU,
0x07090e07U, 0x12362412U, 0x809b1b80U, 0xe23ddfe2U,
0xeb26cdebU, 0x27694e27U, 0xb2cd7fb2U, 0x759fea75U,
0x091b1209U, 0x839e1d83U, 0x2c74582cU, 0x1a2e341aU,
0x1b2d361bU, 0x6eb2dc6eU, 0x5aeeb45aU, 0xa0fb5ba0U,
0x52f6a452U, 0x3b4d763bU, 0xd661b7d6U, 0xb3ce7db3U,
0x297b5229U, 0xe33edde3U, 0x2f715e2fU, 0x84971384U,
0x53f5a653U, 0xd168b9d1U, 0x00000000U, 0xed2cc1edU,
0x20604020U, 0xfc1fe3fcU, 0xb1c879b1U, 0x5bedb65bU,
0x6abed46aU, 0xcb468dcbU, 0xbed967beU, 0x394b7239U,
0x4ade944aU, 0x4cd4984cU, 0x58e8b058U, 0xcf4a85cfU,
0xd06bbbd0U, 0xef2ac5efU, 0xaae54faaU, 0xfb16edfbU,
0x43c58643U, 0x4dd79a4dU, 0x33556633U, 0x85941185U,
0x45cf8a45U, 0xf910e9f9U, 0x02060402U, 0x7f81fe7fU,
0x50f0a050U, 0x3c44783cU, 0x9fba259fU, 0xa8e34ba8U,
0x51f3a251U, 0xa3fe5da3U, 0x40c08040U, 0x8f8a058fU,
0x92ad3f92U, 0x9dbc219dU, 0x38487038U, 0xf504f1f5U,
0xbcdf63bcU, 0xb6c177b6U, 0xda75afdaU, 0x21634221U,
0x10302010U, 0xff1ae5ffU, 0xf30efdf3U, 0xd26dbfd2U,
0xcd4c81cdU, 0x0c14180cU, 0x13352613U, 0xec2fc3ecU,
0x5fe1be5fU, 0x97a23597U, 0x44cc8844U, 0x17392e17U,
0xc45793c4U, 0xa7f255a7U, 0x7e82fc7eU, 0x3d477a3dU,
0x64acc864U, 0x5de7ba5dU, 0x192b3219U, 0x7395e673U,
0x60a0c060U, 0x81981981U, 0x4fd19e4fU, 0xdc7fa3dcU,
0x22664422U, 0x2a7e542aU, 0x90ab3b90U, 0x88830b88U,
0x46ca8c46U, 0xee29c7eeU, 0xb8d36bb8U, 0x143c2814U,
0xde79a7deU, 0x5ee2bc5eU, 0x0b1d160bU, 0xdb76addbU,
0xe03bdbe0U, 0x32566432U, 0x3a4e743aU, 0x0a1e140aU,
0x49db9249U, 0x060a0c06U, 0x246c4824U, 0x5ce4b85cU,
0xc25d9fc2U, 0xd36ebdd3U, 0xacef43acU, 0x62a6c462U,
0x91a83991U, 0x95a43195U, 0xe437d3e4U, 0x798bf279U,
0xe732d5e7U, 0xc8438bc8U, 0x37596e37U, 0x6db7da6dU,
0x8d8c018dU, 0xd564b1d5U, 0x4ed29c4eU, 0xa9e049a9U,
0x6cb4d86cU, 0x56faac56U, 0xf407f3f4U, 0xea25cfeaU,
0x65afca65U, 0x7a8ef47aU, 0xaee947aeU, 0x08181008U,
0xbad56fbaU, 0x7888f078U, 0x256f4a25U, 0x2e725c2eU,
0x1c24381cU, 0xa6f157a6U, 0xb4c773b4U, 0xc65197c6U,
0xe823cbe8U, 0xdd7ca1ddU, 0x749ce874U, 0x1f213e1fU,
0x4bdd964bU, 0xbddc61bdU, 0x8b860d8bU, 0x8a850f8aU,
0x7090e070U, 0x3e427c3eU, 0xb5c471b5U, 0x66aacc66U,
0x48d89048U, 0x03050603U, 0xf601f7f6U, 0x0e121c0eU,
0x61a3c261U, 0x355f6a35U, 0x57f9ae57U, 0xb9d069b9U,
0x86911786U, 0xc15899c1U, 0x1d273a1dU, 0x9eb9279eU,
0xe138d9e1U, 0xf813ebf8U, 0x98b32b98U, 0x11332211U,
0x69bbd269U, 0xd970a9d9U, 0x8e89078eU, 0x94a73394U,
0x9bb62d9bU, 0x1e223c1eU, 0x87921587U, 0xe920c9e9U,
0xce4987ceU, 0x55ffaa55U, 0x28785028U, 0xdf7aa5dfU,
0x8c8f038cU, 0xa1f859a1U, 0x89800989U, 0x0d171a0dU,
0xbfda65bfU, 0xe631d7e6U, 0x42c68442U, 0x68b8d068U,
0x41c38241U, 0x99b02999U, 0x2d775a2dU, 0x0f111e0fU,
0xb0cb7bb0U, 0x54fca854U, 0xbbd66dbbU, 0x163a2c16U,
};
static const u32 Te3[256] = {
0x6363a5c6U, 0x7c7c84f8U, 0x777799eeU, 0x7b7b8df6U,
0xf2f20dffU, 0x6b6bbdd6U, 0x6f6fb1deU, 0xc5c55491U,
0x30305060U, 0x01010302U, 0x6767a9ceU, 0x2b2b7d56U,
0xfefe19e7U, 0xd7d762b5U, 0xababe64dU, 0x76769aecU,
0xcaca458fU, 0x82829d1fU, 0xc9c94089U, 0x7d7d87faU,
0xfafa15efU, 0x5959ebb2U, 0x4747c98eU, 0xf0f00bfbU,
0xadadec41U, 0xd4d467b3U, 0xa2a2fd5fU, 0xafafea45U,
0x9c9cbf23U, 0xa4a4f753U, 0x727296e4U, 0xc0c05b9bU,
0xb7b7c275U, 0xfdfd1ce1U, 0x9393ae3dU, 0x26266a4cU,
0x36365a6cU, 0x3f3f417eU, 0xf7f702f5U, 0xcccc4f83U,
0x34345c68U, 0xa5a5f451U, 0xe5e534d1U, 0xf1f108f9U,
0x717193e2U, 0xd8d873abU, 0x31315362U, 0x15153f2aU,
0x04040c08U, 0xc7c75295U, 0x23236546U, 0xc3c35e9dU,
0x18182830U, 0x9696a137U, 0x05050f0aU, 0x9a9ab52fU,
0x0707090eU, 0x12123624U, 0x80809b1bU, 0xe2e23ddfU,
0xebeb26cdU, 0x2727694eU, 0xb2b2cd7fU, 0x75759feaU,
0x09091b12U, 0x83839e1dU, 0x2c2c7458U, 0x1a1a2e34U,
0x1b1b2d36U, 0x6e6eb2dcU, 0x5a5aeeb4U, 0xa0a0fb5bU,
0x5252f6a4U, 0x3b3b4d76U, 0xd6d661b7U, 0xb3b3ce7dU,
0x29297b52U, 0xe3e33eddU, 0x2f2f715eU, 0x84849713U,
0x5353f5a6U, 0xd1d168b9U, 0x00000000U, 0xeded2cc1U,
0x20206040U, 0xfcfc1fe3U, 0xb1b1c879U, 0x5b5bedb6U,
0x6a6abed4U, 0xcbcb468dU, 0xbebed967U, 0x39394b72U,
0x4a4ade94U, 0x4c4cd498U, 0x5858e8b0U, 0xcfcf4a85U,
0xd0d06bbbU, 0xefef2ac5U, 0xaaaae54fU, 0xfbfb16edU,
0x4343c586U, 0x4d4dd79aU, 0x33335566U, 0x85859411U,
0x4545cf8aU, 0xf9f910e9U, 0x02020604U, 0x7f7f81feU,
0x5050f0a0U, 0x3c3c4478U, 0x9f9fba25U, 0xa8a8e34bU,
0x5151f3a2U, 0xa3a3fe5dU, 0x4040c080U, 0x8f8f8a05U,
0x9292ad3fU, 0x9d9dbc21U, 0x38384870U, 0xf5f504f1U,
0xbcbcdf63U, 0xb6b6c177U, 0xdada75afU, 0x21216342U,
0x10103020U, 0xffff1ae5U, 0xf3f30efdU, 0xd2d26dbfU,
0xcdcd4c81U, 0x0c0c1418U, 0x13133526U, 0xecec2fc3U,
0x5f5fe1beU, 0x9797a235U, 0x4444cc88U, 0x1717392eU,
0xc4c45793U, 0xa7a7f255U, 0x7e7e82fcU, 0x3d3d477aU,
0x6464acc8U, 0x5d5de7baU, 0x19192b32U, 0x737395e6U,
0x6060a0c0U, 0x81819819U, 0x4f4fd19eU, 0xdcdc7fa3U,
0x22226644U, 0x2a2a7e54U, 0x9090ab3bU, 0x8888830bU,
0x4646ca8cU, 0xeeee29c7U, 0xb8b8d36bU, 0x14143c28U,
0xdede79a7U, 0x5e5ee2bcU, 0x0b0b1d16U, 0xdbdb76adU,
0xe0e03bdbU, 0x32325664U, 0x3a3a4e74U, 0x0a0a1e14U,
0x4949db92U, 0x06060a0cU, 0x24246c48U, 0x5c5ce4b8U,
0xc2c25d9fU, 0xd3d36ebdU, 0xacacef43U, 0x6262a6c4U,
0x9191a839U, 0x9595a431U, 0xe4e437d3U, 0x79798bf2U,
0xe7e732d5U, 0xc8c8438bU, 0x3737596eU, 0x6d6db7daU,
0x8d8d8c01U, 0xd5d564b1U, 0x4e4ed29cU, 0xa9a9e049U,
0x6c6cb4d8U, 0x5656faacU, 0xf4f407f3U, 0xeaea25cfU,
0x6565afcaU, 0x7a7a8ef4U, 0xaeaee947U, 0x08081810U,
0xbabad56fU, 0x787888f0U, 0x25256f4aU, 0x2e2e725cU,
0x1c1c2438U, 0xa6a6f157U, 0xb4b4c773U, 0xc6c65197U,
0xe8e823cbU, 0xdddd7ca1U, 0x74749ce8U, 0x1f1f213eU,
0x4b4bdd96U, 0xbdbddc61U, 0x8b8b860dU, 0x8a8a850fU,
0x707090e0U, 0x3e3e427cU, 0xb5b5c471U, 0x6666aaccU,
0x4848d890U, 0x03030506U, 0xf6f601f7U, 0x0e0e121cU,
0x6161a3c2U, 0x35355f6aU, 0x5757f9aeU, 0xb9b9d069U,
0x86869117U, 0xc1c15899U, 0x1d1d273aU, 0x9e9eb927U,
0xe1e138d9U, 0xf8f813ebU, 0x9898b32bU, 0x11113322U,
0x6969bbd2U, 0xd9d970a9U, 0x8e8e8907U, 0x9494a733U,
0x9b9bb62dU, 0x1e1e223cU, 0x87879215U, 0xe9e920c9U,
0xcece4987U, 0x5555ffaaU, 0x28287850U, 0xdfdf7aa5U,
0x8c8c8f03U, 0xa1a1f859U, 0x89898009U, 0x0d0d171aU,
0xbfbfda65U, 0xe6e631d7U, 0x4242c684U, 0x6868b8d0U,
0x4141c382U, 0x9999b029U, 0x2d2d775aU, 0x0f0f111eU,
0xb0b0cb7bU, 0x5454fca8U, 0xbbbbd66dU, 0x16163a2cU,
};
static const u32 Te4[256] = {
0x63636363U, 0x7c7c7c7cU, 0x77777777U, 0x7b7b7b7bU,
0xf2f2f2f2U, 0x6b6b6b6bU, 0x6f6f6f6fU, 0xc5c5c5c5U,
0x30303030U, 0x01010101U, 0x67676767U, 0x2b2b2b2bU,
0xfefefefeU, 0xd7d7d7d7U, 0xababababU, 0x76767676U,
0xcacacacaU, 0x82828282U, 0xc9c9c9c9U, 0x7d7d7d7dU,
0xfafafafaU, 0x59595959U, 0x47474747U, 0xf0f0f0f0U,
0xadadadadU, 0xd4d4d4d4U, 0xa2a2a2a2U, 0xafafafafU,
0x9c9c9c9cU, 0xa4a4a4a4U, 0x72727272U, 0xc0c0c0c0U,
0xb7b7b7b7U, 0xfdfdfdfdU, 0x93939393U, 0x26262626U,
0x36363636U, 0x3f3f3f3fU, 0xf7f7f7f7U, 0xccccccccU,
0x34343434U, 0xa5a5a5a5U, 0xe5e5e5e5U, 0xf1f1f1f1U,
0x71717171U, 0xd8d8d8d8U, 0x31313131U, 0x15151515U,
0x04040404U, 0xc7c7c7c7U, 0x23232323U, 0xc3c3c3c3U,
0x18181818U, 0x96969696U, 0x05050505U, 0x9a9a9a9aU,
0x07070707U, 0x12121212U, 0x80808080U, 0xe2e2e2e2U,
0xebebebebU, 0x27272727U, 0xb2b2b2b2U, 0x75757575U,
0x09090909U, 0x83838383U, 0x2c2c2c2cU, 0x1a1a1a1aU,
0x1b1b1b1bU, 0x6e6e6e6eU, 0x5a5a5a5aU, 0xa0a0a0a0U,
0x52525252U, 0x3b3b3b3bU, 0xd6d6d6d6U, 0xb3b3b3b3U,
0x29292929U, 0xe3e3e3e3U, 0x2f2f2f2fU, 0x84848484U,
0x53535353U, 0xd1d1d1d1U, 0x00000000U, 0xededededU,
0x20202020U, 0xfcfcfcfcU, 0xb1b1b1b1U, 0x5b5b5b5bU,
0x6a6a6a6aU, 0xcbcbcbcbU, 0xbebebebeU, 0x39393939U,
0x4a4a4a4aU, 0x4c4c4c4cU, 0x58585858U, 0xcfcfcfcfU,
0xd0d0d0d0U, 0xefefefefU, 0xaaaaaaaaU, 0xfbfbfbfbU,
0x43434343U, 0x4d4d4d4dU, 0x33333333U, 0x85858585U,
0x45454545U, 0xf9f9f9f9U, 0x02020202U, 0x7f7f7f7fU,
0x50505050U, 0x3c3c3c3cU, 0x9f9f9f9fU, 0xa8a8a8a8U,
0x51515151U, 0xa3a3a3a3U, 0x40404040U, 0x8f8f8f8fU,
0x92929292U, 0x9d9d9d9dU, 0x38383838U, 0xf5f5f5f5U,
0xbcbcbcbcU, 0xb6b6b6b6U, 0xdadadadaU, 0x21212121U,
0x10101010U, 0xffffffffU, 0xf3f3f3f3U, 0xd2d2d2d2U,
0xcdcdcdcdU, 0x0c0c0c0cU, 0x13131313U, 0xececececU,
0x5f5f5f5fU, 0x97979797U, 0x44444444U, 0x17171717U,
0xc4c4c4c4U, 0xa7a7a7a7U, 0x7e7e7e7eU, 0x3d3d3d3dU,
0x64646464U, 0x5d5d5d5dU, 0x19191919U, 0x73737373U,
0x60606060U, 0x81818181U, 0x4f4f4f4fU, 0xdcdcdcdcU,
0x22222222U, 0x2a2a2a2aU, 0x90909090U, 0x88888888U,
0x46464646U, 0xeeeeeeeeU, 0xb8b8b8b8U, 0x14141414U,
0xdedededeU, 0x5e5e5e5eU, 0x0b0b0b0bU, 0xdbdbdbdbU,
0xe0e0e0e0U, 0x32323232U, 0x3a3a3a3aU, 0x0a0a0a0aU,
0x49494949U, 0x06060606U, 0x24242424U, 0x5c5c5c5cU,
0xc2c2c2c2U, 0xd3d3d3d3U, 0xacacacacU, 0x62626262U,
0x91919191U, 0x95959595U, 0xe4e4e4e4U, 0x79797979U,
0xe7e7e7e7U, 0xc8c8c8c8U, 0x37373737U, 0x6d6d6d6dU,
0x8d8d8d8dU, 0xd5d5d5d5U, 0x4e4e4e4eU, 0xa9a9a9a9U,
0x6c6c6c6cU, 0x56565656U, 0xf4f4f4f4U, 0xeaeaeaeaU,
0x65656565U, 0x7a7a7a7aU, 0xaeaeaeaeU, 0x08080808U,
0xbabababaU, 0x78787878U, 0x25252525U, 0x2e2e2e2eU,
0x1c1c1c1cU, 0xa6a6a6a6U, 0xb4b4b4b4U, 0xc6c6c6c6U,
0xe8e8e8e8U, 0xddddddddU, 0x74747474U, 0x1f1f1f1fU,
0x4b4b4b4bU, 0xbdbdbdbdU, 0x8b8b8b8bU, 0x8a8a8a8aU,
0x70707070U, 0x3e3e3e3eU, 0xb5b5b5b5U, 0x66666666U,
0x48484848U, 0x03030303U, 0xf6f6f6f6U, 0x0e0e0e0eU,
0x61616161U, 0x35353535U, 0x57575757U, 0xb9b9b9b9U,
0x86868686U, 0xc1c1c1c1U, 0x1d1d1d1dU, 0x9e9e9e9eU,
0xe1e1e1e1U, 0xf8f8f8f8U, 0x98989898U, 0x11111111U,
0x69696969U, 0xd9d9d9d9U, 0x8e8e8e8eU, 0x94949494U,
0x9b9b9b9bU, 0x1e1e1e1eU, 0x87878787U, 0xe9e9e9e9U,
0xcecececeU, 0x55555555U, 0x28282828U, 0xdfdfdfdfU,
0x8c8c8c8cU, 0xa1a1a1a1U, 0x89898989U, 0x0d0d0d0dU,
0xbfbfbfbfU, 0xe6e6e6e6U, 0x42424242U, 0x68686868U,
0x41414141U, 0x99999999U, 0x2d2d2d2dU, 0x0f0f0f0fU,
0xb0b0b0b0U, 0x54545454U, 0xbbbbbbbbU, 0x16161616U,
};
static const u32 Td0[256] = {
0x51f4a750U, 0x7e416553U, 0x1a17a4c3U, 0x3a275e96U,
0x3bab6bcbU, 0x1f9d45f1U, 0xacfa58abU, 0x4be30393U,
0x2030fa55U, 0xad766df6U, 0x88cc7691U, 0xf5024c25U,
0x4fe5d7fcU, 0xc52acbd7U, 0x26354480U, 0xb562a38fU,
0xdeb15a49U, 0x25ba1b67U, 0x45ea0e98U, 0x5dfec0e1U,
0xc32f7502U, 0x814cf012U, 0x8d4697a3U, 0x6bd3f9c6U,
0x038f5fe7U, 0x15929c95U, 0xbf6d7aebU, 0x955259daU,
0xd4be832dU, 0x587421d3U, 0x49e06929U, 0x8ec9c844U,
0x75c2896aU, 0xf48e7978U, 0x99583e6bU, 0x27b971ddU,
0xbee14fb6U, 0xf088ad17U, 0xc920ac66U, 0x7dce3ab4U,
0x63df4a18U, 0xe51a3182U, 0x97513360U, 0x62537f45U,
0xb16477e0U, 0xbb6bae84U, 0xfe81a01cU, 0xf9082b94U,
0x70486858U, 0x8f45fd19U, 0x94de6c87U, 0x527bf8b7U,
0xab73d323U, 0x724b02e2U, 0xe31f8f57U, 0x6655ab2aU,
0xb2eb2807U, 0x2fb5c203U, 0x86c57b9aU, 0xd33708a5U,
0x302887f2U, 0x23bfa5b2U, 0x02036abaU, 0xed16825cU,
0x8acf1c2bU, 0xa779b492U, 0xf307f2f0U, 0x4e69e2a1U,
0x65daf4cdU, 0x0605bed5U, 0xd134621fU, 0xc4a6fe8aU,
0x342e539dU, 0xa2f355a0U, 0x058ae132U, 0xa4f6eb75U,
0x0b83ec39U, 0x4060efaaU, 0x5e719f06U, 0xbd6e1051U,
0x3e218af9U, 0x96dd063dU, 0xdd3e05aeU, 0x4de6bd46U,
0x91548db5U, 0x71c45d05U, 0x0406d46fU, 0x605015ffU,
0x1998fb24U, 0xd6bde997U, 0x894043ccU, 0x67d99e77U,
0xb0e842bdU, 0x07898b88U, 0xe7195b38U, 0x79c8eedbU,
0xa17c0a47U, 0x7c420fe9U, 0xf8841ec9U, 0x00000000U,
0x09808683U, 0x322bed48U, 0x1e1170acU, 0x6c5a724eU,
0xfd0efffbU, 0x0f853856U, 0x3daed51eU, 0x362d3927U,
0x0a0fd964U, 0x685ca621U, 0x9b5b54d1U, 0x24362e3aU,
0x0c0a67b1U, 0x9357e70fU, 0xb4ee96d2U, 0x1b9b919eU,
0x80c0c54fU, 0x61dc20a2U, 0x5a774b69U, 0x1c121a16U,
0xe293ba0aU, 0xc0a02ae5U, 0x3c22e043U, 0x121b171dU,
0x0e090d0bU, 0xf28bc7adU, 0x2db6a8b9U, 0x141ea9c8U,
0x57f11985U, 0xaf75074cU, 0xee99ddbbU, 0xa37f60fdU,
0xf701269fU, 0x5c72f5bcU, 0x44663bc5U, 0x5bfb7e34U,
0x8b432976U, 0xcb23c6dcU, 0xb6edfc68U, 0xb8e4f163U,
0xd731dccaU, 0x42638510U, 0x13972240U, 0x84c61120U,
0x854a247dU, 0xd2bb3df8U, 0xaef93211U, 0xc729a16dU,
0x1d9e2f4bU, 0xdcb230f3U, 0x0d8652ecU, 0x77c1e3d0U,
0x2bb3166cU, 0xa970b999U, 0x119448faU, 0x47e96422U,
0xa8fc8cc4U, 0xa0f03f1aU, 0x567d2cd8U, 0x223390efU,
0x87494ec7U, 0xd938d1c1U, 0x8ccaa2feU, 0x98d40b36U,
0xa6f581cfU, 0xa57ade28U, 0xdab78e26U, 0x3fadbfa4U,
0x2c3a9de4U, 0x5078920dU, 0x6a5fcc9bU, 0x547e4662U,
0xf68d13c2U, 0x90d8b8e8U, 0x2e39f75eU, 0x82c3aff5U,
0x9f5d80beU, 0x69d0937cU, 0x6fd52da9U, 0xcf2512b3U,
0xc8ac993bU, 0x10187da7U, 0xe89c636eU, 0xdb3bbb7bU,
0xcd267809U, 0x6e5918f4U, 0xec9ab701U, 0x834f9aa8U,
0xe6956e65U, 0xaaffe67eU, 0x21bccf08U, 0xef15e8e6U,
0xbae79bd9U, 0x4a6f36ceU, 0xea9f09d4U, 0x29b07cd6U,
0x31a4b2afU, 0x2a3f2331U, 0xc6a59430U, 0x35a266c0U,
0x744ebc37U, 0xfc82caa6U, 0xe090d0b0U, 0x33a7d815U,
0xf104984aU, 0x41ecdaf7U, 0x7fcd500eU, 0x1791f62fU,
0x764dd68dU, 0x43efb04dU, 0xccaa4d54U, 0xe49604dfU,
0x9ed1b5e3U, 0x4c6a881bU, 0xc12c1fb8U, 0x4665517fU,
0x9d5eea04U, 0x018c355dU, 0xfa877473U, 0xfb0b412eU,
0xb3671d5aU, 0x92dbd252U, 0xe9105633U, 0x6dd64713U,
0x9ad7618cU, 0x37a10c7aU, 0x59f8148eU, 0xeb133c89U,
0xcea927eeU, 0xb761c935U, 0xe11ce5edU, 0x7a47b13cU,
0x9cd2df59U, 0x55f2733fU, 0x1814ce79U, 0x73c737bfU,
0x53f7cdeaU, 0x5ffdaa5bU, 0xdf3d6f14U, 0x7844db86U,
0xcaaff381U, 0xb968c43eU, 0x3824342cU, 0xc2a3405fU,
0x161dc372U, 0xbce2250cU, 0x283c498bU, 0xff0d9541U,
0x39a80171U, 0x080cb3deU, 0xd8b4e49cU, 0x6456c190U,
0x7bcb8461U, 0xd532b670U, 0x486c5c74U, 0xd0b85742U,
};
static const u32 Td1[256] = {
0x5051f4a7U, 0x537e4165U, 0xc31a17a4U, 0x963a275eU,
0xcb3bab6bU, 0xf11f9d45U, 0xabacfa58U, 0x934be303U,
0x552030faU, 0xf6ad766dU, 0x9188cc76U, 0x25f5024cU,
0xfc4fe5d7U, 0xd7c52acbU, 0x80263544U, 0x8fb562a3U,
0x49deb15aU, 0x6725ba1bU, 0x9845ea0eU, 0xe15dfec0U,
0x02c32f75U, 0x12814cf0U, 0xa38d4697U, 0xc66bd3f9U,
0xe7038f5fU, 0x9515929cU, 0xebbf6d7aU, 0xda955259U,
0x2dd4be83U, 0xd3587421U, 0x2949e069U, 0x448ec9c8U,
0x6a75c289U, 0x78f48e79U, 0x6b99583eU, 0xdd27b971U,
0xb6bee14fU, 0x17f088adU, 0x66c920acU, 0xb47dce3aU,
0x1863df4aU, 0x82e51a31U, 0x60975133U, 0x4562537fU,
0xe0b16477U, 0x84bb6baeU, 0x1cfe81a0U, 0x94f9082bU,
0x58704868U, 0x198f45fdU, 0x8794de6cU, 0xb7527bf8U,
0x23ab73d3U, 0xe2724b02U, 0x57e31f8fU, 0x2a6655abU,
0x07b2eb28U, 0x032fb5c2U, 0x9a86c57bU, 0xa5d33708U,
0xf2302887U, 0xb223bfa5U, 0xba02036aU, 0x5ced1682U,
0x2b8acf1cU, 0x92a779b4U, 0xf0f307f2U, 0xa14e69e2U,
0xcd65daf4U, 0xd50605beU, 0x1fd13462U, 0x8ac4a6feU,
0x9d342e53U, 0xa0a2f355U, 0x32058ae1U, 0x75a4f6ebU,
0x390b83ecU, 0xaa4060efU, 0x065e719fU, 0x51bd6e10U,
0xf93e218aU, 0x3d96dd06U, 0xaedd3e05U, 0x464de6bdU,
0xb591548dU, 0x0571c45dU, 0x6f0406d4U, 0xff605015U,
0x241998fbU, 0x97d6bde9U, 0xcc894043U, 0x7767d99eU,
0xbdb0e842U, 0x8807898bU, 0x38e7195bU, 0xdb79c8eeU,
0x47a17c0aU, 0xe97c420fU, 0xc9f8841eU, 0x00000000U,
0x83098086U, 0x48322bedU, 0xac1e1170U, 0x4e6c5a72U,
0xfbfd0effU, 0x560f8538U, 0x1e3daed5U, 0x27362d39U,
0x640a0fd9U, 0x21685ca6U, 0xd19b5b54U, 0x3a24362eU,
0xb10c0a67U, 0x0f9357e7U, 0xd2b4ee96U, 0x9e1b9b91U,
0x4f80c0c5U, 0xa261dc20U, 0x695a774bU, 0x161c121aU,
0x0ae293baU, 0xe5c0a02aU, 0x433c22e0U, 0x1d121b17U,
0x0b0e090dU, 0xadf28bc7U, 0xb92db6a8U, 0xc8141ea9U,
0x8557f119U, 0x4caf7507U, 0xbbee99ddU, 0xfda37f60U,
0x9ff70126U, 0xbc5c72f5U, 0xc544663bU, 0x345bfb7eU,
0x768b4329U, 0xdccb23c6U, 0x68b6edfcU, 0x63b8e4f1U,
0xcad731dcU, 0x10426385U, 0x40139722U, 0x2084c611U,
0x7d854a24U, 0xf8d2bb3dU, 0x11aef932U, 0x6dc729a1U,
0x4b1d9e2fU, 0xf3dcb230U, 0xec0d8652U, 0xd077c1e3U,
0x6c2bb316U, 0x99a970b9U, 0xfa119448U, 0x2247e964U,
0xc4a8fc8cU, 0x1aa0f03fU, 0xd8567d2cU, 0xef223390U,
0xc787494eU, 0xc1d938d1U, 0xfe8ccaa2U, 0x3698d40bU,
0xcfa6f581U, 0x28a57adeU, 0x26dab78eU, 0xa43fadbfU,
0xe42c3a9dU, 0x0d507892U, 0x9b6a5fccU, 0x62547e46U,
0xc2f68d13U, 0xe890d8b8U, 0x5e2e39f7U, 0xf582c3afU,
0xbe9f5d80U, 0x7c69d093U, 0xa96fd52dU, 0xb3cf2512U,
0x3bc8ac99U, 0xa710187dU, 0x6ee89c63U, 0x7bdb3bbbU,
0x09cd2678U, 0xf46e5918U, 0x01ec9ab7U, 0xa8834f9aU,
0x65e6956eU, 0x7eaaffe6U, 0x0821bccfU, 0xe6ef15e8U,
0xd9bae79bU, 0xce4a6f36U, 0xd4ea9f09U, 0xd629b07cU,
0xaf31a4b2U, 0x312a3f23U, 0x30c6a594U, 0xc035a266U,
0x37744ebcU, 0xa6fc82caU, 0xb0e090d0U, 0x1533a7d8U,
0x4af10498U, 0xf741ecdaU, 0x0e7fcd50U, 0x2f1791f6U,
0x8d764dd6U, 0x4d43efb0U, 0x54ccaa4dU, 0xdfe49604U,
0xe39ed1b5U, 0x1b4c6a88U, 0xb8c12c1fU, 0x7f466551U,
0x049d5eeaU, 0x5d018c35U, 0x73fa8774U, 0x2efb0b41U,
0x5ab3671dU, 0x5292dbd2U, 0x33e91056U, 0x136dd647U,
0x8c9ad761U, 0x7a37a10cU, 0x8e59f814U, 0x89eb133cU,
0xeecea927U, 0x35b761c9U, 0xede11ce5U, 0x3c7a47b1U,
0x599cd2dfU, 0x3f55f273U, 0x791814ceU, 0xbf73c737U,
0xea53f7cdU, 0x5b5ffdaaU, 0x14df3d6fU, 0x867844dbU,
0x81caaff3U, 0x3eb968c4U, 0x2c382434U, 0x5fc2a340U,
0x72161dc3U, 0x0cbce225U, 0x8b283c49U, 0x41ff0d95U,
0x7139a801U, 0xde080cb3U, 0x9cd8b4e4U, 0x906456c1U,
0x617bcb84U, 0x70d532b6U, 0x74486c5cU, 0x42d0b857U,
};
static const u32 Td2[256] = {
0xa75051f4U, 0x65537e41U, 0xa4c31a17U, 0x5e963a27U,
0x6bcb3babU, 0x45f11f9dU, 0x58abacfaU, 0x03934be3U,
0xfa552030U, 0x6df6ad76U, 0x769188ccU, 0x4c25f502U,
0xd7fc4fe5U, 0xcbd7c52aU, 0x44802635U, 0xa38fb562U,
0x5a49deb1U, 0x1b6725baU, 0x0e9845eaU, 0xc0e15dfeU,
0x7502c32fU, 0xf012814cU, 0x97a38d46U, 0xf9c66bd3U,
0x5fe7038fU, 0x9c951592U, 0x7aebbf6dU, 0x59da9552U,
0x832dd4beU, 0x21d35874U, 0x692949e0U, 0xc8448ec9U,
0x896a75c2U, 0x7978f48eU, 0x3e6b9958U, 0x71dd27b9U,
0x4fb6bee1U, 0xad17f088U, 0xac66c920U, 0x3ab47dceU,
0x4a1863dfU, 0x3182e51aU, 0x33609751U, 0x7f456253U,
0x77e0b164U, 0xae84bb6bU, 0xa01cfe81U, 0x2b94f908U,
0x68587048U, 0xfd198f45U, 0x6c8794deU, 0xf8b7527bU,
0xd323ab73U, 0x02e2724bU, 0x8f57e31fU, 0xab2a6655U,
0x2807b2ebU, 0xc2032fb5U, 0x7b9a86c5U, 0x08a5d337U,
0x87f23028U, 0xa5b223bfU, 0x6aba0203U, 0x825ced16U,
0x1c2b8acfU, 0xb492a779U, 0xf2f0f307U, 0xe2a14e69U,
0xf4cd65daU, 0xbed50605U, 0x621fd134U, 0xfe8ac4a6U,
0x539d342eU, 0x55a0a2f3U, 0xe132058aU, 0xeb75a4f6U,
0xec390b83U, 0xefaa4060U, 0x9f065e71U, 0x1051bd6eU,
0x8af93e21U, 0x063d96ddU, 0x05aedd3eU, 0xbd464de6U,
0x8db59154U, 0x5d0571c4U, 0xd46f0406U, 0x15ff6050U,
0xfb241998U, 0xe997d6bdU, 0x43cc8940U, 0x9e7767d9U,
0x42bdb0e8U, 0x8b880789U, 0x5b38e719U, 0xeedb79c8U,
0x0a47a17cU, 0x0fe97c42U, 0x1ec9f884U, 0x00000000U,
0x86830980U, 0xed48322bU, 0x70ac1e11U, 0x724e6c5aU,
0xfffbfd0eU, 0x38560f85U, 0xd51e3daeU, 0x3927362dU,
0xd9640a0fU, 0xa621685cU, 0x54d19b5bU, 0x2e3a2436U,
0x67b10c0aU, 0xe70f9357U, 0x96d2b4eeU, 0x919e1b9bU,
0xc54f80c0U, 0x20a261dcU, 0x4b695a77U, 0x1a161c12U,
0xba0ae293U, 0x2ae5c0a0U, 0xe0433c22U, 0x171d121bU,
0x0d0b0e09U, 0xc7adf28bU, 0xa8b92db6U, 0xa9c8141eU,
0x198557f1U, 0x074caf75U, 0xddbbee99U, 0x60fda37fU,
0x269ff701U, 0xf5bc5c72U, 0x3bc54466U, 0x7e345bfbU,
0x29768b43U, 0xc6dccb23U, 0xfc68b6edU, 0xf163b8e4U,
0xdccad731U, 0x85104263U, 0x22401397U, 0x112084c6U,
0x247d854aU, 0x3df8d2bbU, 0x3211aef9U, 0xa16dc729U,
0x2f4b1d9eU, 0x30f3dcb2U, 0x52ec0d86U, 0xe3d077c1U,
0x166c2bb3U, 0xb999a970U, 0x48fa1194U, 0x642247e9U,
0x8cc4a8fcU, 0x3f1aa0f0U, 0x2cd8567dU, 0x90ef2233U,
0x4ec78749U, 0xd1c1d938U, 0xa2fe8ccaU, 0x0b3698d4U,
0x81cfa6f5U, 0xde28a57aU, 0x8e26dab7U, 0xbfa43fadU,
0x9de42c3aU, 0x920d5078U, 0xcc9b6a5fU, 0x4662547eU,
0x13c2f68dU, 0xb8e890d8U, 0xf75e2e39U, 0xaff582c3U,
0x80be9f5dU, 0x937c69d0U, 0x2da96fd5U, 0x12b3cf25U,
0x993bc8acU, 0x7da71018U, 0x636ee89cU, 0xbb7bdb3bU,
0x7809cd26U, 0x18f46e59U, 0xb701ec9aU, 0x9aa8834fU,
0x6e65e695U, 0xe67eaaffU, 0xcf0821bcU, 0xe8e6ef15U,
0x9bd9bae7U, 0x36ce4a6fU, 0x09d4ea9fU, 0x7cd629b0U,
0xb2af31a4U, 0x23312a3fU, 0x9430c6a5U, 0x66c035a2U,
0xbc37744eU, 0xcaa6fc82U, 0xd0b0e090U, 0xd81533a7U,
0x984af104U, 0xdaf741ecU, 0x500e7fcdU, 0xf62f1791U,
0xd68d764dU, 0xb04d43efU, 0x4d54ccaaU, 0x04dfe496U,
0xb5e39ed1U, 0x881b4c6aU, 0x1fb8c12cU, 0x517f4665U,
0xea049d5eU, 0x355d018cU, 0x7473fa87U, 0x412efb0bU,
0x1d5ab367U, 0xd25292dbU, 0x5633e910U, 0x47136dd6U,
0x618c9ad7U, 0x0c7a37a1U, 0x148e59f8U, 0x3c89eb13U,
0x27eecea9U, 0xc935b761U, 0xe5ede11cU, 0xb13c7a47U,
0xdf599cd2U, 0x733f55f2U, 0xce791814U, 0x37bf73c7U,
0xcdea53f7U, 0xaa5b5ffdU, 0x6f14df3dU, 0xdb867844U,
0xf381caafU, 0xc43eb968U, 0x342c3824U, 0x405fc2a3U,
0xc372161dU, 0x250cbce2U, 0x498b283cU, 0x9541ff0dU,
0x017139a8U, 0xb3de080cU, 0xe49cd8b4U, 0xc1906456U,
0x84617bcbU, 0xb670d532U, 0x5c74486cU, 0x5742d0b8U,
};
static const u32 Td3[256] = {
0xf4a75051U, 0x4165537eU, 0x17a4c31aU, 0x275e963aU,
0xab6bcb3bU, 0x9d45f11fU, 0xfa58abacU, 0xe303934bU,
0x30fa5520U, 0x766df6adU, 0xcc769188U, 0x024c25f5U,
0xe5d7fc4fU, 0x2acbd7c5U, 0x35448026U, 0x62a38fb5U,
0xb15a49deU, 0xba1b6725U, 0xea0e9845U, 0xfec0e15dU,
0x2f7502c3U, 0x4cf01281U, 0x4697a38dU, 0xd3f9c66bU,
0x8f5fe703U, 0x929c9515U, 0x6d7aebbfU, 0x5259da95U,
0xbe832dd4U, 0x7421d358U, 0xe0692949U, 0xc9c8448eU,
0xc2896a75U, 0x8e7978f4U, 0x583e6b99U, 0xb971dd27U,
0xe14fb6beU, 0x88ad17f0U, 0x20ac66c9U, 0xce3ab47dU,
0xdf4a1863U, 0x1a3182e5U, 0x51336097U, 0x537f4562U,
0x6477e0b1U, 0x6bae84bbU, 0x81a01cfeU, 0x082b94f9U,
0x48685870U, 0x45fd198fU, 0xde6c8794U, 0x7bf8b752U,
0x73d323abU, 0x4b02e272U, 0x1f8f57e3U, 0x55ab2a66U,
0xeb2807b2U, 0xb5c2032fU, 0xc57b9a86U, 0x3708a5d3U,
0x2887f230U, 0xbfa5b223U, 0x036aba02U, 0x16825cedU,
0xcf1c2b8aU, 0x79b492a7U, 0x07f2f0f3U, 0x69e2a14eU,
0xdaf4cd65U, 0x05bed506U, 0x34621fd1U, 0xa6fe8ac4U,
0x2e539d34U, 0xf355a0a2U, 0x8ae13205U, 0xf6eb75a4U,
0x83ec390bU, 0x60efaa40U, 0x719f065eU, 0x6e1051bdU,
0x218af93eU, 0xdd063d96U, 0x3e05aeddU, 0xe6bd464dU,
0x548db591U, 0xc45d0571U, 0x06d46f04U, 0x5015ff60U,
0x98fb2419U, 0xbde997d6U, 0x4043cc89U, 0xd99e7767U,
0xe842bdb0U, 0x898b8807U, 0x195b38e7U, 0xc8eedb79U,
0x7c0a47a1U, 0x420fe97cU, 0x841ec9f8U, 0x00000000U,
0x80868309U, 0x2bed4832U, 0x1170ac1eU, 0x5a724e6cU,
0x0efffbfdU, 0x8538560fU, 0xaed51e3dU, 0x2d392736U,
0x0fd9640aU, 0x5ca62168U, 0x5b54d19bU, 0x362e3a24U,
0x0a67b10cU, 0x57e70f93U, 0xee96d2b4U, 0x9b919e1bU,
0xc0c54f80U, 0xdc20a261U, 0x774b695aU, 0x121a161cU,
0x93ba0ae2U, 0xa02ae5c0U, 0x22e0433cU, 0x1b171d12U,
0x090d0b0eU, 0x8bc7adf2U, 0xb6a8b92dU, 0x1ea9c814U,
0xf1198557U, 0x75074cafU, 0x99ddbbeeU, 0x7f60fda3U,
0x01269ff7U, 0x72f5bc5cU, 0x663bc544U, 0xfb7e345bU,
0x4329768bU, 0x23c6dccbU, 0xedfc68b6U, 0xe4f163b8U,
0x31dccad7U, 0x63851042U, 0x97224013U, 0xc6112084U,
0x4a247d85U, 0xbb3df8d2U, 0xf93211aeU, 0x29a16dc7U,
0x9e2f4b1dU, 0xb230f3dcU, 0x8652ec0dU, 0xc1e3d077U,
0xb3166c2bU, 0x70b999a9U, 0x9448fa11U, 0xe9642247U,
0xfc8cc4a8U, 0xf03f1aa0U, 0x7d2cd856U, 0x3390ef22U,
0x494ec787U, 0x38d1c1d9U, 0xcaa2fe8cU, 0xd40b3698U,
0xf581cfa6U, 0x7ade28a5U, 0xb78e26daU, 0xadbfa43fU,
0x3a9de42cU, 0x78920d50U, 0x5fcc9b6aU, 0x7e466254U,
0x8d13c2f6U, 0xd8b8e890U, 0x39f75e2eU, 0xc3aff582U,
0x5d80be9fU, 0xd0937c69U, 0xd52da96fU, 0x2512b3cfU,
0xac993bc8U, 0x187da710U, 0x9c636ee8U, 0x3bbb7bdbU,
0x267809cdU, 0x5918f46eU, 0x9ab701ecU, 0x4f9aa883U,
0x956e65e6U, 0xffe67eaaU, 0xbccf0821U, 0x15e8e6efU,
0xe79bd9baU, 0x6f36ce4aU, 0x9f09d4eaU, 0xb07cd629U,
0xa4b2af31U, 0x3f23312aU, 0xa59430c6U, 0xa266c035U,
0x4ebc3774U, 0x82caa6fcU, 0x90d0b0e0U, 0xa7d81533U,
0x04984af1U, 0xecdaf741U, 0xcd500e7fU, 0x91f62f17U,
0x4dd68d76U, 0xefb04d43U, 0xaa4d54ccU, 0x9604dfe4U,
0xd1b5e39eU, 0x6a881b4cU, 0x2c1fb8c1U, 0x65517f46U,
0x5eea049dU, 0x8c355d01U, 0x877473faU, 0x0b412efbU,
0x671d5ab3U, 0xdbd25292U, 0x105633e9U, 0xd647136dU,
0xd7618c9aU, 0xa10c7a37U, 0xf8148e59U, 0x133c89ebU,
0xa927eeceU, 0x61c935b7U, 0x1ce5ede1U, 0x47b13c7aU,
0xd2df599cU, 0xf2733f55U, 0x14ce7918U, 0xc737bf73U,
0xf7cdea53U, 0xfdaa5b5fU, 0x3d6f14dfU, 0x44db8678U,
0xaff381caU, 0x68c43eb9U, 0x24342c38U, 0xa3405fc2U,
0x1dc37216U, 0xe2250cbcU, 0x3c498b28U, 0x0d9541ffU,
0xa8017139U, 0x0cb3de08U, 0xb4e49cd8U, 0x56c19064U,
0xcb84617bU, 0x32b670d5U, 0x6c5c7448U, 0xb85742d0U,
};
static const u32 Td4[256] = {
0x52525252U, 0x09090909U, 0x6a6a6a6aU, 0xd5d5d5d5U,
0x30303030U, 0x36363636U, 0xa5a5a5a5U, 0x38383838U,
0xbfbfbfbfU, 0x40404040U, 0xa3a3a3a3U, 0x9e9e9e9eU,
0x81818181U, 0xf3f3f3f3U, 0xd7d7d7d7U, 0xfbfbfbfbU,
0x7c7c7c7cU, 0xe3e3e3e3U, 0x39393939U, 0x82828282U,
0x9b9b9b9bU, 0x2f2f2f2fU, 0xffffffffU, 0x87878787U,
0x34343434U, 0x8e8e8e8eU, 0x43434343U, 0x44444444U,
0xc4c4c4c4U, 0xdedededeU, 0xe9e9e9e9U, 0xcbcbcbcbU,
0x54545454U, 0x7b7b7b7bU, 0x94949494U, 0x32323232U,
0xa6a6a6a6U, 0xc2c2c2c2U, 0x23232323U, 0x3d3d3d3dU,
0xeeeeeeeeU, 0x4c4c4c4cU, 0x95959595U, 0x0b0b0b0bU,
0x42424242U, 0xfafafafaU, 0xc3c3c3c3U, 0x4e4e4e4eU,
0x08080808U, 0x2e2e2e2eU, 0xa1a1a1a1U, 0x66666666U,
0x28282828U, 0xd9d9d9d9U, 0x24242424U, 0xb2b2b2b2U,
0x76767676U, 0x5b5b5b5bU, 0xa2a2a2a2U, 0x49494949U,
0x6d6d6d6dU, 0x8b8b8b8bU, 0xd1d1d1d1U, 0x25252525U,
0x72727272U, 0xf8f8f8f8U, 0xf6f6f6f6U, 0x64646464U,
0x86868686U, 0x68686868U, 0x98989898U, 0x16161616U,
0xd4d4d4d4U, 0xa4a4a4a4U, 0x5c5c5c5cU, 0xccccccccU,
0x5d5d5d5dU, 0x65656565U, 0xb6b6b6b6U, 0x92929292U,
0x6c6c6c6cU, 0x70707070U, 0x48484848U, 0x50505050U,
0xfdfdfdfdU, 0xededededU, 0xb9b9b9b9U, 0xdadadadaU,
0x5e5e5e5eU, 0x15151515U, 0x46464646U, 0x57575757U,
0xa7a7a7a7U, 0x8d8d8d8dU, 0x9d9d9d9dU, 0x84848484U,
0x90909090U, 0xd8d8d8d8U, 0xababababU, 0x00000000U,
0x8c8c8c8cU, 0xbcbcbcbcU, 0xd3d3d3d3U, 0x0a0a0a0aU,
0xf7f7f7f7U, 0xe4e4e4e4U, 0x58585858U, 0x05050505U,
0xb8b8b8b8U, 0xb3b3b3b3U, 0x45454545U, 0x06060606U,
0xd0d0d0d0U, 0x2c2c2c2cU, 0x1e1e1e1eU, 0x8f8f8f8fU,
0xcacacacaU, 0x3f3f3f3fU, 0x0f0f0f0fU, 0x02020202U,
0xc1c1c1c1U, 0xafafafafU, 0xbdbdbdbdU, 0x03030303U,
0x01010101U, 0x13131313U, 0x8a8a8a8aU, 0x6b6b6b6bU,
0x3a3a3a3aU, 0x91919191U, 0x11111111U, 0x41414141U,
0x4f4f4f4fU, 0x67676767U, 0xdcdcdcdcU, 0xeaeaeaeaU,
0x97979797U, 0xf2f2f2f2U, 0xcfcfcfcfU, 0xcecececeU,
0xf0f0f0f0U, 0xb4b4b4b4U, 0xe6e6e6e6U, 0x73737373U,
0x96969696U, 0xacacacacU, 0x74747474U, 0x22222222U,
0xe7e7e7e7U, 0xadadadadU, 0x35353535U, 0x85858585U,
0xe2e2e2e2U, 0xf9f9f9f9U, 0x37373737U, 0xe8e8e8e8U,
0x1c1c1c1cU, 0x75757575U, 0xdfdfdfdfU, 0x6e6e6e6eU,
0x47474747U, 0xf1f1f1f1U, 0x1a1a1a1aU, 0x71717171U,
0x1d1d1d1dU, 0x29292929U, 0xc5c5c5c5U, 0x89898989U,
0x6f6f6f6fU, 0xb7b7b7b7U, 0x62626262U, 0x0e0e0e0eU,
0xaaaaaaaaU, 0x18181818U, 0xbebebebeU, 0x1b1b1b1bU,
0xfcfcfcfcU, 0x56565656U, 0x3e3e3e3eU, 0x4b4b4b4bU,
0xc6c6c6c6U, 0xd2d2d2d2U, 0x79797979U, 0x20202020U,
0x9a9a9a9aU, 0xdbdbdbdbU, 0xc0c0c0c0U, 0xfefefefeU,
0x78787878U, 0xcdcdcdcdU, 0x5a5a5a5aU, 0xf4f4f4f4U,
0x1f1f1f1fU, 0xddddddddU, 0xa8a8a8a8U, 0x33333333U,
0x88888888U, 0x07070707U, 0xc7c7c7c7U, 0x31313131U,
0xb1b1b1b1U, 0x12121212U, 0x10101010U, 0x59595959U,
0x27272727U, 0x80808080U, 0xececececU, 0x5f5f5f5fU,
0x60606060U, 0x51515151U, 0x7f7f7f7fU, 0xa9a9a9a9U,
0x19191919U, 0xb5b5b5b5U, 0x4a4a4a4aU, 0x0d0d0d0dU,
0x2d2d2d2dU, 0xe5e5e5e5U, 0x7a7a7a7aU, 0x9f9f9f9fU,
0x93939393U, 0xc9c9c9c9U, 0x9c9c9c9cU, 0xefefefefU,
0xa0a0a0a0U, 0xe0e0e0e0U, 0x3b3b3b3bU, 0x4d4d4d4dU,
0xaeaeaeaeU, 0x2a2a2a2aU, 0xf5f5f5f5U, 0xb0b0b0b0U,
0xc8c8c8c8U, 0xebebebebU, 0xbbbbbbbbU, 0x3c3c3c3cU,
0x83838383U, 0x53535353U, 0x99999999U, 0x61616161U,
0x17171717U, 0x2b2b2b2bU, 0x04040404U, 0x7e7e7e7eU,
0xbabababaU, 0x77777777U, 0xd6d6d6d6U, 0x26262626U,
0xe1e1e1e1U, 0x69696969U, 0x14141414U, 0x63636363U,
0x55555555U, 0x21212121U, 0x0c0c0c0cU, 0x7d7d7d7dU,
};
static const u32 rcon[] = {
0x01000000, 0x02000000, 0x04000000, 0x08000000,
0x10000000, 0x20000000, 0x40000000, 0x80000000,
0x1B000000, 0x36000000, /* for 128-bit blocks, Rijndael never uses more than 10 rcon values */
};
/**
* Expand the cipher key into the encryption key schedule.
*/
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key) {
u32 *rk;
int i = 0;
u32 temp;
if (!userKey || !key)
return -1;
if (bits != 128 && bits != 192 && bits != 256)
return -2;
rk = key->rd_key;
if (bits==128)
key->rounds = 10;
else if (bits==192)
key->rounds = 12;
else
key->rounds = 14;
rk[0] = GETU32(userKey );
rk[1] = GETU32(userKey + 4);
rk[2] = GETU32(userKey + 8);
rk[3] = GETU32(userKey + 12);
if (bits == 128) {
while (1) {
temp = rk[3];
rk[4] = rk[0] ^
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
(Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te4[(temp ) & 0xff] & 0x0000ff00) ^
(Te4[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[5] = rk[1] ^ rk[4];
rk[6] = rk[2] ^ rk[5];
rk[7] = rk[3] ^ rk[6];
if (++i == 10) {
return 0;
}
rk += 4;
}
}
rk[4] = GETU32(userKey + 16);
rk[5] = GETU32(userKey + 20);
if (bits == 192) {
while (1) {
temp = rk[ 5];
rk[ 6] = rk[ 0] ^
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
(Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te4[(temp ) & 0xff] & 0x0000ff00) ^
(Te4[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[ 7] = rk[ 1] ^ rk[ 6];
rk[ 8] = rk[ 2] ^ rk[ 7];
rk[ 9] = rk[ 3] ^ rk[ 8];
if (++i == 8) {
return 0;
}
rk[10] = rk[ 4] ^ rk[ 9];
rk[11] = rk[ 5] ^ rk[10];
rk += 6;
}
}
rk[6] = GETU32(userKey + 24);
rk[7] = GETU32(userKey + 28);
if (bits == 256) {
while (1) {
temp = rk[ 7];
rk[ 8] = rk[ 0] ^
(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
(Te4[(temp >> 8) & 0xff] & 0x00ff0000) ^
(Te4[(temp ) & 0xff] & 0x0000ff00) ^
(Te4[(temp >> 24) ] & 0x000000ff) ^
rcon[i];
rk[ 9] = rk[ 1] ^ rk[ 8];
rk[10] = rk[ 2] ^ rk[ 9];
rk[11] = rk[ 3] ^ rk[10];
if (++i == 7) {
return 0;
}
temp = rk[11];
rk[12] = rk[ 4] ^
(Te4[(temp >> 24) ] & 0xff000000) ^
(Te4[(temp >> 16) & 0xff] & 0x00ff0000) ^
(Te4[(temp >> 8) & 0xff] & 0x0000ff00) ^
(Te4[(temp ) & 0xff] & 0x000000ff);
rk[13] = rk[ 5] ^ rk[12];
rk[14] = rk[ 6] ^ rk[13];
rk[15] = rk[ 7] ^ rk[14];
rk += 8;
}
}
return 0;
}
/**
* Expand the cipher key into the decryption key schedule.
*/
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key) {
u32 *rk;
int i, j, status;
u32 temp;
/* first, start with an encryption schedule */
status = AES_set_encrypt_key(userKey, bits, key);
if (status < 0)
return status;
rk = key->rd_key;
/* invert the order of the round keys: */
for (i = 0, j = 4*(key->rounds); i < j; i += 4, j -= 4) {
temp = rk[i ]; rk[i ] = rk[j ]; rk[j ] = temp;
temp = rk[i + 1]; rk[i + 1] = rk[j + 1]; rk[j + 1] = temp;
temp = rk[i + 2]; rk[i + 2] = rk[j + 2]; rk[j + 2] = temp;
temp = rk[i + 3]; rk[i + 3] = rk[j + 3]; rk[j + 3] = temp;
}
/* apply the inverse MixColumn transform to all round keys but the first and the last: */
for (i = 1; i < (key->rounds); i++) {
rk += 4;
rk[0] =
Td0[Te4[(rk[0] >> 24) ] & 0xff] ^
Td1[Te4[(rk[0] >> 16) & 0xff] & 0xff] ^
Td2[Te4[(rk[0] >> 8) & 0xff] & 0xff] ^
Td3[Te4[(rk[0] ) & 0xff] & 0xff];
rk[1] =
Td0[Te4[(rk[1] >> 24) ] & 0xff] ^
Td1[Te4[(rk[1] >> 16) & 0xff] & 0xff] ^
Td2[Te4[(rk[1] >> 8) & 0xff] & 0xff] ^
Td3[Te4[(rk[1] ) & 0xff] & 0xff];
rk[2] =
Td0[Te4[(rk[2] >> 24) ] & 0xff] ^
Td1[Te4[(rk[2] >> 16) & 0xff] & 0xff] ^
Td2[Te4[(rk[2] >> 8) & 0xff] & 0xff] ^
Td3[Te4[(rk[2] ) & 0xff] & 0xff];
rk[3] =
Td0[Te4[(rk[3] >> 24) ] & 0xff] ^
Td1[Te4[(rk[3] >> 16) & 0xff] & 0xff] ^
Td2[Te4[(rk[3] >> 8) & 0xff] & 0xff] ^
Td3[Te4[(rk[3] ) & 0xff] & 0xff];
}
return 0;
}
#ifndef AES_ASM
/*
* Encrypt a single block
* in and out can overlap
*/
void AES_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key) {
const u32 *rk;
u32 s0, s1, s2, s3, t0, t1, t2, t3;
#ifndef FULL_UNROLL
int r;
#endif /* ?FULL_UNROLL */
assert(in && out && key);
rk = key->rd_key;
/*
* map byte array block to cipher state
* and add initial round key:
*/
s0 = GETU32(in ) ^ rk[0];
s1 = GETU32(in + 4) ^ rk[1];
s2 = GETU32(in + 8) ^ rk[2];
s3 = GETU32(in + 12) ^ rk[3];
#ifdef FULL_UNROLL
/* round 1: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[ 4];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[ 5];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[ 6];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[ 7];
/* round 2: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[ 8];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[ 9];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[10];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[11];
/* round 3: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[12];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[13];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[14];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[15];
/* round 4: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[16];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[17];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[18];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[19];
/* round 5: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[20];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[21];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[22];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[23];
/* round 6: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[24];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[25];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[26];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[27];
/* round 7: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[28];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[29];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[30];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[31];
/* round 8: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[32];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[33];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[34];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[35];
/* round 9: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[36];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[37];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[38];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[39];
if (key->rounds > 10) {
/* round 10: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[40];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[41];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[42];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[43];
/* round 11: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[44];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[45];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[46];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[47];
if (key->rounds > 12) {
/* round 12: */
s0 = Te0[t0 >> 24] ^ Te1[(t1 >> 16) & 0xff] ^ Te2[(t2 >> 8) & 0xff] ^ Te3[t3 & 0xff] ^ rk[48];
s1 = Te0[t1 >> 24] ^ Te1[(t2 >> 16) & 0xff] ^ Te2[(t3 >> 8) & 0xff] ^ Te3[t0 & 0xff] ^ rk[49];
s2 = Te0[t2 >> 24] ^ Te1[(t3 >> 16) & 0xff] ^ Te2[(t0 >> 8) & 0xff] ^ Te3[t1 & 0xff] ^ rk[50];
s3 = Te0[t3 >> 24] ^ Te1[(t0 >> 16) & 0xff] ^ Te2[(t1 >> 8) & 0xff] ^ Te3[t2 & 0xff] ^ rk[51];
/* round 13: */
t0 = Te0[s0 >> 24] ^ Te1[(s1 >> 16) & 0xff] ^ Te2[(s2 >> 8) & 0xff] ^ Te3[s3 & 0xff] ^ rk[52];
t1 = Te0[s1 >> 24] ^ Te1[(s2 >> 16) & 0xff] ^ Te2[(s3 >> 8) & 0xff] ^ Te3[s0 & 0xff] ^ rk[53];
t2 = Te0[s2 >> 24] ^ Te1[(s3 >> 16) & 0xff] ^ Te2[(s0 >> 8) & 0xff] ^ Te3[s1 & 0xff] ^ rk[54];
t3 = Te0[s3 >> 24] ^ Te1[(s0 >> 16) & 0xff] ^ Te2[(s1 >> 8) & 0xff] ^ Te3[s2 & 0xff] ^ rk[55];
}
}
rk += key->rounds << 2;
#else /* !FULL_UNROLL */
/*
* Nr - 1 full rounds:
*/
r = key->rounds >> 1;
for (;;) {
t0 =
Te0[(s0 >> 24) ] ^
Te1[(s1 >> 16) & 0xff] ^
Te2[(s2 >> 8) & 0xff] ^
Te3[(s3 ) & 0xff] ^
rk[4];
t1 =
Te0[(s1 >> 24) ] ^
Te1[(s2 >> 16) & 0xff] ^
Te2[(s3 >> 8) & 0xff] ^
Te3[(s0 ) & 0xff] ^
rk[5];
t2 =
Te0[(s2 >> 24) ] ^
Te1[(s3 >> 16) & 0xff] ^
Te2[(s0 >> 8) & 0xff] ^
Te3[(s1 ) & 0xff] ^
rk[6];
t3 =
Te0[(s3 >> 24) ] ^
Te1[(s0 >> 16) & 0xff] ^
Te2[(s1 >> 8) & 0xff] ^
Te3[(s2 ) & 0xff] ^
rk[7];
rk += 8;
if (--r == 0) {
break;
}
s0 =
Te0[(t0 >> 24) ] ^
Te1[(t1 >> 16) & 0xff] ^
Te2[(t2 >> 8) & 0xff] ^
Te3[(t3 ) & 0xff] ^
rk[0];
s1 =
Te0[(t1 >> 24) ] ^
Te1[(t2 >> 16) & 0xff] ^
Te2[(t3 >> 8) & 0xff] ^
Te3[(t0 ) & 0xff] ^
rk[1];
s2 =
Te0[(t2 >> 24) ] ^
Te1[(t3 >> 16) & 0xff] ^
Te2[(t0 >> 8) & 0xff] ^
Te3[(t1 ) & 0xff] ^
rk[2];
s3 =
Te0[(t3 >> 24) ] ^
Te1[(t0 >> 16) & 0xff] ^
Te2[(t1 >> 8) & 0xff] ^
Te3[(t2 ) & 0xff] ^
rk[3];
}
#endif /* ?FULL_UNROLL */
/*
* apply last round and
* map cipher state to byte array block:
*/
s0 =
(Te4[(t0 >> 24) ] & 0xff000000) ^
(Te4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
(Te4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
(Te4[(t3 ) & 0xff] & 0x000000ff) ^
rk[0];
PUTU32(out , s0);
s1 =
(Te4[(t1 >> 24) ] & 0xff000000) ^
(Te4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
(Te4[(t3 >> 8) & 0xff] & 0x0000ff00) ^
(Te4[(t0 ) & 0xff] & 0x000000ff) ^
rk[1];
PUTU32(out + 4, s1);
s2 =
(Te4[(t2 >> 24) ] & 0xff000000) ^
(Te4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
(Te4[(t0 >> 8) & 0xff] & 0x0000ff00) ^
(Te4[(t1 ) & 0xff] & 0x000000ff) ^
rk[2];
PUTU32(out + 8, s2);
s3 =
(Te4[(t3 >> 24) ] & 0xff000000) ^
(Te4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
(Te4[(t1 >> 8) & 0xff] & 0x0000ff00) ^
(Te4[(t2 ) & 0xff] & 0x000000ff) ^
rk[3];
PUTU32(out + 12, s3);
}
/*
* Decrypt a single block
* in and out can overlap
*/
void AES_decrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key) {
const u32 *rk;
u32 s0, s1, s2, s3, t0, t1, t2, t3;
#ifndef FULL_UNROLL
int r;
#endif /* ?FULL_UNROLL */
assert(in && out && key);
rk = key->rd_key;
/*
* map byte array block to cipher state
* and add initial round key:
*/
s0 = GETU32(in ) ^ rk[0];
s1 = GETU32(in + 4) ^ rk[1];
s2 = GETU32(in + 8) ^ rk[2];
s3 = GETU32(in + 12) ^ rk[3];
#ifdef FULL_UNROLL
/* round 1: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[ 4];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[ 5];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[ 6];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[ 7];
/* round 2: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[ 8];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[ 9];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[10];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[11];
/* round 3: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[12];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[13];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[14];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[15];
/* round 4: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[16];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[17];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[18];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[19];
/* round 5: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[20];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[21];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[22];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[23];
/* round 6: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[24];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[25];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[26];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[27];
/* round 7: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[28];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[29];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[30];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[31];
/* round 8: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[32];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[33];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[34];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[35];
/* round 9: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[36];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[37];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[38];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[39];
if (key->rounds > 10) {
/* round 10: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[40];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[41];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[42];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[43];
/* round 11: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[44];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[45];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[46];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[47];
if (key->rounds > 12) {
/* round 12: */
s0 = Td0[t0 >> 24] ^ Td1[(t3 >> 16) & 0xff] ^ Td2[(t2 >> 8) & 0xff] ^ Td3[t1 & 0xff] ^ rk[48];
s1 = Td0[t1 >> 24] ^ Td1[(t0 >> 16) & 0xff] ^ Td2[(t3 >> 8) & 0xff] ^ Td3[t2 & 0xff] ^ rk[49];
s2 = Td0[t2 >> 24] ^ Td1[(t1 >> 16) & 0xff] ^ Td2[(t0 >> 8) & 0xff] ^ Td3[t3 & 0xff] ^ rk[50];
s3 = Td0[t3 >> 24] ^ Td1[(t2 >> 16) & 0xff] ^ Td2[(t1 >> 8) & 0xff] ^ Td3[t0 & 0xff] ^ rk[51];
/* round 13: */
t0 = Td0[s0 >> 24] ^ Td1[(s3 >> 16) & 0xff] ^ Td2[(s2 >> 8) & 0xff] ^ Td3[s1 & 0xff] ^ rk[52];
t1 = Td0[s1 >> 24] ^ Td1[(s0 >> 16) & 0xff] ^ Td2[(s3 >> 8) & 0xff] ^ Td3[s2 & 0xff] ^ rk[53];
t2 = Td0[s2 >> 24] ^ Td1[(s1 >> 16) & 0xff] ^ Td2[(s0 >> 8) & 0xff] ^ Td3[s3 & 0xff] ^ rk[54];
t3 = Td0[s3 >> 24] ^ Td1[(s2 >> 16) & 0xff] ^ Td2[(s1 >> 8) & 0xff] ^ Td3[s0 & 0xff] ^ rk[55];
}
}
rk += key->rounds << 2;
#else /* !FULL_UNROLL */
/*
* Nr - 1 full rounds:
*/
r = key->rounds >> 1;
for (;;) {
t0 =
Td0[(s0 >> 24) ] ^
Td1[(s3 >> 16) & 0xff] ^
Td2[(s2 >> 8) & 0xff] ^
Td3[(s1 ) & 0xff] ^
rk[4];
t1 =
Td0[(s1 >> 24) ] ^
Td1[(s0 >> 16) & 0xff] ^
Td2[(s3 >> 8) & 0xff] ^
Td3[(s2 ) & 0xff] ^
rk[5];
t2 =
Td0[(s2 >> 24) ] ^
Td1[(s1 >> 16) & 0xff] ^
Td2[(s0 >> 8) & 0xff] ^
Td3[(s3 ) & 0xff] ^
rk[6];
t3 =
Td0[(s3 >> 24) ] ^
Td1[(s2 >> 16) & 0xff] ^
Td2[(s1 >> 8) & 0xff] ^
Td3[(s0 ) & 0xff] ^
rk[7];
rk += 8;
if (--r == 0) {
break;
}
s0 =
Td0[(t0 >> 24) ] ^
Td1[(t3 >> 16) & 0xff] ^
Td2[(t2 >> 8) & 0xff] ^
Td3[(t1 ) & 0xff] ^
rk[0];
s1 =
Td0[(t1 >> 24) ] ^
Td1[(t0 >> 16) & 0xff] ^
Td2[(t3 >> 8) & 0xff] ^
Td3[(t2 ) & 0xff] ^
rk[1];
s2 =
Td0[(t2 >> 24) ] ^
Td1[(t1 >> 16) & 0xff] ^
Td2[(t0 >> 8) & 0xff] ^
Td3[(t3 ) & 0xff] ^
rk[2];
s3 =
Td0[(t3 >> 24) ] ^
Td1[(t2 >> 16) & 0xff] ^
Td2[(t1 >> 8) & 0xff] ^
Td3[(t0 ) & 0xff] ^
rk[3];
}
#endif /* ?FULL_UNROLL */
/*
* apply last round and
* map cipher state to byte array block:
*/
s0 =
(Td4[(t0 >> 24) ] & 0xff000000) ^
(Td4[(t3 >> 16) & 0xff] & 0x00ff0000) ^
(Td4[(t2 >> 8) & 0xff] & 0x0000ff00) ^
(Td4[(t1 ) & 0xff] & 0x000000ff) ^
rk[0];
PUTU32(out , s0);
s1 =
(Td4[(t1 >> 24) ] & 0xff000000) ^
(Td4[(t0 >> 16) & 0xff] & 0x00ff0000) ^
(Td4[(t3 >> 8) & 0xff] & 0x0000ff00) ^
(Td4[(t2 ) & 0xff] & 0x000000ff) ^
rk[1];
PUTU32(out + 4, s1);
s2 =
(Td4[(t2 >> 24) ] & 0xff000000) ^
(Td4[(t1 >> 16) & 0xff] & 0x00ff0000) ^
(Td4[(t0 >> 8) & 0xff] & 0x0000ff00) ^
(Td4[(t3 ) & 0xff] & 0x000000ff) ^
rk[2];
PUTU32(out + 8, s2);
s3 =
(Td4[(t3 >> 24) ] & 0xff000000) ^
(Td4[(t2 >> 16) & 0xff] & 0x00ff0000) ^
(Td4[(t1 >> 8) & 0xff] & 0x0000ff00) ^
(Td4[(t0 ) & 0xff] & 0x000000ff) ^
rk[3];
PUTU32(out + 12, s3);
}
#endif /* AES_ASM */
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, const int enc)
{
unsigned long n;
unsigned long len = length;
unsigned char tmp[AES_BLOCK_SIZE];
assert(in && out && key && ivec);
if (enc) {
while (len >= AES_BLOCK_SIZE) {
for(n=0; n < AES_BLOCK_SIZE; ++n)
tmp[n] = in[n] ^ ivec[n];
AES_encrypt(tmp, out, key);
memcpy(ivec, out, AES_BLOCK_SIZE);
len -= AES_BLOCK_SIZE;
in += AES_BLOCK_SIZE;
out += AES_BLOCK_SIZE;
}
if (len) {
for(n=0; n < len; ++n)
tmp[n] = in[n] ^ ivec[n];
for(n=len; n < AES_BLOCK_SIZE; ++n)
tmp[n] = ivec[n];
AES_encrypt(tmp, tmp, key);
memcpy(out, tmp, AES_BLOCK_SIZE);
memcpy(ivec, tmp, AES_BLOCK_SIZE);
}
} else {
while (len >= AES_BLOCK_SIZE) {
memcpy(tmp, in, AES_BLOCK_SIZE);
AES_decrypt(in, out, key);
for(n=0; n < AES_BLOCK_SIZE; ++n)
out[n] ^= ivec[n];
memcpy(ivec, tmp, AES_BLOCK_SIZE);
len -= AES_BLOCK_SIZE;
in += AES_BLOCK_SIZE;
out += AES_BLOCK_SIZE;
}
if (len) {
memcpy(tmp, in, AES_BLOCK_SIZE);
AES_decrypt(tmp, tmp, key);
for(n=0; n < len; ++n)
out[n] = tmp[n] ^ ivec[n];
memcpy(ivec, tmp, AES_BLOCK_SIZE);
}
}
}
work/aes.h 0000664 0000000 0000000 00000007253 15063477206 007672 0 ustar /*
* aes.h - Header file declaring AES functions.
*/
/*
* This file is Free Software. It has been modified to as part of its
* incorporation into secnet.
*
* Copyright 2000 Vincent Rijmen, Antoon Bosselaers, Paulo Barreto
* Copyright 2004 Fabrice Bellard
* Copyright 2013 Ian Jackson
*
* You may redistribute this file and/or modify it under the terms of
* the permissive licence shown below.
*
* You may redistribute secnet as a whole and/or modify it under the
* terms of the GNU General Public License as published by the Free
* Software Foundation; either version 3, or (at your option) any
* later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, see
* https://www.gnu.org/licenses/gpl.html.
*/
/*
* Copied from the upstream qemu git tree revision
* 55616505876d6683130076b810a27c7889321560
* but was introduced there by Fabrice Bellard in
* e4d4fe3c34cdd6e26f9b9975efec7d1e81ad00b6
* AES crypto support
* git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1036 \
* c046a42c-6fe2-441c-8c8c-71466251a162
*
* Modified by Ian Jackson to change the guard #define from
* QEMU_AES_H to AES_H and to add some needed system #include's.
*
* The header file doesn't appear to have a separate copyright notice
* but is clearly a lightly edited (by Bellard) version of code from
* Rijmen, Bosselaers and Barreto.
*
* The original is from rijndael-alg-fst.c, with this copyright
* notice:
*
* rijndael-alg-fst.c
*
* @version 3.0 (December 2000)
*
* Optimised ANSI C code for the Rijndael cipher (now AES)
*
* @author Vincent Rijmen
* @author Antoon Bosselaers
* @author Paulo Barreto
*
* This code is hereby placed in the public domain.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS
* 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 AUTHORS OR 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.
*
*/
#ifndef AES_H
#define AES_H
#include
#include
#include
#define AES_MAXNR 14
#define AES_BLOCK_SIZE 16
struct aes_key_st {
uint32_t rd_key[4 *(AES_MAXNR + 1)];
int rounds;
};
typedef struct aes_key_st AES_KEY;
int AES_set_encrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key);
int AES_set_decrypt_key(const unsigned char *userKey, const int bits,
AES_KEY *key);
void AES_encrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);
void AES_decrypt(const unsigned char *in, unsigned char *out,
const AES_KEY *key);
void AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
const unsigned long length, const AES_KEY *key,
unsigned char *ivec, const int enc);
#endif /* AES_H */
work/argparseactionnoyes.py 0000664 0000000 0000000 00000002730 15063477206 013376 0 ustar # Python argparse --[no-]foo options
#
# Copyright 2012 "Omnifarious" (a user on StackOverFlow)
# Copyright 2013 "btel" (a user on StackOverFlow)
#
# https://stackoverflow.com/questions/9234258/in-python-argparse-is-it-possible-to-have-paired-no-something-something-arg/20422915#20422915
#
# CC-BY-SA 4.0
# by virtue of
# https://stackoverflow.com/legal/terms-of-service#licensing
# which says everything is CC-BY-SA and has a link to v4.0
# (And which is therefore compatible with secnet's GPLv3+)
#
# all retrieved 4.11.2019
import argparse
class ActionNoYes(argparse.Action):
def __init__(self, option_strings, dest, default=None, required=False, help=None):
if default is None:
raise ValueError('You must provide a default with Yes/No action')
if len(option_strings)!=1:
raise ValueError('Only single argument is allowed with YesNo action')
opt = option_strings[0]
if not opt.startswith('--'):
raise ValueError('Yes/No arguments must be prefixed with --')
opt = opt[2:]
opts = ['--' + opt, '--no-' + opt]
super(ActionNoYes, self).__init__(opts, dest, nargs=0, const=None,
default=default, required=required, help=help)
def __call__(self, parser, namespace, values, option_strings=None):
if option_strings.startswith('--no-'):
setattr(namespace, self.dest, False)
else:
setattr(namespace, self.dest, True)
work/autogen.sh 0000775 0000000 0000000 00000001712 15063477206 010744 0 ustar #!/bin/sh
#
# This file is part of secnet.
# See README for full list of copyright holders.
#
# secnet is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# secnet is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# version 3 along with secnet; if not, see
# https://www.gnu.org/licenses/gpl.html.
set -e
autoconf
autoheader
# ^ although configure will run autoheader if we didn't, our
# objective is for users not to have to have recent autoconf
# installed, so we commit config.h. ./autogen.sh regenerates
# the committed files. work/base91-c/ 0000775 0000000 0000000 00000000000 15063477206 010246 5 ustar work/base91-c/.gitignore 0000664 0000000 0000000 00000000125 15063477206 012234 0 ustar /base91
/lentest
*.o
/test/b91dec
/test/b91enc
/test/lentest
/test/*.dat
/test/*.b91
work/base91-c/AWK/ 0000775 0000000 0000000 00000000000 15063477206 010670 5 ustar work/base91-c/AWK/README 0000664 0000000 0000000 00000001077 15063477206 011555 0 ustar This is a (slow) AWK implementation of the basE91 decoder. It decodes from
standard input to standard output.
Example usage:
awk -f b91dec.awk < file.b91 > file.bin
or
./b91dec.awk < file.b91 > file.bin
Be careful on non-Unix systems! - During output, some ported versions of awk
automatically convert byte values of 0x0A to the native line break sequence of
the host system (e.g. 0x0D 0x0A under DOS/Windows). This can result in corrupt
binary files.
You should test on some examples and compare the output of b91dec.awk with the
original data before relying on it.
work/base91-c/AWK/b91dec.awk 0000775 0000000 0000000 00000001327 15063477206 012451 0 ustar #!/usr/bin/awk -f
# basE91 decoder
# Copyright (c) 2000-2006 Joachim Henke
# http://base91.sourceforge.net/
BEGIN {
b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./:;<=>?@[]^_`{|}~\""
for (i = 0; i < 256; ++i) {
--d[sprintf("%c", i)]
}
for (i = 0; i < 91; ++i) {
d[substr(b, i + 1, 1)] = i
}
b = 0
n = 0
v = -1
}
{
l = length($0)
for (i = 1; i <= l; ++i) {
c = d[substr($0, i, 1)]
if (c < 0) {
continue
}
if (v < 0) {
v = c
} else {
v += c * 91
b += v * 2 ^ n
n += v % 8192 > 88 ? 13 : 14
do {
b -= c = b % 256
printf "%c", c
b /= 256
n -= 8
} while (n > 7)
v = -1
}
}
}
END {
if (v + 1) {
printf "%c", b + v * 2 ^ n
}
}
work/base91-c/DOS-asm/ 0000775 0000000 0000000 00000000000 15063477206 011451 5 ustar work/base91-c/DOS-asm/b91enc.asm 0000664 0000000 0000000 00000006637 15063477206 013250 0 ustar ; basE91 encoder for DOS
;
; Copyright (c) 2005-2006 Joachim Henke
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; - Redistributions of source code must retain the above copyright notice,
; this list of conditions and the following disclaimer.
; - 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.
; - Neither the name of Joachim Henke nor the names of his contributors may
; be used to endorse or promote products derived from this software without
; specific prior written permission.
;
; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
; AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
bits 16
cpu 8086
org 256
xor sp, sp
mov si, ld_0 ; create lookup table
mov bp, 90
lc_0:
mov bx, 90
mov ah, [bp + si]
lc_1:
mov al, [bx + si]
push ax
dec bx
jns lc_1
dec bp
jns lc_0
inc bx
mov sp, a_stck
lc_2:
push bx
push bx
jmp short lc_5
lc_3:
mov ax, [si]
cmp cl, 6 ; bits in queue + 8 < 14?
sbb dx, dx
inc si
mov ch, ah
add bp, dx
sbb dx, dx
xor ch, al
and ah, dl
and ch, dl
sub si, dx
xor ch, al
shl ax, cl
add cl, 8
or bx, ax
test bp, bp
js lc_4
and bh, 0x1F ; keep 13 bits
and dl, 8
and ah, 0x3F
cmp bx, byte 89 ; value in bit queue < 89?
sbb al, al
add dl, cl
and ah, al
mov cl, 13
or bh, ah ; take 13 or 14 bits
sub cl, al
add bx, bx
mov ax, [bx + a_ltab]
mov bx, cx
add cl, 16
sub cl, dl
sub dl, bl
shr bx, cl ; restore bit queue
mov cl, dl
stosw
dec bp
jns lc_3
lc_4:
push bx
mov ah, 0x40
push cx
mov bx, 1
lea cx, [di - a_obuf]
mov dx, a_obuf
int 0x21 ; write to standard output
dec bx
lc_5:
mov ah, 0x3F
mov cx, s_ibuf
mov dx, a_ibuf
int 0x21 ; read from standard input
cld
pop cx
mov si, dx
mov di, a_obuf
pop bx
add bp, ax ; ax = 0 -> EOF
jc lc_3
push ax
test cl, cl
jz lc_6
cmp bx, byte 91 ; value in bit queue < 91?
sbb dx, dx
cmp cl, 8 ; less than 8 bits in queue?
sbb cx, cx
add bx, bx
and cx, dx
mov dx, a_obuf
mov ax, [bx + a_ltab]
inc cx
mov bx, 1
inc cx
stosw
mov ah, 0x40
int 0x21 ; write out 1 or 2 bytes
lc_6:
retn ; exit program
ld_0:
db 'ABCDEFGHIJKLM'
db 'NOPQRSTUVWXYZ'
db 'abcdefghijklm'
db 'nopqrstuvwxyz'
db '0123456789!#$'
db '%&()*+,./:;<='
db '>?@[]^_`{|}~"'
a_stck equ ((lc_2 - $$) + 256) & 510
a_ltab equ 48974
a_obuf equ ((ld_0 - $$) + 257) & 510
s_ibuf equ ((a_ltab - a_obuf - 2) << 4) / 29
a_ibuf equ a_ltab - s_ibuf
work/base91-c/DOS-asm/readme.txt 0000664 0000000 0000000 00000000514 15063477206 013447 0 ustar This is a compact 16-bit assembly implementation of the basE91 encoder for DOS.
It encodes from standard input to standard output. Minimum system requirements:
DOS 2.0, 8086 processor
Example usage:
b91enc < file.bin > file.b91
Assemble with NASM [http://nasm.sourceforge.net/]:
nasm -O2 -o b91enc.com b91enc.asm
work/base91-c/Java/ 0000775 0000000 0000000 00000000000 15063477206 011127 5 ustar work/base91-c/Java/b91cli.java 0000664 0000000 0000000 00000011652 15063477206 013062 0 ustar /*
* basE91 command line front-end
*
* Copyright (c) 2000-2006 Joachim Henke
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - 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.
* - Neither the name of Joachim Henke nor the names of his contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
*/
import java.io.*;
public class b91cli
{
private static void encode(InputStream is, OutputStream os)
{
int s;
byte[] ibuf = new byte[53248];
byte[] obuf = new byte[65536];
basE91 b91 = new basE91();
try {
while ((s = is.read(ibuf)) > 0) {
s = b91.encode(ibuf, s, obuf);
os.write(obuf, 0, s);
}
s = b91.encEnd(obuf);
os.write(obuf, 0, s);
} catch (Exception e) {
System.err.println(e);
}
}
private static void encodeWrap(InputStream is, OutputStream os)
{
int i, s;
int n = 0;
byte[] ibuf = new byte[53248];
byte[] obuf = new byte[65536];
char[] line = new char[76];
basE91 b91 = new basE91();
try {
PrintStream ps = new PrintStream(os, false, "US-ASCII");
while ((s = is.read(ibuf)) > 0) {
s = b91.encode(ibuf, s, obuf);
for (i = 0; i < s; ++i) {
line[n++] = (char) obuf[i];
if (n == 76) {
ps.println(line);
n = 0;
}
}
}
s = b91.encEnd(obuf);
for (i = 0; i < s; ++i) {
line[n++] = (char) obuf[i];
if (n == 76) {
ps.println(line);
n = 0;
}
}
if (n > 0)
ps.println(new String(line, 0, n));
} catch (Exception e) {
System.err.println(e);
}
}
private static void decode(InputStream is, OutputStream os)
{
int s;
byte[] ibuf = new byte[65536];
byte[] obuf = new byte[57344];
basE91 b91 = new basE91();
try {
while ((s = is.read(ibuf)) > 0) {
s = b91.decode(ibuf, s, obuf);
os.write(obuf, 0, s);
}
s = b91.decEnd(obuf);
os.write(obuf, 0, s);
} catch (Exception e) {
System.err.println(e);
}
}
private static void errExit(String msg)
{
System.err.println("syntax error - " + msg + "\nTry `-h' option for more information.");
System.exit(3);
}
public static void main(String[] args)
{
int i;
boolean enc = true;
boolean lbr = true;
String ifn = null;
String ofn = null;
for (i = 0; i < args.length; ++i)
if (args[i].length() == 2 && args[i].charAt(0) == '-')
switch (args[i].charAt(1)) {
case 'd':
enc = false;
break;
case 'u':
lbr = false;
break;
case 'h':
System.out.println("Usage: base91 [OPTION] infile [outfile]\n\n -d\tdecode a basE91 encoded file\n -u\tleave encoder output unformatted (disable line wrapping)\n -h\tdisplay this help and exit\n -V\toutput version information and exit");
return;
case 'V':
System.out.println("base91 0.6.0\nCopyright (c) 2000-2006 Joachim Henke");
return;
default:
errExit("invalid option: " + args[i]);
}
else if (ifn == null)
ifn = args[i];
else if (ofn == null)
ofn = args[i];
else
errExit("too many arguments: " + args[i]);
if (ifn == null)
errExit("file name missing");
if (ofn == null)
if (enc)
ofn = ifn + (lbr ? "_b91.txt" : ".b91");
else {
String lifn = ifn.toLowerCase();
if (ifn.length() > 4 && lifn.endsWith(".b91"))
ofn = ifn.substring(0, ifn.length() - 4);
else if (ifn.length() > 8 && lifn.endsWith("_b91.txt"))
ofn = ifn.substring(0, ifn.length() - 8);
else
ofn = ifn + ".bin";
}
try {
FileInputStream ifs = new FileInputStream(ifn);
FileOutputStream ofs = new FileOutputStream(ofn);
if (enc)
if (lbr)
encodeWrap(ifs, ofs);
else
encode(ifs, ofs);
else
decode(ifs, ofs);
ifs.close();
ofs.close();
} catch (Exception e) {
System.err.println(e);
}
}
}
work/base91-c/Java/basE91.java 0000664 0000000 0000000 00000006341 15063477206 013022 0 ustar /*
* basE91 encoding/decoding routines
*
* Copyright (c) 2000-2006 Joachim Henke
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - 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.
* - Neither the name of Joachim Henke nor the names of his contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
*/
public class basE91
{
private int ebq, en, dbq, dn, dv;
public final byte[] enctab;
private final byte[] dectab;
public int encode(byte[] ib, int n, byte[] ob)
{
int i, c = 0;
for (i = 0; i < n; ++i) {
ebq |= (ib[i] & 255) << en;
en += 8;
if (en > 13) {
int ev = ebq & 8191;
if (ev > 88) {
ebq >>= 13;
en -= 13;
} else {
ev = ebq & 16383;
ebq >>= 14;
en -= 14;
}
ob[c++] = enctab[ev % 91];
ob[c++] = enctab[ev / 91];
}
}
return c;
}
public int encEnd(byte[] ob)
{
int c = 0;
if (en > 0) {
ob[c++] = enctab[ebq % 91];
if (en > 7 || ebq > 90)
ob[c++] = enctab[ebq / 91];
}
encReset();
return c;
}
public void encReset()
{
ebq = 0;
en = 0;
}
public int decode(byte[] ib, int n, byte[] ob)
{
int i, c = 0;
for (i = 0; i < n; ++i) {
if (dectab[ib[i]] == -1)
continue;
if (dv == -1)
dv = dectab[ib[i]];
else {
dv += dectab[ib[i]] * 91;
dbq |= dv << dn;
dn += (dv & 8191) > 88 ? 13 : 14;
do {
ob[c++] = (byte) dbq;
dbq >>= 8;
dn -= 8;
} while (dn > 7);
dv = -1;
}
}
return c;
}
public int decEnd(byte[] ob)
{
int c = 0;
if (dv != -1)
ob[c++] = (byte) (dbq | dv << dn);
decReset();
return c;
}
public void decReset()
{
dbq = 0;
dn = 0;
dv = -1;
}
public basE91()
{
int i;
String ts = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!#$%&()*+,./:;<=>?@[]^_`{|}~\"";
enctab = ts.getBytes();
dectab = new byte[256];
for (i = 0; i < 256; ++i)
dectab[i] = -1;
for (i = 0; i < 91; ++i)
dectab[enctab[i]] = (byte) i;
encReset();
decReset();
}
}
work/base91-c/Java/build_jar.sh 0000775 0000000 0000000 00000000262 15063477206 013421 0 ustar #!/bin/sh
javac -encoding US-ASCII -g:none -source 1.3 -target 1.2 basE91.java b91cli.java && \
jar cvfm base91.jar manifest.mf b91cli.class basE91.class license.txt readme.txt
work/base91-c/Java/license.txt 0000664 0000000 0000000 00000002766 15063477206 013325 0 ustar Copyright (c) 2000-2006 Joachim Henke
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- 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.
- Neither the name of Joachim Henke nor the names of his contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
work/base91-c/Java/manifest.mf 0000664 0000000 0000000 00000000160 15063477206 013256 0 ustar Main-Class: b91cli
Package-Title: basE91 command line tool
Package-Version: 0.6.0
Package-Vendor: Joachim Henke
work/base91-c/Java/readme.txt 0000664 0000000 0000000 00000001431 15063477206 013124 0 ustar This is an implementation of the basE91 encoder and decoder in Java.
Syntax:
java -jar base91.jar [OPTION] infile [outfile]
Options:
-d decode a basE91 encoded file;
all non-alphabet characters (such as newlines) are ignored
-u leave encoder output unformatted;
i. e., disable line wrapping after 76 characters
-h display short help and exit
-V output version information and exit
If no outfile is given for encoding, it defaults to `infile_b91.txt' (or to
`infile.b91' with the `-u' switch).
On decoding, the added file extension is removed to generate the name for
outfile; otherwise, if infile hasn't a default extension, the decoded data is
written to `infile.bin'.
For further information visit the basE91 home page at
http://base91.sourceforge.net/
work/base91-c/LICENSE 0000664 0000000 0000000 00000002735 15063477206 011262 0 ustar Copyright (c) 2000-2006 Joachim Henke
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
- 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.
- Neither the name of Joachim Henke nor the names of his contributors may be
used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
work/base91-c/Makefile 0000664 0000000 0000000 00000001654 15063477206 011714 0 ustar CFLAGS = -Wall -W -O2
LDFLAGS = -s
CC = gcc
INSTALL = install
INSTALL_DATA = $(INSTALL) -m 444
INSTALL_PROGRAM = $(INSTALL) -m 555
prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
mandir = $(prefix)/share/man
man1dir = $(mandir)/man1
manext = .1
BIN = base91 lentest
.PHONY: all install check clean
all: $(BIN)
%.o: %.c
$(CC) $(CFLAGS) -c $<
base91: cli.o base91.o
$(CC) $(LDFLAGS) -o $@ $^
lentest: lentest.o base91.o
install: all
mkdir -p $(DESTDIR)$(bindir)
$(INSTALL_PROGRAM) base91 $(DESTDIR)$(bindir)/base91
ln -sf base91 $(DESTDIR)$(bindir)/b91dec
ln -sf base91 $(DESTDIR)$(bindir)/b91enc
mkdir -p $(DESTDIR)$(man1dir)
$(INSTALL_DATA) base91.1 $(DESTDIR)$(man1dir)/base91$(manext)
ln -sf base91$(manext) $(DESTDIR)$(man1dir)/b91dec$(manext)
ln -sf base91$(manext) $(DESTDIR)$(man1dir)/b91enc$(manext)
check: all
cd test && $(MAKE)
clean:
-rm -f *.o $(BIN) core
cd test && $(MAKE) clean
work/base91-c/NEWS 0000664 0000000 0000000 00000004432 15063477206 010750 0 ustar [0.6.0] 2006-11-01
* basE91 encoding/decoding routines restructured to be thread-safe
* lots of type fixes
* new core utility is `base91', with a behaviour similar to GNU base64
* introduce `-w' switch for wrapping encoded output lines after given length
* long option handling
* use standard I/O functions for better portability
* MinGW compatibility code added
* minor extensions to `make check'
* Java-tool wraps output lines by default; can be avoided with the `-u' switch
* license changed to BSD
[0.5.2] 2006-08-25
* code cleanup
* encoder for DOS rewritten to be faster and compatible down to Intel 8086
[0.5.1] 2005-10-05
* Java-b91enc now handles file extensions case insensitively
* native DOS version of basE91 encoder added
[0.5.0] 2005-06-24
* ATTENTION: this version breaks backward compatibility because the basE91
alphabet was changed to reduce the occurrence of double quotes - sorry, I
should have done this long before
* b91dec is installed as a link to b91enc
* `-e' option added (complement to `-d')
* build system should be more portable now
[0.4.2] 2005-05-16
* AWK basE91 decoder no longer depends on GNU extensions
* Java byte code removed (distributed separately in a jar file)
[0.4.1] 2005-05-07
* some code cleanup
* Java-b91enc can break encoded output to lines of 76 characters (`-b' switch)
[0.4.0] 2005-04-26
* improved encoder behaviour on stream ends (can save one byte sometimes)
* allocate buffer memory dynamically; use overlapping buffers
* new `-m' switch can be used for testing
* verbose mode extended: `-vv' shows memory statistics
* `make check' implemented - runs some basic tests
[0.3.1] 2005-04-19
* b91enc has a verbose mode now (`-v' switch)
* Java-b91enc accepts command line syntax with only one FILE argument again
[0.3.0] 2005-04-17
* the code was restructured to allow a more universal use of the basE91 backend
* version switch changed to `-V' which is more common - sorry for that
* `make install' is possible now
* changed Java-b91enc to be a bit more similar to the C version
* implementation in PHP added
[0.2.3] 2005-04-11
* man page included (thanks to Kei!)
* version (-v) switch added
[0.2.2] 2005-04-10
* fixed a bug in decoder that could result in corrupt output on 64-bit systems
* Java class files included
[0.2.1] 2005-04-09
* first public release
work/base91-c/PHP4/ 0000775 0000000 0000000 00000000000 15063477206 010761 5 ustar work/base91-c/PHP4/README 0000664 0000000 0000000 00000001644 15063477206 011646 0 ustar base91_encode -- Encodes data with basE91
string base91_encode ( string data )
base91_encode() returns data encoded with basE91. This encoding is designed to
make binary data survive transport through transport layers that are not 8-bit
clean, such as mail bodies.
basE91-encoded data takes at most 23% more space than the original data.
Example:
This example will produce:
nX,<:WRT%yV%!5:maref3+1RrUb64^M
-----
base91_decode -- Decodes data encoded with basE91
string base91_decode ( string encoded_data )
base91_decode() decodes encoded_data ignoring non-alphabet characters and
returns the original data. The returned data may be binary.
Example:
This example will produce:
This is an encoded string
work/base91-c/PHP4/base91.php 0000664 0000000 0000000 00000002751 15063477206 012563 0 ustar ', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"'
);
$b91_dectab = array_flip($b91_enctab);
function base91_decode($d)
{
global $b91_dectab;
$l = strlen($d);
$v = -1;
for ($i = 0; $i < $l; ++$i) {
$c = $b91_dectab[$d{$i}];
if (!isset($c))
continue;
if ($v < 0)
$v = $c;
else {
$v += $c * 91;
$b |= $v << $n;
$n += ($v & 8191) > 88 ? 13 : 14;
do {
$o .= chr($b & 255);
$b >>= 8;
$n -= 8;
} while ($n > 7);
$v = -1;
}
}
if ($v + 1)
$o .= chr(($b | $v << $n) & 255);
return $o;
}
function base91_encode($d)
{
global $b91_enctab;
$l = strlen($d);
for ($i = 0; $i < $l; ++$i) {
$b |= ord($d{$i}) << $n;
$n += 8;
if ($n > 13) {
$v = $b & 8191;
if ($v > 88) {
$b >>= 13;
$n -= 13;
} else {
$v = $b & 16383;
$b >>= 14;
$n -= 14;
}
$o .= $b91_enctab[$v % 91] . $b91_enctab[$v / 91];
}
}
if ($n) {
$o .= $b91_enctab[$b % 91];
if ($n > 7 || $b > 90)
$o .= $b91_enctab[$b / 91];
}
return $o;
}
?>
work/base91-c/README 0000664 0000000 0000000 00000004470 15063477206 011133 0 ustar basE91 - converting binary data to ASCII text
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (c) 2000-2006 Joachim Henke
basE91 is an advanced method for encoding binary data as ASCII characters. It
is similar to UUencode or base64, but is more efficient. The overhead produced
by basE91 depends on the input data. It amounts at most to 23% (versus 33% for
base64) and can range down to 14%, which typically occurs on 0-byte blocks.
This makes basE91 very useful for transferring larger files over binary
insecure connections like e-mail or terminal lines.
The current algorithm has been written with portability and simplicity in mind
an is therefore not necessarily optimised for speed.
* Alphabet
As the name suggests, basE91 needs 91 characters to represent the encoded
binary data in ASCII. From the 94 printable ASCII characters (0x21-0x7E), the
following three ones have been omitted to build the basE91 alphabet:
- (dash, 0x2D)
' (apostrophe, 0x27)
\ (backslash, 0x5C)
The translation table is composed of the remaining characters as shown below.
0 A 13 N 26 a 39 n 52 0 65 % 78 >
1 B 14 O 27 b 40 o 53 1 66 & 79 ?
2 C 15 P 28 c 41 p 54 2 67 ( 80 @
3 D 16 Q 29 d 42 q 55 3 68 ) 81 [
4 E 17 R 30 e 43 r 56 4 69 * 82 ]
5 F 18 S 31 f 44 s 57 5 70 + 83 ^
6 G 19 T 32 g 45 t 58 6 71 , 84 _
7 H 20 U 33 h 46 u 59 7 72 . 85 `
8 I 21 V 34 i 47 v 60 8 73 / 86 {
9 J 22 W 35 j 48 w 61 9 74 : 87 |
10 K 23 X 36 k 49 x 62 ! 75 ; 88 }
11 L 24 Y 37 l 50 y 63 # 76 < 89 ~
12 M 25 Z 38 m 51 z 64 $ 77 = 90 "
* Building
1. `cd' to the directory containing the package's source code and type `make'
to compile the package
2. optionally, type `make check' to run any self-tests that come with the
package
3. type `make install' to install the program and documentation in `/usr/local'
(to specify another installation prefix than `/usr/local', type
`make prefix=PATH install' instead)
4. you can remove the program binaries and object files from the source code
directory by typing `make clean'
* Developer
Joachim Henke
* Copying
All source code in this package is released under the terms of the BSD license.
See the file LICENSE for copying permission.
* See also
Please visit the basE91 home page [http://base91.sourceforge.net/] for the
latest version and pre-compiled binaries.
work/base91-c/base91.1 0000664 0000000 0000000 00000003342 15063477206 011416 0 ustar .TH BASE91 1 "November 2006" "base91 0.6.0" basE91
.SH NAME
base91, b91enc, b91dec \- basE91 encode/decode data
.SH SYNOPSIS
.B base91
.RI [ OPTION "]... [" FILE ]
.SH DESCRIPTION
Convert binary data in FILE to plain ASCII text (or vice versa), writing to
standard output. With no FILE, or when FILE is \-, read standard input.
.TP
.BR \-d ", " \-\-decode
decode data (default for
.BR b91dec );
all non\-alphabet characters (such as newlines) are ignored
.TP
.BI "\-m " SIZE
use maximum SIZE bytes of main memory for buffers (default 64K);
SIZE may be followed by a multiplicative suffix:
.I K
1024,
.I M
1024*1024
.TP
.BR \-o ", " \-\-output =\fIFILE\fR
write result to FILE instead of standard output
.TP
.BR \-v ", " \-\-verbose
run in verbose mode and write some statistics to standard error;
use it twice to increase verbosity
.TP
.BR \-w ", " \-\-wrap =\fICOLS\fR
wrap encoded lines after COLS characters (default 76);
use 0 to disable line wrapping (default for
.BR b91enc )
.TP
.B \-\-help
prints out the available program options
.TP
.B \-\-version
output version information and exit
.PP
basE91 is an advanced method for encoding binary data as ASCII characters. It
is similar to UUencode or base64, but is more efficient. The overhead produced
by basE91 depends on the input data. It amounts at most to 23% (versus 33% for
base64) and can range down to 14%, which typically occurs on 0\-byte blocks.
This makes basE91 very useful for transferring larger files over binary
insecure connections like e\-mail or terminal lines.
.SH AUTHOR
Written by Joachim Henke.
.SH "REPORTING BUGS"
Report bugs to .
.SH COPYRIGHT
Copyright (c) 2000\-2006 Joachim Henke
.SH "SEE ALSO"
base64(1), uuencode(1)
http://base91.sourceforge.net/
work/base91-c/base91.c 0000664 0000000 0000000 00000013272 15063477206 011503 0 ustar /*
* basE91 encoding/decoding routines
*
* Copyright (c) 2000-2006 Joachim Henke
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - 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.
* - Neither the name of Joachim Henke nor the names of his contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
*/
#include "base91.h"
const unsigned char enctab[91] = {
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$',
'%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=',
'>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"'
};
const unsigned char dectab[256] = {
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 62, 90, 63, 64, 65, 66, 91, 67, 68, 69, 70, 71, 91, 72, 73,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 74, 75, 76, 77, 78, 79,
80, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 81, 91, 82, 83, 84,
85, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 86, 87, 88, 89, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91
};
void basE91_init(struct basE91 *b)
{
b->queue = 0;
b->nbits = 0;
b->val = -1;
}
size_t basE91_encode(struct basE91 *b, const void *i, size_t len, void *o)
{
const unsigned char *ib = i;
unsigned char *ob = o;
size_t n = 0;
while (len--) {
b->queue |= *ib++ << b->nbits;
b->nbits += 8;
if (b->nbits > 13) { /* enough bits in queue */
unsigned int val = b->queue & 8191;
if (val > 88) {
b->queue >>= 13;
b->nbits -= 13;
} else { /* we can take 14 bits */
val = b->queue & 16383;
b->queue >>= 14;
b->nbits -= 14;
}
ob[n++] = enctab[val % 91];
ob[n++] = enctab[val / 91];
}
}
return n;
}
/* process remaining bits from bit queue; write up to 2 bytes */
size_t basE91_encode_end(struct basE91 *b, void *o)
{
unsigned char *ob = o;
size_t n = 0;
if (b->nbits) {
ob[n++] = enctab[b->queue % 91];
if (b->nbits > 7 || b->queue > 90)
ob[n++] = enctab[b->queue / 91];
}
b->queue = 0;
b->nbits = 0;
b->val = -1;
return n;
}
/* return maximum length that an input of length i could encode to
* (this is a maximum, not a precise figure, because the actual
* size depends on the precise data */
size_t basE91_encode_maxlen(size_t i /* must be < SIZE_T_MAX/8 */)
{
size_t bits = i*8;
size_t pairs = bits / 13;
size_t leftover = bits % 13;
return 2*pairs + (leftover==0 ? 0 : leftover<=6 ? 1 : 2);
}
size_t basE91_decode(struct basE91 *b, const void *i, size_t len, void *o)
{
const unsigned char *ib = i;
unsigned char *ob = o;
size_t n = 0;
unsigned int d;
while (len--) {
d = dectab[*ib++];
if (d == 91)
continue; /* ignore non-alphabet chars */
if (b->val == -1)
b->val = d; /* start next value */
else {
b->val += d * 91;
b->queue |= b->val << b->nbits;
b->nbits += (b->val & 8191) > 88 ? 13 : 14;
do {
ob[n++] = b->queue;
b->queue >>= 8;
b->nbits -= 8;
} while (b->nbits > 7);
b->val = -1; /* mark value complete */
}
}
return n;
}
/* process remaining bits; write at most 1 byte */
size_t basE91_decode_end(struct basE91 *b, void *o)
{
unsigned char *ob = o;
size_t n = 0;
if (b->val != -1)
ob[n++] = b->queue | b->val << b->nbits;
b->queue = 0;
b->nbits = 0;
b->val = -1;
return n;
}
/* return maximum length that an input of length i could decode to
* (this is a maximum, not a precise figure, because the actual
* size depends on the precise data */
size_t basE91_decode_maxlen(size_t i /* must be < SIZE_T_MAX/7 */)
{
size_t pairs = i / 2;
size_t bits = pairs * 14;
size_t bytes = bits / 8;
size_t leftover = i % 2;
return bytes + !!leftover;
}
work/base91-c/base91.h 0000664 0000000 0000000 00000001267 15063477206 011511 0 ustar /*
* Copyright (c) 2000-2006 Joachim Henke
*
* For conditions of distribution and use, see copyright notice in base91.c
*/
#ifndef BASE91_H
#define BASE91_H 1
#include
struct basE91 {
unsigned long queue;
unsigned int nbits;
int val;
};
void basE91_init(struct basE91 *);
size_t basE91_encode(struct basE91 *, const void *, size_t, void *);
size_t basE91_encode_end(struct basE91 *, void *);
size_t basE91_encode_maxlen(size_t /* must be < SIZE_T_MAX/8 */);
size_t basE91_decode(struct basE91 *, const void *, size_t, void *);
size_t basE91_decode_end(struct basE91 *, void *);
size_t basE91_decode_maxlen(size_t /* must be < SIZE_T_MAX/7 */);
#endif /* base91.h */
work/base91-c/cli.c 0000664 0000000 0000000 00000016532 15063477206 011170 0 ustar /*
* basE91 command line front-end
*
* Copyright (c) 2000-2006 Joachim Henke
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - 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.
* - Neither the name of Joachim Henke nor the names of his contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
*/
#include
#include
#include
#ifdef _WIN32
#include
#include
#endif
#include
#include "base91.h"
#define FLG_D 1
#define FLG_V 2
#define FLG_VV 4
static char status[32];
static const char *progname;
static char *ibuf, *obuf;
static size_t ibuf_size, llen;
static struct basE91 b91;
static void stream_b91enc_p(void)
{
size_t itotal = 0;
size_t ototal = 0;
size_t s;
while ((s = fread(ibuf, 1, ibuf_size, stdin)) > 0) {
itotal += s;
s = basE91_encode(&b91, ibuf, s, obuf);
ototal += s;
fwrite(obuf, 1, s, stdout);
}
s = basE91_encode_end(&b91, obuf); /* empty bit queue */
ototal += s;
fwrite(obuf, 1, s, stdout);
sprintf(status, "\t%.2f%%\n", itotal ? (float) ototal / itotal * 100.0 : 1.0);
}
static void stream_b91enc_w(void)
{
size_t l = llen;
size_t ltotal = 0;
size_t i, s;
char x;
while ((s = fread(ibuf, 1, ibuf_size, stdin)) > 0) {
s = basE91_encode(&b91, ibuf, s, obuf);
for (i = 0; l <= s; l += llen) {
x = obuf[l];
obuf[l] = '\0';
puts(obuf + i);
++ltotal;
obuf[l] = x;
i = l;
}
fwrite(obuf + i, 1, s - i, stdout);
l -= s;
}
s = basE91_encode_end(&b91, obuf);
if (s || l < llen) {
obuf[s] = '\0';
if (s > l) {
x = obuf[1];
obuf[1] = '\0';
puts(obuf);
++ltotal;
obuf[0] = x;
}
puts(obuf);
++ltotal;
}
sprintf(status, "\t%lu lines\n", (unsigned long) ltotal);
}
static void stream_b91dec(void)
{
size_t s;
while ((s = fread(ibuf, 1, ibuf_size, stdin)) > 0) {
s = basE91_decode(&b91, ibuf, s, obuf);
fwrite(obuf, 1, s, stdout);
}
s = basE91_decode_end(&b91, obuf); /* empty bit queue */
fwrite(obuf, 1, s, stdout);
sprintf(status, "done\n");
}
static int init_flags(const char *p)
{
size_t l = strlen(p);
if (l > 5) {
progname = p + l - 6;
if (!strcmp(progname, "b91enc"))
return 0;
if (!strcmp(progname, "b91dec"))
return FLG_D;
}
llen = 76;
progname = "base91";
return 0;
}
int main(int argc, char **argv)
{
size_t buf_size = 65536; /* buffer memory defaults to 64 KiB */
int flags = init_flags(*argv);
const char *ifile = "from standard input";
const char *ofile = NULL;
int opt;
struct option longopts[8] = {
{"decode", no_argument, NULL, 'd'},
{"output", required_argument, NULL, 'o'},
{"verbose", no_argument, NULL, 'v'},
{"wrap", required_argument, NULL, 'w'},
{"help", no_argument, NULL, 'h'},
{"version", no_argument, NULL, 'V'},
{NULL, 0, NULL, 0}
};
while ((opt = getopt_long(argc, argv, "dem:o:vw:hV", longopts, NULL)) != -1)
switch (opt) {
case 'd':
flags |= FLG_D;
break;
case 'e':
flags &= ~FLG_D;
break;
case 'm':
{
char *t;
long l = strtol(optarg, &t, 0);
if (t == optarg || strlen(t) > 1 || l < 0) {
fprintf(stderr, "invalid SIZE argument: `%s'\n", optarg);
return EXIT_FAILURE;
}
buf_size = l;
switch (*t | 32) {
case ' ':
case 'b':
break;
case 'k':
buf_size <<= 10;
break;
case 'm':
buf_size <<= 20;
break;
default:
fprintf(stderr, "invalid SIZE suffix: `%s'\n", t);
return EXIT_FAILURE;
}
}
break;
case 'o':
if (strcmp(optarg, "-"))
ofile = optarg;
break;
case 'v':
flags |= (flags & FLG_V) ? FLG_VV : FLG_V;
break;
case 'w':
{
char *t;
long l = strtol(optarg, &t, 0);
if (*t || l < 0) {
fprintf(stderr, "invalid number of columns: `%s'\n", optarg);
return EXIT_FAILURE;
}
llen = l;
}
break;
case 'h':
printf("Usage: %s [OPTION]... [FILE]\n"
"basE91 encode or decode FILE, or standard input, to standard output.\n", progname);
puts("\n -d, --decode\t\tdecode data\n"
" -m SIZE\t\tuse SIZE bytes of memory for buffers (suffixes b, K, M)\n"
" -o, --output=FILE\twrite to FILE instead of standard output\n"
" -v, --verbose\t\tverbose mode\n"
" -w, --wrap=COLS\twrap encoded lines after COLS characters (default 76)\n"
" --help\t\tdisplay this help and exit\n"
" --version\t\toutput version information and exit\n\n"
"With no FILE, or when FILE is -, read standard input.");
return EXIT_SUCCESS;
case 'V':
printf("%s 0.6.0\nCopyright (c) 2000-2006 Joachim Henke\n", progname);
return EXIT_SUCCESS;
default:
fprintf(stderr, "Try `%s --help' for more information.\n", *argv);
return EXIT_FAILURE;
}
if (flags & FLG_D) {
ibuf_size = (buf_size - 1) << 3;
if (ibuf_size < 15) {
fputs("SIZE must be >= 3 for decoding\n", stderr);
return EXIT_FAILURE;
}
ibuf_size /= 15;
} else {
ibuf_size = (buf_size - 2) << 4;
if (ibuf_size < 29) {
fputs("SIZE must be >= 4 for encoding\n", stderr);
return EXIT_FAILURE;
}
ibuf_size /= 29;
}
if (optind < argc && strcmp(argv[optind], "-")) {
ifile = argv[optind];
if (freopen(ifile, "r", stdin) != stdin) {
perror(ifile);
return EXIT_FAILURE;
}
}
if (ofile)
if (freopen(ofile, "w", stdout) != stdout) {
perror(ofile);
return EXIT_FAILURE;
}
if (flags & FLG_VV)
fprintf(stderr, "using %lu bytes for buffers; input buffer: %lu bytes\n", (unsigned long) buf_size, (unsigned long) ibuf_size);
obuf = malloc(buf_size);
if (!obuf) {
fputs("failed to allocate buffer memory\n", stderr);
return EXIT_FAILURE;
}
basE91_init(&b91);
#ifdef _WIN32
_setmode(_fileno(stdin), _O_BINARY);
#endif
if (flags & FLG_D) {
#ifdef _WIN32
_setmode(_fileno(stdout), _O_BINARY);
#endif
ibuf = obuf + 1; /* create overlapping buffers to use memory efficiently */
if (flags & FLG_V)
fprintf(stderr, "decoding %s ...", ifile);
stream_b91dec();
} else {
ibuf = obuf + buf_size - ibuf_size; /* partial overlap */
if (flags & FLG_V)
fprintf(stderr, "encoding %s ...", ifile);
if (llen)
stream_b91enc_w();
else
stream_b91enc_p();
}
free(obuf);
if (flags & FLG_V)
fputs(status, stderr);
return EXIT_SUCCESS;
}
work/base91-c/lentest.c 0000664 0000000 0000000 00000005471 15063477206 012077 0 ustar /*
* basE91 length calculation test
*
* Copyright (c) 2019 Ian Jackson
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* - Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* - 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.
* - Neither the name of Joachim Henke nor the names of his contributors may
* be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
*/
#include
#include
#include
#include "base91.h"
static size_t upto = (14*16 + 14 + 16)*2;
static int do_test(int do_do, int fill, const char *what,
size_t f(struct basE91 *, const void *, size_t, void *),
size_t f_end(struct basE91 *, void *),
size_t f_maxlen(size_t)
)
{
struct basE91 b;
size_t i, o, exp;
int bad = 0;
char ibuf[upto];
char obuf[upto*2+100]; /* in case we have bugs */
memset(ibuf,fill,upto);
if (!do_do) {
printf("%s: skipping\n",what);
return 0;
}
for (i=0; i=2) {
do_encode = !!strchr(argv[1],'e');
do_decode = !!strchr(argv[1],'d');
}
if (argc>=3) {
upto = atoi(argv[2]);
}
#define MAYBE_DO_TEST(ed, fill) \
(bad |= do_test(do_##ed, (fill), #ed, \
basE91_##ed, basE91_##ed##_end, basE91_##ed##_maxlen))
MAYBE_DO_TEST(encode, 0xff);
MAYBE_DO_TEST(decode, 'A');
if (bad) exit(8);
printf("ok\n");
exit(0);
}
work/base91-c/test/ 0000775 0000000 0000000 00000000000 15063477206 011225 5 ustar work/base91-c/test/Makefile 0000664 0000000 0000000 00000000252 15063477206 012664 0 ustar SHELL = /bin/sh
.PHONY: all clean
all:
ln -sf ../base91 b91enc
ln -sf ../base91 b91dec
ln -sf ../lentest .
$(SHELL) test.sh
clean:
-rm -f b91??c *.b91 *.dat core
work/base91-c/test/test.sh 0000664 0000000 0000000 00000010351 15063477206 012540 0 ustar fail_exit()
{
echo 'FAILED!'
exit 1
}
T='--------------------------------------+'
./b91enc --version || fail_exit
echo -n '
extracting test files...'
echo '?/9f4iG0)z4jY;<$:B$AvWAAoB:CgALvDCeR+t bit0.dat && \
echo '?/9f4iG0)z4jZgv|?AUYRAgA%AAAUA:y5L9LcoHE8HJI_yGIJ>T' | ./b91dec | bunzip2 > bit1.dat && \
echo '71kS$5F/VZC0+Zw,c%df~>T1XkEvl{weS1NQ@@3Gd*`P2p~)^4>yP{Y9MFo.Q2=Mmsk:"lhR%87Ey_GRP
7hn_L73QVn>5CK0{6eHmBBtzP05[`PG3*"+n(bE$S";_b^gU5D87O,QjqW3wVc(_T8_:O{8P$9~{n7"SiU;Ca{w_;HB6L&u2W8M>ScI
aP#E.:novN/#Mk$STQeM^dSp5~JKkb3[t5_*3q&V/Z7aVdFPJ#P&TR3#`W+;&GpWk9CHq%R|fV~(K:g6_Du~m
j7S?;hnI$xFkGTDRJSJ#NNu_;(]ud#f3{1Q|;jH4l{Ql^mi]*jH>mCqmSW,Bx4^MBrnOtoa4gbM7m3S:OMQ4nt.un+)Zelc,Eoa|c!yN"3dV3b9YY2opW=
VS&}g7RI#0g?^mT#@#;Q%kmT2gGX8.*H;^Dywb$(o(t;/_#j8Vi*djlobF!Xw)B2lLV_sio/`z1zu^+^m9D~At(UH|,6o=j6kT(=Cz8q6(FBOm~&+F*,IgYH;XtV+,ejB".y`K9!2VxGi?YeQs+q9Ses]Qt
RzDX;Oyx]$Tcm;[GT4Auh}yN+%:}Q_xv5_B[/q30b!qFIn>w{^w`Qa99`=r0eo&uZFyq*`
dg.h"YJiW)t5BaO;?liP7Y|)o|]9KwM`rZO1p#}zYnX|.C(+P.RXy>T0XG^58"DO8Su/5MElg)J>eU,BjzB5}et|m+4>$GdR<(_[PUxc^o|c2L{w~mE@SZ.FH
;(=m1zJIMyYbz8z0=gf*;)WDk:3@7^YN&i1|MVarqV)qe]x9kJ)OPi&F``3?|P:(Fg$1(P2{xf0yf$WBU!.YmwYIT
F)^pdagK0(P~/96zGoD,QZlX]"`h/U`^ZWZeJ.c:XQ!WAz(Z|&2/E3)*V?vAb>?MUV5*T8i3u)apx`5<8J`bopXm>
*J,^8m.Ldfyj~KR#mt*&Z3a]N9WUT+^c2*@07TM:ATg(D)YMiSR[RTll_7DB3.HhUzKL:N0.:%J,<(_$0Ab{``OaN
43R:29/1$KXzs2%58B]G,h*r$Z/PqQqwh*sY.o(;Kkqw`1N^;JFk!;^?V+6/7irU+h._wN},b?.O.8t#:prfx9ZEE
t2AWg56N]g6MF0Bs7X^07[RwvgwxT@4RLk#SXzXj74XT93xa=$c0Sgi6z{apd:[5sDmwG;&jKSGGR.=c9qS$u[S:y
wM|buns:@)g|V@|QGD9wipn#u*HCFK7W}iD}f|E{h@PR@2+m%nN>u+"+>x&3iF+0`2GE03Gg;K`[.E[X4Swjchxf6
LusH!p1)[}$SyFI"w|fztPfp*<~6Bu&1(.0XH68BX?a9mFcGoT>~qd7qtf)+v.o9(IAL7|jz32K"9d1Nh*1},xKnvFBHnD&1fv9+h,+nww+PRv7I2wU)B`nty%~eJ2OvRIa^k@T2
*Y:8fa@pLgwFy,[Ea$di~YWC]4)j&3=B0nZn())A|p,70Y02g3ArYWjs+U' | ./b91enc -do rnd0.dat && \
./b91enc --decode -o rnd1.dat rnd0.dat && echo ' OK' || fail_exit
echo "
basE91 encode files:
+-- best case --$T"
./b91enc -m 5k -vv --output=bit0.b91 bit0.dat
echo "+-- worst case -$T"
./b91enc -m 3k -vv --output=bit1.b91 bit1.dat
echo "+-- random data $T"
./b91enc -m 96 -vv --output=rnd0.b91 rnd0.dat
./b91enc -m 72 -vv --output=rnd1.b91 rnd1.dat
echo '
comparing check sums...'
cksum rnd?.dat *.b91 | while read C S F
do
echo -n "$F "
case $F in
rnd0.dat) V='15559944992141';;
rnd1.dat) V='3514104192626';;
bit0.b91) V='33531953171198370';;
bit1.b91) V='5394938771290552';;
rnd0.b91) V='32051515602633';;
rnd1.b91) V='2018291165770';;
esac
test $V = "$C$S" && echo OK || exit 1
done || fail_exit
echo "
basE91 decode and compare:
+-- best case --$T"
fold -w 83 bit0.b91 | ./b91dec -vvm 2K | cmp bit0.dat && echo PASSED || fail_exit
echo "+-- worst case -$T"
fold -w 79 bit1.b91 | ./b91dec -vvm 1K | cmp bit1.dat && echo PASSED || fail_exit
echo "+-- random data $T"
fold -w 73 rnd0.b91 | ./b91dec -vvm 89 | cmp rnd0.dat && echo PASSED || fail_exit
fold -w 71 rnd1.b91 | ./b91dec -vvm 73 | cmp rnd1.dat && echo PASSED || fail_exit
echo "
maxlength tests:"
./lentest && echo PASSED || fail_exit
echo '
================
all tests passed
================
'
work/base91-python/ 0000775 0000000 0000000 00000000000 15063477206 011345 5 ustar work/base91-python/.gitignore 0000664 0000000 0000000 00000000350 15063477206 013333 0 ustar *.py[co]
# Packages
*.egg
*.egg-info
dist
build
eggs
parts
bin
var
sdist
develop-eggs
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
work/base91-python/README.md 0000664 0000000 0000000 00000000601 15063477206 012621 0 ustar base91-python
=============
A python implementation of Base91 as described on http://base91.sourceforge.net/ , licenced under the New BSD License.
Usage
-----
import base91
base91.encode('test') #result: 'fPNKd'
base91.encode(b'\xfe\x03\x00W\xa9\xbc') #result: 'VLv(GdNE'
base91.decode('8D9Kc)=/2$WzeFui#G9Km+<{VT2u9MZil}[A') # result: 'May a moody baby doom a yam?\n'
work/base91-python/base91/ 0000775 0000000 0000000 00000000000 15063477206 012431 5 ustar work/base91-python/base91/__init__.py 0000664 0000000 0000000 00000007141 15063477206 014545 0 ustar # Base91 encode/decode for Python 2 and Python 3
#
# Copyright (c) 2012 Adrien Beraud
# Copyright (c) 2015 Guillaume Jacquenot
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * 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.
# * Neither the name of Adrien Beraud, Wisdom Vibes Pte. Ltd., nor the names
# of its contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS 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 COPYRIGHT OWNER OR 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.
#
import struct
base91_alphabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$',
'%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=',
'>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"']
decode_table = dict((v, k) for k, v in enumerate(base91_alphabet))
def decode(encoded_str):
''' Decode Base91 string to a bytearray '''
v = -1
b = 0
n = 0
out = bytearray()
for strletter in encoded_str:
if not strletter in decode_table:
continue
c = decode_table[strletter]
if (v < 0):
v = c
else:
v += c * 91
b |= v << n
n += 13 if (v & 8191) > 88 else 14
while True:
out += struct.pack('B', b & 255)
b >>= 8
n -= 8
if not n > 7:
break
v = -1
if v + 1:
out += struct.pack('B', (b | v << n) & 255)
return out
def encode(bindata):
''' Encode a bytearray to a Base91 string '''
b = 0
n = 0
out = ''
for count in range(len(bindata)):
byte = bindata[count:count + 1]
b |= struct.unpack('B', byte)[0] << n
n += 8
if n > 13:
v = b & 8191
if v > 88:
b >>= 13
n -= 13
else:
v = b & 16383
b >>= 14
n -= 14
out += base91_alphabet[v % 91] + base91_alphabet[v // 91]
if n:
out += base91_alphabet[b % 91]
if n > 7 or b > 90:
out += base91_alphabet[b // 91]
return out
work/base91-python/setup.py 0000664 0000000 0000000 00000000404 15063477206 013055 0 ustar from setuptools import setup
setup(
name='base91',
version='1.0.1',
packages=['base91'],
url='https://github.com/SunDwarf/base91-python',
license='New BSD',
author='',
author_email='',
description='Base91 encoding in Python'
)
work/base91.py 0000777 0000000 0000000 00000000000 15063477206 016173 2base91-python/base91/__init__.py ustar work/base91s/ 0000775 0000000 0000000 00000000000 15063477206 010211 5 ustar work/base91s/Dir.sd.mk 0000664 0000000 0000000 00000000723 15063477206 011667 0 ustar
&TARGETS += & base91s base91.o
&OBJECTS += & base91.o cli.o
&CFILES += & base91.c base91.h cli.c
&CLEAN += $(&CFILES)
&base91.c: &^base91.c.patch
$(&CFILES): &/%: &~/base91-c/% &/Dir.mk
perl -pe <$< >$@.tmp \
'next if m{^\#include}; s/basE91/base91s/g; s/base91\b/base91s/g'
patch <$(or $(filter %.patch,$^),/dev/null) $@.tmp
mv -f $@.tmp $@
$(&OBJECTS): &base91.h
&:local+global &LDFLAGS &LDLIBS
&base91s: $(&OBJECTS)
$(CC) -o$@ $(&LDFLAGS) $^ $(&LDLIBS)
work/base91s/base91.c.patch 0000664 0000000 0000000 00000001730 15063477206 012540 0 ustar diff --git a/base91.c b/base91.c
index 3d9d7ea..7a5958a 100644
--- a/base91.c
+++ b/base91.c
@@ -38,12 +38,12 @@ const unsigned char enctab[91] = {
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '!', '#', '$',
'%', '&', '(', ')', '*', '+', ',', '.', '/', ':', ';', '<', '=',
- '>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '"'
+ '>', '?', '@', '[', ']', '^', '_', '`', '{', '|', '}', '~', '-'
};
const unsigned char dectab[256] = {
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91,
- 91, 62, 90, 63, 64, 65, 66, 91, 67, 68, 69, 70, 71, 91, 72, 73,
+ 91, 62, 91, 63, 64, 65, 66, 91, 67, 68, 69, 70, 71, 90, 72, 73,
52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 74, 75, 76, 77, 78, 79,
80, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 81, 91, 82, 83, 84,
work/comm-common.c 0000664 0000000 0000000 00000004213 15063477206 011327 0 ustar /*
* This file is part of secnet.
* See README for full list of copyright holders.
*
* secnet is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* secnet is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with secnet; if not, see
* https://www.gnu.org/licenses/gpl.html.
*/
#include "secnet.h"
#include "comm-common.h"
struct comm_clientinfo *comm_clientinfo_ignore(void *state, dict_t *dict,
struct cloc cloc)
{
return 0;
}
void comm_request_notify(void *commst, void *nst, comm_notify_fn *fn)
{
struct commcommon *st=commst;
struct comm_notify_entry *n;
NEW(n);
n->fn=fn;
n->state=nst;
LIST_INSERT_HEAD(&st->notify, n, entry);
}
void comm_release_notify(void *commst, void *nst, comm_notify_fn *fn)
{
struct commcommon *st=commst;
struct comm_notify_entry *n, *t;
/* XXX untested */
LIST_FOREACH_SAFE(n, &st->notify, entry, t) {
if (n->state==nst && n->fn==fn) {
LIST_REMOVE(n, entry);
free(n);
}
}
}
bool_t comm_notify(struct commcommon *cc,
struct buffer_if *buf, const struct comm_addr *ca)
{
struct comm_notify_list *notify = &cc->notify;
struct comm_notify_entry *n;
priomsg_reset(&cc->why_unwanted);
LIST_FOREACH(n, notify, entry) {
if (n->fn(n->state, buf, ca, &cc->why_unwanted)) {
return True;
}
}
return False;
}
void comm_apply(struct commcommon *cc, void *st)
{
assert(cc==st);
cc->cl.type=CL_COMM;
cc->cl.apply=NULL;
cc->cl.interface=&cc->ops;
cc->ops.st=cc;
cc->ops.request_notify=comm_request_notify;
cc->ops.release_notify=comm_release_notify;
LIST_INIT(&cc->notify);
cc->rbuf=NULL;
priomsg_new(&cc->why_unwanted, MAX_NAK_MSG);
}
work/comm-common.h 0000664 0000000 0000000 00000011703 15063477206 011336 0 ustar /*
* This file is part of secnet.
* See README for full list of copyright holders.
*
* secnet is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* secnet is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with secnet; if not, see
* https://www.gnu.org/licenses/gpl.html.
*/
#ifndef COMM_COMMON_H
#define COMM_COMMON_H
#include "secnet.h"
#include "util.h"
/*----- for all comms -----*/
struct comm_notify_entry {
comm_notify_fn *fn;
void *state;
LIST_ENTRY(comm_notify_entry) entry;
};
LIST_HEAD(comm_notify_list, comm_notify_entry);
struct commcommon { /* must be first so that void* is comm_common* */
closure_t cl;
struct comm_if ops;
struct cloc loc;
struct comm_notify_list notify;
struct buffer_if *rbuf;
struct priomsg why_unwanted;
};
struct comm_clientinfo *comm_clientinfo_ignore(void *state, dict_t*,
struct cloc cloc);
void comm_request_notify(void *commst, void *nst, comm_notify_fn *fn);
void comm_release_notify(void *commst, void *nst, comm_notify_fn *fn);
bool_t comm_notify(struct commcommon*, struct buffer_if *buf,
const struct comm_addr *ca);
/* Either: returns True, with message delivered and buffer freed.
* Or: False, if no-one wanted it - buffer still allocd'd;
* in that case, cc->why_unwanted has info
* Ie, roughly like comm_notify_fn. */
void comm_apply(struct commcommon *cc, void *st);
#define COMM_APPLY(st,cc,prefix,desc,loc) \
NEW(st); \
(cc)->loc=loc; \
(cc)->cl.description=desc; \
(cc)->ops.clientinfo=comm_clientinfo_ignore; \
(cc)->ops.sendmsg=prefix##sendmsg; \
(cc)->ops.addr_to_string=prefix##addr_to_string; \
comm_apply((cc),(st))
/* void COMM_APPLY(SOMETHING *st, struct commcommon *FUNCTIONOF(st),
* prefix, "DESC", struct cloc loc);
* // Expects in scope: prefix##sendmsg, prefix##addr_to_string.
*/
#define COMM_APPLY_STANDARD(st,cc,desc,args) \
item_t *item=list_elem(args,0); \
if (!item || item->type!=t_dict) { \
cfgfatal((cc)->loc,desc,"first argument must be a dictionary\n"); \
} \
dict_t *d=item->data.dict; \
(cc)->rbuf=find_cl_if(d,"buffer",CL_BUFFER,True,desc,(cc)->loc)
/* void COMM_APPLY_STANDARD(SOMETHING *st, struct commcommon *cc,
* const char *desc, list_t *args);
* // Declares:
* // item_t *item = ;
* // dict_t *dict = ;
*/
/*----- for udp-based comms -----*/
#define UDP_MAX_SOCKETS 3 /* 2 ought to do really */
#define MAX_AF MAX_RAW(AF_INET6,AF_INET)
struct udpsock {
union iaddr addr;
int fd;
bool_t experienced[/*0=recv,1=send*/2][MAX_AF+1][/*success?*/2];
};
struct udpsocks {
int n_socks;
struct udpsock socks[UDP_MAX_SOCKETS];
/* private for udp_socks_* */
struct udpcommon *uc; /* link to parent, for cfg, notify list, etc. */
struct poll_interest *interest;
const char *desc;
};
struct udpcommon {
struct commcommon cc;
int port;
string_t authbind;
bool_t use_proxy;
union iaddr proxy;
};
bool_t udp_make_socket(struct udpcommon *uc, struct udpsock *us,
int failmsgclass);
/* Caller should have filled in ->addr. Fills in us->fd,
->experienced; updates ->addr. Logs any errors with lg_[v]perror. */
bool_t udp_import_socket(struct udpcommon *uc, struct udpsock *us,
int failmsgclass, int fd);
/* Like udp_make_socket, but caller provides fd. fd is not closed
on error */
void udp_destroy_socket(struct udpcommon *uc, struct udpsock *us);
/* Idempotent. No errors are possible. */
const char *af_name(int af);
void udp_sock_experienced(struct log_if *lg, struct udpcommon *uc,
struct udpsocks *socks, struct udpsock *us,
const union iaddr *dest, int af /* 0 means any */,
int r, int errnoval);
void udp_socks_register(struct udpcommon *uc, struct udpsocks *socks,
const char *desc);
void udp_socks_deregister(struct udpcommon *uc, struct udpsocks *socks);
void udp_socks_childpersist(struct udpcommon *uc, struct udpsocks *socks);
#define UDP_APPLY_STANDARD(st,uc,desc) \
(uc)->use_proxy=False; \
(uc)->authbind=dict_read_string(d,"authbind",False,"udp",(uc)->cc.loc); \
(uc)->port=dict_read_number(d,"port",False,"udp",(uc)->cc.loc,0)
/* void UDP_APPLY_STANDARD(SOMETHING *st, struct udpcommon *uc,
* const char *desc);
* // Expects in scope: dict_t *d=...; as from COMM_APPLY_STANDARD
*/
#endif /*COMM_COMMON_H*/
work/common.make.in 0000664 0000000 0000000 00000002360 15063477206 011477 0 ustar # common makefile settings for secnet
#
# This file is part of secnet.
# See README for full list of copyright holders.
#
# secnet is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# secnet is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# version 3 along with secnet; if not, see
# https://www.gnu.org/licenses/gpl.html.
@SET_MAKE@
topbuilddir:=@abs_top_builddir@
src:=@top_srcdir@
SHELL:=/bin/sh
CC:=@CC@
CFLAGS:=-Wall @WRITESTRINGS@ @CFLAGS@ -Werror \
-W -Wno-unused -Wno-unused-parameter \
-Wno-pointer-sign -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs -Wredundant-decls \
-Wpointer-arith -Wformat=2 -Winit-self \
-Wswitch-enum -Wunused-variable -Wunused-function -Wbad-function-cast \
-Wno-strict-aliasing -fno-strict-aliasing \
-Wno-bool-operation -Wno-stringop-truncation
work/comprehensive-test 0000775 0000000 0000000 00000003236 15063477206 012520 0 ustar #!/bin/bash
# This file is part of secnet.
# See LICENCE and this file CREDITS for full list of copyright holders.
# SPDX-License-Identifier: GPL-3.0-or-later
# There is NO WARRANTY.
set -e
set -o pipefail
oot_rel=oot-rel.tmp~
oot_abs=$(cd .. && pwd)/oot-comprehensive-test.tmp~
nproc=$(nproc || echo 1)
mflags=-j$nproc
for arg in "$@"; do
case "$arg" in
--oot-abs=*) oot_abs=${arg%*=} ;;
*) echo >&2 "unknown arg/option $1"; exit 1;;
esac
done
case "${OLD_SECNET_DIR-:?must be set, perhaps to the empty string}" in
''|/*)
;;
../*)
OLD_SECNET_DIR="${PWD%/*}/${OLD_SECNET_DIR#../}"
echo >&2 "x OLD_SECNET_DIR=$OLD_SECNET_DIR"
;;
*)
echo >&2 "relative non-.. OLD_SECNET_DIR $OLD_SECNET_DIR !";
exit 1
;;
esac
x () { echo >&2 "x $*"; "$@"; }
srcdir=$(pwd)
build_and_test () {
cd "$srcdir"
x git clean -xdff
if [ "x$1" != x. ]; then
rm -rf "$1"
mkdir "$1"
fi
x ./autogen.sh
x cd "$1"
x "$srcdir/configure" CFLAGS='-O0 -g'
x make $mflags all check
for t in mtest/check stest/check; do
x make $mflags clean
x make $mflags $t
done
x make $mflags clean
if [ "x$1" != x. ]; then
find -type f
else
git-ls-files -o
fi | perl -ne '
s{^\./}{};
s{^}{/};
next if m{^/ct-files$};
next if m{^/autom4te\.cache/};
next if m{/Makefile$};
next if m{\.mk$};
next if m{^/common\.make$};
next if m{^/(?:config|\.makefiles)\.stamp$};
next if m{^/config\.(?:log|status|h)$};
warn "clean in '"$1"' missed $_";
$bad=1;
END { exit $bad; }
'
cd "$srcdir"
}
build_and_test .
build_and_test "$oot_rel"
build_and_test "$oot_abs"
echo "----- $0 ok -----"
work/conffile.c 0000664 0000000 0000000 00000047005 15063477206 010701 0 ustar /* conffile.c - process the configuration file */
/*
* This file is part of secnet.
* See README for full list of copyright holders.
*
* secnet is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* secnet is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with secnet; if not, see
* https://www.gnu.org/licenses/gpl.html.
*/
/* #define DUMP_PARSE_TREE */
#include "secnet.h"
#include
#include
#include
#include
#include "conffile.h"
#include "conffile_internal.h"
#include "conffile.yy.h"
#include "util.h"
#include "ipaddr.h"
static struct cloc no_loc={"none",0};
struct atomlist {
struct atomlist *next;
atom_t a;
};
struct entry {
struct entry *next;
atom_t key;
list_t *val;
};
struct searchlist {
struct dict *d;
struct searchlist *next;
};
struct dict {
struct dict *parent;
struct searchlist *search;
struct entry *entries;
int32_t size;
};
static struct atomlist *atoms=NULL;
static void process_alist(dict_t *context, struct p_node *c);
static list_t *process_invocation(dict_t *context, struct p_node *i);
static list_t *dict_ilookup_primitive(dict_t *dict, atom_t key)
{
struct entry *i;
for (i=dict->entries; i; i=i->next) {
if (key==i->key) return i->val;
}
return NULL;
}
static list_t *dict_ilookup(dict_t *dict, atom_t key)
{
dict_t *d;
list_t *v;
v=dict_ilookup_primitive(dict, key);
if (v) return v;
/* Check dictionaries in search path */
/* XXX */
/* Check lexical parents */
for (d=dict; d; d=d->parent) {
v=dict_ilookup_primitive(d, key);
if (v) return v;
}
return NULL;
}
static void dict_iadd(dict_t *dict, atom_t key, list_t *val)
{
struct entry *e;
if (dict_ilookup_primitive(dict, key)) {
fatal("duplicate key \"%s\" in dictionary",key);
}
NEW(e);
e->next=dict->entries;
e->key=key;
e->val=val;
dict->entries=e;
dict->size++;
}
/***** Functions beyond this point are private to the config system *****/
static dict_t *dict_new(dict_t *parent)
{
dict_t *d;
NEW(d);
d->parent=parent;
d->search=NULL;
d->entries=NULL;
d->size=0;
return d;
}
static struct p_node *node_copy(struct p_node *n)
{
struct p_node *r;
NEW(r);
*r=*n;
return r;
}
static struct p_node *list_reverse(struct p_node *list)
{
struct p_node *rl=NULL, *i, *n;
for (i=list; i; i=i->r) {
n=node_copy(i);
n->r=rl;
rl=n;
}
return rl;
}
/* Since we use left-recursion in the parser for efficiency, sequences
end up "backwards" in the parse tree. Rather than have complicated
code for, eg. processing assignments in the right order, we reverse
these sequences here. */
static void ptree_mangle(struct p_node *t)
{
if (!t) return;
ptree_mangle(t->l);
ptree_mangle(t->r);
switch (t->type) {
case T_DICT:
ASSERT(!t->l || t->l->type==T_ALIST);
ASSERT(!t->r || t->r->type==T_LISTITEM);
t->l=list_reverse(t->l);
t->r=list_reverse(t->r);
break;
case T_ASSIGNMENT:
ASSERT(t->l->type==T_KEY);
ASSERT(t->r->type==T_LISTITEM);
t->r=list_reverse(t->r);
break;
case T_ABSPATH:
case T_RELPATH:
ASSERT(t->l==NULL);
ASSERT(t->r->type==T_PATHELEM);
t->r=list_reverse(t->r);
break;
case T_EXEC:
ASSERT(t->l);
ASSERT(t->r==NULL || t->r->type==T_LISTITEM);
t->r=list_reverse(t->r);
break;
}
}
#ifdef DUMP_PARSE_TREE
/* Convert a node type to a string, for parse tree dump */
static const char *ntype(uint32_t type)
{
switch(type) {
case T_STRING: return "T_STRING";
case T_NUMBER: return "T_NUMBER";
case T_KEY: return "T_KEY";
case T_ASSIGNMENT: return "T_ASSIGNMENT";
case T_LISTITEM: return "T_LISTITEM";
case T_EXEC: return "T_EXEC";
case T_PATHELEM: return "T_PATHELEM";
case T_ABSPATH: return "T_ABSPATH";
case T_RELPATH: return "T_RELPATH";
case T_DICT: return "T_DICT";
case T_ALIST: return "T_ALIST";
case T_ERROR: return "T_ERROR";
}
return "**unknown**";
}
static void ptree_indent(int amount)
{
int i;
for (i=0; itype)) {
switch(n->type) {
case T_STRING: printf("T_STRING: \"%s\" (%s line %d)\n",
n->data.string,n->loc.file,n->loc.line); break;
case T_NUMBER: printf("T_NUMBER: %d (%s line %d)\n",
n->data.number, n->loc.file,n->loc.line); break;
case T_KEY: printf("T_KEY: %s (%s line %d)\n",
n->data.key, n->loc.file,n->loc.line); break;
default: printf("**unknown primitive type**\n"); break;
}
} else {
assert(d<10000);
printf("%s: (%s line %d)\n",ntype(n->type),n->loc.file,n->loc.line);
ptree_indent(d);
printf(" |-"); ptree_dump(n->l, d+1);
ptree_indent(d);
printf(" +-"); ptree_dump(n->r, d+1);
}
}
#endif /* DUMP_PARSE_TREE */
static dict_t *dict_find_root(dict_t *d)
{
dict_t *i;
for (i=d; i->parent; i=i->parent);
return i;
}
static list_t *dict_lookup_path(dict_t *context, struct p_node *p)
{
dict_t *i;
list_t *l;
ASSERT(p->type==T_PATHELEM);
ASSERT(p->l->type==T_KEY);
l=dict_ilookup(context, p->l->data.key);
if (!l) {
cfgfatal(p->loc,"conffile","can't find key %s\n",
p->l->data.key);
}
while (p->r) {
if (l->item->type != t_dict) {
cfgfatal(p->loc,"conffile","path element \"%s\" "
"is not a dictionary\n",p->l->data.key);
}
i=l->item->data.dict; /* First thing in list */
p=p->r;
l=dict_ilookup_primitive(i, p->l->data.key);
if (!l) {
cfgfatal(p->loc,"conffile","can't find key %s\n",
p->l->data.key);
}
}
return l;
}
static item_t *new_item(enum types type, struct cloc loc)
{
item_t *i;
NEW(i);
i->type=type;
i->loc=loc;
return i;
}
static list_t *process_item(dict_t *context, struct p_node *i)
{
item_t *item=NULL;
switch (i->type) {
case T_STRING:
item=new_item(t_string, i->loc);
item->data.string=i->data.string; /* XXX maybe strcpy */
break;
case T_NUMBER:
item=new_item(t_number, i->loc);
item->data.number=i->data.number;
break;
case T_ABSPATH:
context=dict_find_root(context);
/* falls through */
case T_RELPATH:
return dict_lookup_path(context, i->r);
/* returns immediately */
break;
case T_DICT:
item=new_item(t_dict, i->loc);
item->data.dict=dict_new(context);
/* XXX dict_add_searchpath(context,process_ilist(context, i->r)); */
process_alist(item->data.dict, i->l);
break;
case T_EXEC:
return process_invocation(context, i);
/* returns immediately */
break;
default:
#ifdef DUMP_PARSE_TREE
ptree_dump(i,0);
fatal("process_item: invalid node type for a list item (%s)",
ntype(i->type));
#else
fatal("process_item: list item has invalid node type %d - recompile "
"with DUMP_PARSE_TREE defined in conffile.c for more "
"detailed debug output",i->type);
#endif /* DUMP_PARSE_TREE */
break;
}
return list_append(NULL,item);
}
static list_t *process_ilist(dict_t *context, struct p_node *l)
{
struct p_node *i;
list_t *r;
ASSERT(!l || l->type==T_LISTITEM);
r=list_new();
for (i=l; i; i=i->r) {
r=list_append_list(r,process_item(context,i->l));
}
return r;
}
static list_t *process_invocation(dict_t *context, struct p_node *i)
{
list_t *cll;
item_t *cl;
list_t *args;
ASSERT(i->type==T_EXEC);
ASSERT(i->r==NULL || i->r->type==T_LISTITEM);
cll=process_item(context,i->l);
cl=cll->item;
if (cl->type != t_closure) {
cfgfatal(i->l->loc,"conffile","only closures can be invoked\n");
}
if (!cl->data.closure->apply) {
cfgfatal(i->l->loc,"conffile","this closure cannot be invoked\n");
}
args=process_ilist(context, i->r);
return cl->data.closure->apply(cl->data.closure, i->loc, context, args);
}
static void process_alist(dict_t *context, struct p_node *c)
{
struct p_node *i;
atom_t k;
list_t *l;
if (!c) return; /* NULL assignment lists are valid (empty dictionary) */
ASSERT(c->type==T_ALIST);
if (c->type!=T_ALIST) {
fatal("invalid node type in assignment list");
}
for (i=c; i; i=i->r) {
ASSERT(i->l && i->l->type==T_ASSIGNMENT);
ASSERT(i->l->l->type==T_KEY);
ASSERT(i->l->r->type==T_LISTITEM);
k=i->l->l->data.key;
l=process_ilist(context, i->l->r);
dict_iadd(context, k, l);
}
}
/* Take a list of items; turn any dictionaries in this list into lists */
static list_t *makelist(closure_t *self, struct cloc loc,
dict_t *context, list_t *args)
{
list_t *r=NULL, *i;
struct entry *e;
for (i=args; i; i=i->next) {
if (i->item->type==t_dict) {
/* Convert */
for (e=i->item->data.dict->entries; e; e=e->next) {
r=list_append_list(r, e->val);
}
} else {
r=list_append_list(r, list_append(NULL,i->item));
}
}
return r;
}
/* Take a list consisting of a closure and some other things. Apply the
closure to the other things, and return the resulting list */
static list_t *map(closure_t *self, struct cloc loc, dict_t *context,
list_t *args)
{
list_t *r=NULL, *al;
item_t *ci;
closure_t *cl;
list_t se;
ci=list_elem(args,0);
if (ci && ci->type==t_closure) {
cl=ci->data.closure;
if (!cl->apply) {
cfgfatal(loc,"map","closure cannot be applied\n");
}
for (al=args->next; al; al=al->next) {
/* Construct a single-element list */
se.next=NULL;
se.item=al->item;
/* Invoke the closure, append its result to the output */
r=list_append_list(r,cl->apply(cl,loc,context,&se));
}
} else {
cfgfatal(loc,"map","you must supply a closure as the "
"first argument\n");
}
return r;
}
/* Read a file and turn it into a string */
static list_t *readfile(closure_t *self, struct cloc loc,
dict_t *context, list_t *args)
{
FILE *f;
string_t filename;
long length;
item_t *r;
r=list_elem(args,0);
if (!r) {
cfgfatal(loc,"readfile","you must supply a filename\n");
}
if (r->type!=t_string) {
cfgfatal(loc,"readfile","filename must be a string\n");
}
filename=r->data.string;
f=fopen(filename,"rb");
if (!f) {
fatal_perror("readfile (%s:%d): cannot open file \"%s\"",
loc.file,loc.line, filename);
}
if (fseek(f, 0, SEEK_END)!=0) {
fatal_perror("readfile (%s:%d): fseek(SEEK_END)",loc.file,loc.line);
}
length=ftell(f);
if (length<0) {
fatal_perror("readfile (%s:%d): ftell()",loc.file,loc.line);
}
if (fseek(f, 0, SEEK_SET)!=0) {
fatal_perror("readfile (%s:%d): fseek(SEEK_SET)",loc.file,loc.line);
}
r=new_item(t_string,loc);
r->data.string=safe_malloc(length+1,"readfile");
if (fread(r->data.string,length,1,f)!=1) {
(ferror(f) ? fatal_perror : fatal)
("readfile (%s:%d): fread: could not read all of file",
loc.file,loc.line);
}
r->data.string[length]=0;
if (fclose(f)!=0) {
fatal_perror("readfile (%s:%d): fclose",loc.file,loc.line);
}
return list_append(NULL,r);
}
static dict_t *process_config(struct p_node *c)
{
dict_t *root;
dict_t *context;
item_t *i;
list_t *false_;
list_t *true_;
root=dict_new(NULL);
context=root;
/* Predefined keys for boolean values */
/* "nowise" and "verily" have the advantage of being the same
length, so they line up nicely... thanks VKC and SGT (who also
point out that "mayhap" is a good "maybe" value as well) */
i=new_item(t_bool,no_loc);
i->data.bool_=False;
false_=list_append(NULL,i);
i=new_item(t_bool,no_loc);
i->data.bool_=True;
true_=list_append(NULL,i);
dict_add(root,"false",false_);
dict_add(root,"False",false_);
dict_add(root,"FALSE",false_);
dict_add(root,"no",false_);
dict_add(root,"No",false_);
dict_add(root,"NO",false_);
dict_add(root,"nowise",false_);
dict_add(root,"Nowise",false_);
dict_add(root,"NOWISE",false_);
dict_add(root,"true",true_);
dict_add(root,"True",true_);
dict_add(root,"TRUE",true_);
dict_add(root,"yes",true_);
dict_add(root,"Yes",true_);
dict_add(root,"YES",true_);
dict_add(root,"verily",true_);
dict_add(root,"Verily",true_);
dict_add(root,"VERILY",true_);
add_closure(root,"makelist",makelist);
add_closure(root,"readfile",readfile);
add_closure(root,"map",map);
init_builtin_modules(root);
process_alist(context, c);
return root;
}
/***** Externally accessible functions */
atom_t intern(cstring_t s)
{
struct atomlist *i;
for (i=atoms; i; i=i->next) {
if (strcmp(i->a, s)==0) break;
}
if (!i) {
/* Did't find it; create a new one */
NEW(i);
i->a=safe_strdup(s,"intern: alloc string");
i->next=atoms;
atoms=i;
}
return i->a;
}
list_t *dict_lookup(dict_t *dict, cstring_t key)
{
return dict_ilookup(dict, intern(key));
}
list_t *dict_lookup_primitive(dict_t *dict, cstring_t key)
{
return dict_ilookup_primitive(dict, intern(key));
}
void dict_add(dict_t *dict, cstring_t key, list_t *val)
{
dict_iadd(dict,intern(key),val);
}
cstring_t *dict_keys(dict_t *dict)
{
atom_t *r, *j;
struct entry *i;
NEW_ARY(r,dict->size+1);
for (i=dict->entries, j=r; i; i=i->next, j++) {
*j=i->key;
}
*j=NULL;
return r;
}
/* List-related functions */
list_t *list_new(void)
{
return NULL;
}
int32_t list_length(const list_t *a)
{
int32_t l=0;
const list_t *i;
for (i=a; i; i=i->next) { assert(l < INT_MAX); l++; }
return l;
}
static list_t *list_copy(list_t *a)
{
list_t *r, *i, *b, *l;
if (!a) return NULL;
l=NULL;
r=NULL;
for (i=a; i; i=i->next) {
NEW(b);
if (l) l->next=b; else r=b;
l=b;
b->item=i->item;
b->next=NULL;
}
return r;
}
list_t *list_append_list(list_t *a, list_t *b)
{
list_t *i;
b=list_copy(b);
if (!a) return b;
for (i=a; i->next; i=i->next);
i->next=b;
return a;
}
list_t *list_append(list_t *list, item_t *item)
{
list_t *l;
NEW(l);
l->item=item;
l->next=NULL;
return list_append_list(list,l);
}
item_t *list_elem(list_t *l, int32_t index)
{
if (!l) return NULL;
if (index==0) return l->item;
return list_elem(l->next, index-1);
}
list_t *new_closure(closure_t *cl)
{
item_t *i;
i=new_item(t_closure,no_loc);
i->data.closure=cl;
return list_append(NULL,i);
}
void add_closure(dict_t *dict, cstring_t name, apply_fn apply)
{
closure_t *c;
NEW(c);
c->description=name;
c->type=CL_PURE;
c->apply=apply;
c->interface=NULL;
dict_add(dict,name,new_closure(c));
}
void *find_cl_if(dict_t *dict, cstring_t name, uint32_t type,
bool_t required, cstring_t desc, struct cloc loc)
{
item_t *i;
closure_t *cl;
i = dict_find_item(dict,name,required,desc,loc);
if (!i) return NULL;
if (i->type!=t_closure) {
cfgfatal(loc,desc,"\"%s\" must be a closure\n",name);
}
cl=i->data.closure;
if (cl->type!=type) {
cfgfatal_cl_type(loc,desc,cl,type,name);
}
return cl->interface;
}
/* Convenience functions for modules reading configuration dictionaries */
item_t *dict_find_item(dict_t *dict, cstring_t key, bool_t required,
cstring_t desc, struct cloc loc)
{
list_t *l;
item_t *i;
l=dict_lookup(dict,key);
if (!l) {
if (!required) return NULL;
cfgfatal(loc,desc,"required parameter \"%s\" not found\n",key);
}
if(list_length(l) != 1)
cfgfatal(loc,desc,"parameter \"%s\" has wrong number of values",key);
i=list_elem(l,0);
return i;
}
string_t dict_read_string(dict_t *dict, cstring_t key, bool_t required,
cstring_t desc, struct cloc loc)
{
item_t *i;
string_t r;
i=dict_find_item(dict,key,required,desc,loc);
if (!i) return NULL;
if (i->type!=t_string) {
cfgfatal(loc,desc,"\"%s\" must be a string\n",key);
}
if (strlen(i->data.string) > INT_MAX/10) {
cfgfatal(loc,desc,"\"%s\" is unreasonably long\n",key);
}
r=i->data.string;
return r;
}
const char **dict_read_string_array(dict_t *dict, cstring_t key,
bool_t required, cstring_t desc,
struct cloc loc, const char *const *def)
{
list_t *l;
const char **ra, **rap;
l=dict_lookup(dict,key);
if (!l) {
if (!required) return (const char**)def;
cfgfatal(loc,desc,"required string list \"%s\" not found\n",key);
}
int32_t ll=list_length(l);
NEW_ARY(ra, ll+1);
for (rap=ra; l; l=l->next,rap++) {
item_t *it=l->item;
if (it->type!=t_string)
cfgfatal(it->loc,desc,"\"%s\" entry must be a string\n",key);
*rap=it->data.string;
}
*rap=0;
return ra;
}
uint32_t dict_read_number(dict_t *dict, cstring_t key, bool_t required,
cstring_t desc, struct cloc loc, uint32_t def)
{
item_t *i;
uint32_t r;
i=dict_find_item(dict,key,required,desc,loc);
if (!i) return def;
if (i->type!=t_number) {
cfgfatal(loc,desc,"\"%s\" must be a number\n",key);
}
if (i->data.number >= 0x80000000) {
cfgfatal(loc,desc,"\"%s\" must fit into a 32-bit signed integer\n",key);
}
r=i->data.number;
return r;
}
bool_t dict_read_bool(dict_t *dict, cstring_t key, bool_t required,
cstring_t desc, struct cloc loc, bool_t def)
{
item_t *i;
bool_t r;
i=dict_find_item(dict,key,required,desc,loc);
if (!i) return def;
if (i->type!=t_bool) {
cfgfatal(loc,desc,"\"%s\" must be a boolean\n",key);
}
r=i->data.bool_;
return r;
}
dict_t *dict_read_dict(dict_t *dict, cstring_t key, bool_t required,
cstring_t desc, struct cloc loc)
{
item_t *i;
dict_t *r;
i=dict_find_item(dict,key,required,desc,loc);
if (!i) return NULL;
if (i->type!=t_dict) {
cfgfatal(loc,desc,"\"%s\" must be a dictionary\n",key);
}
r=i->data.dict;
return r;
}
uint32_t string_to_word(cstring_t s, struct cloc loc,
struct flagstr *f, cstring_t desc)
{
struct flagstr *j;
for (j=f; j->name; j++)
if (strcmp(s,j->name)==0)
return j->value;
cfgfatal(loc,desc,"option \"%s\" not known\n",s);
return 0;
}
uint32_t string_list_to_word(list_t *l, struct flagstr *f, cstring_t desc)
{
list_t *i;
uint32_t r=0;
struct flagstr *j;
for (i=l; i; i=i->next) {
if (i->item->type!=t_string) {
cfgfatal(i->item->loc,desc,"all elements of list must be "
"strings\n");
}
for (j=f; j->name; j++)
r|=string_to_word(i->item->data.string,i->item->loc,f,desc);
}
return r;
}
dict_t *read_conffile(const char *name)
{
FILE *conffile;
struct p_node *config;
if (strcmp(name,"-")==0) {
conffile=stdin;
} else {
conffile=fopen(name,"r");
if (!conffile)
fatal_perror("Cannot open configuration file \"%s\"",name);
}
config_lineno=1;
config_file=name;
config=parse_conffile(conffile);
fclose(conffile);
#ifdef DUMP_PARSE_TREE
printf("*** config file parse tree BEFORE MANGLE\n");
ptree_dump(config,0);
#endif /* DUMP_PARSE_TREE */
/* The root of the configuration is a T_ALIST, which needs reversing
before we mangle because it isn't the child of a T_DICT. */
config=list_reverse(config);
ptree_mangle(config);
#ifdef DUMP_PARSE_TREE
printf("\n\n*** config file parse tree AFTER MANGLE\n");
ptree_dump(config,0);
#endif /* DUMP_PARSE_TREE */
return process_config(config);
}
work/conffile.fl 0000664 0000000 0000000 00000010413 15063477206 011051 0 ustar /*
* This file is part of secnet.
* See README for full list of copyright holders.
*
* secnet is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* secnet is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with secnet; if not, see
* https://www.gnu.org/licenses/gpl.html.
*/
/* the "incl" state is used for picking up the name of an include file */
%x incl
%option nounput
%option noinput
%option never-interactive
%option noyywrap
%{
#include
#include
#include
#include
#include
#include "conffile_internal.h"
#include "conffile.tab.h"
#include "util.h"
#define YY_NO_UNPUT
#define YY_INPUT(buf,result,max_size) \
do{ \
(result)= fread((buf),1,(max_size),yyin); \
if (ferror(yyin)) \
fatal_perror("Error reading configuration file (%s)", \
config_file); \
}while(0)
#define MAX_INCLUDE_DEPTH 10
struct include_stack_item {
YY_BUFFER_STATE bst;
int lineno;
cstring_t file;
};
struct include_stack_item include_stack[MAX_INCLUDE_DEPTH];
int include_stack_ptr=0;
int config_lineno=0;
cstring_t config_file="xxx";
static struct p_node *leafnode(uint32_t type)
{
struct p_node *r;
NEW(r);
r->type=type;
r->loc.file=config_file;
r->loc.line=config_lineno;
r->l=NULL; r->r=NULL;
return r;
}
static struct p_node *keynode(atom_t key)
{
struct p_node *r;
r=leafnode(T_KEY);
r->data.key=intern(key);
return r;
}
static struct p_node *stringnode(string_t string)
{
struct p_node *r;
r=leafnode(T_STRING);
string++;
string[strlen(string)-1]=0;
r->data.string=safe_strdup(string,"stringnode");
return r;
}
static struct p_node *numnode(string_t number)
{
struct p_node *r;
unsigned long n;
r=leafnode(T_NUMBER);
errno = 0;
n = strtoul(number, NULL, 10);
/* The caller is expected to only give us [0-9]+,
* so we skip some of the usual syntax checking. */
r->data.number=n;
/* Give a consistent error message for any kind of
* out-of-range condition */
if(errno == ERANGE || n != r->data.number) {
Message(M_FATAL,"config file %s line %d: '%s' is too big\n",
config_file, config_lineno, number);
exit(1);
}
if(errno) {
Message(M_FATAL,"config file %s line %d: '%s': %s\n",
config_file, config_lineno, number, strerror(errno));
exit(1);
}
return r;
}
%}
%%
include BEGIN(incl);
[ \t]* /* eat the whitespace */
[^ \t\n]+ { /* got the include filename */
if (include_stack_ptr >= MAX_INCLUDE_DEPTH) {
fatal("Configuration file includes nested too deeply");
}
include_stack[include_stack_ptr].bst=YY_CURRENT_BUFFER;
include_stack[include_stack_ptr].lineno=config_lineno;
include_stack[include_stack_ptr].file=config_file;
include_stack_ptr++;
yyin=fopen(yytext,"r");
if (!yyin) {
fatal("Can't open included file %s",yytext);
}
config_lineno=1;
config_file=safe_strdup(yytext,"conffile.fl/include");
yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
BEGIN(INITIAL);
}
\n { /* include with no filename */
Message(M_FATAL,"config file %s line %d: %s\n",config_file,
config_lineno,"``include'' requires a filename");
BEGIN(INITIAL);
assert(config_lineno < INT_MAX);
++config_lineno;
++yynerrs;
}
<> {
if (--include_stack_ptr < 0) {
yyterminate();
}
else {
fclose(yyin);
yy_delete_buffer(YY_CURRENT_BUFFER);
yy_switch_to_buffer(include_stack[include_stack_ptr].bst);
config_lineno=include_stack[include_stack_ptr].lineno;
config_file=include_stack[include_stack_ptr].file;
}
}
\"[^\"]*\" yylval=stringnode(yytext); return TOK_STRING;
[[:alpha:]_][[:alnum:]\-_]* yylval=keynode(yytext); return TOK_KEY;
[[:digit:]]+ yylval=numnode(yytext); return TOK_NUMBER;
/* Eat comments */
\#.*\n config_lineno++;
/* Count lines */
\n config_lineno++;
/* Eat whitespace */
[[:blank:]\j]
/* Return all unclaimed single characters to the parser */
. return *yytext;
work/conffile.h 0000664 0000000 0000000 00000001557 15063477206 010710 0 ustar /*
* This file is part of secnet.
* See README for full list of copyright holders.
*
* secnet is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* secnet is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with secnet; if not, see
* https://www.gnu.org/licenses/gpl.html.
*/
#ifndef conffile_h
#define conffile_h
#include "secnet.h"
extern dict_t *read_conffile(const char *conffile);
#endif /* conffile_h */
work/conffile.y 0000664 0000000 0000000 00000005120 15063477206 010717 0 ustar /*
* This file is part of secnet.
* See LICENCE and this file CREDITS for full list of copyright holders.
* SPDX-License-Identifier: GPL-3.0-or-later
* There is NO WARRANTY.
*/
%token TOK_STRING
%token TOK_NUMBER
%token TOK_KEY
%start input
%{
#include
#include
#include
/* Bison stupidly redeclares malloc/free unless they are #defined
* (or a bunch of madder conditions) */
#ifndef malloc
# define malloc malloc
# define free free
#endif
#include "secnet.h"
#include "conffile_internal.h"
#include "conffile.yy.h"
#include "util.h"
#define YYERROR_VERBOSE
static struct p_node *node(uint32_t type, struct p_node *l, struct p_node *r);
static struct p_node *result;
static void yyerror(const char *s);
%}
%%
input: assignments { result = $1; $$=result; }
;
assignments: assignments assignment { $$=node(T_ALIST, $2, $1); }
| assignment { $$=node(T_ALIST, $1, NULL); }
;
searchpath: /* empty */ { $$ = NULL; }
| '<' list '>' { $$ = $2; }
;
dict: searchpath '{' assignments '}'
{ $$ = node(T_DICT, $3, $1); }
| searchpath '{' '}' { $$ = node(T_DICT, NULL, $1); }
;
path: '/' pathelements { $$ = node(T_ABSPATH, NULL, $2); }
| pathelements { $$ = node(T_RELPATH, NULL, $1); }
;
pathelements: pathelements '/' TOK_KEY { $$ = node(T_PATHELEM, $3, $1); }
| TOK_KEY { $$ = node(T_PATHELEM, $1, NULL); }
;
exec: item '(' list ')' { $$ = node(T_EXEC, $1, $3); }
| item '(' ')' { $$ = node(T_EXEC, $1, NULL); }
| item dict
{ $$ = node(T_EXEC, $1, node(T_LISTITEM, $2, NULL)); }
;
list: list ',' item { $$ = node(T_LISTITEM, $3, $1); }
| item { $$ = node(T_LISTITEM, $1, NULL); }
;
assignment: TOK_KEY '=' list ';' { $$ = node(T_ASSIGNMENT, $1, $3); }
| TOK_KEY list ';' { $$ = node(T_ASSIGNMENT, $1, $2); }
| error ';' { $$ = node(T_ERROR, NULL, NULL); }
| error '}' { $$ = node(T_ERROR, NULL, NULL); }
| error ')' { $$ = node(T_ERROR, NULL, NULL); }
;
item: TOK_STRING
| TOK_NUMBER
| path
| dict
| exec
;
%%
static void yyerror(const char *s)
{
Message(M_FATAL,"config file %s line %d: %s\n",config_file,
config_lineno,s);
}
struct p_node *parse_conffile(FILE *conffile)
{
yyin=conffile;
if (yyparse()!=0) {
fatal("Configuration file parsing failed\n");
}
if (yynerrs>0) {
fatal("%d error%s encountered in configuration file\n",
yynerrs,yynerrs==1?"":"s");
}
return result;
}
static struct p_node *node(uint32_t type, struct p_node *l, struct p_node *r)
{
struct p_node *rv;
NEW(rv);
rv->type=type;
rv->loc.file=config_file;
rv->loc.line=config_lineno;
rv->l=l;
rv->r=r;
return rv;
}
work/conffile_internal.h 0000664 0000000 0000000 00000003366 15063477206 012604 0 ustar /*
* This file is part of secnet.
* See README for full list of copyright holders.
*
* secnet is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* secnet is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* version 3 along with secnet; if not, see
* https://www.gnu.org/licenses/gpl.html.
*/
#ifndef conffile_internal_h
#define conffile_internal_h
#include
#include "secnet.h"
typedef cstring_t atom_t;
/* Parse tree for configuration file */
#define YYSTYPE struct p_node *
#define T_STRING 1
#define T_NUMBER 2
#define T_KEY 3
#define T_ASSIGNMENT 10
#define T_LISTITEM 11
#define T_EXEC 12
#define T_PATHELEM 13
#define T_ABSPATH 14
#define T_RELPATH 15
#define T_DICT 16
#define T_ALIST 17
#define T_ERROR 20
#define T_IS_PRIMITIVE(NTYPE) ((NTYPE) < T_ASSIGNMENT)
struct p_node {
uint32_t type;
struct cloc loc;
union {
atom_t key;
string_t string;
uint32_t number;
} data;
struct p_node *l;
struct p_node *r;
};
extern cstring_t config_file;
extern int config_lineno;
extern int yynerrs;
/* Keys in dictionaries are 'atoms', which are constructed from strings
using this call. Atoms may be compared using '=='. */
extern atom_t intern(cstring_t string);
extern struct p_node *parse_conffile(FILE *conffile);
#endif /* conffile_internal_h */
work/config.h.in 0000664 0000000 0000000 00000004734 15063477206 010775 0 ustar /* config.h.in. Generated from configure.ac by autoheader. */
#ifndef _CONFIG_H
#define _CONFIG_H
/* Define if building universal (internal helper macro) */
#undef AC_APPLE_UNIVERSAL_BUILD
/* Define to 1 to use IPv6 support in system and adns */
#undef CONFIG_IPV6
/* Define to 1 if you have the 'fmemopen' function. */
#undef HAVE_FMEMOPEN
/* Define to 1 if you have the 'funopen' function. */
#undef HAVE_FUNOPEN
/* Define to 1 if you have the 'adns' library (-ladns). */
#undef HAVE_LIBADNS
/* Define to 1 if you have the 'gmp' library (-lgmp). */
#undef HAVE_LIBGMP
/* Define to 1 if you have the 'gmp2' library (-lgmp2). */
#undef HAVE_LIBGMP2
/* Define to 1 if you have the 'socket' library (-lsocket). */
#undef HAVE_LIBSOCKET
/* Define to 1 if you have the header file. */
#undef HAVE_LINUX_IF_TUN_H
/* Define to 1 if you have the header file. */
#undef HAVE_NET_IF_H
/* Define to 1 if you have the header file. */
#undef HAVE_NET_IF_TUN_H
/* Define to 1 if you have the header file. */
#undef HAVE_NET_ROUTE_H
/* Define to 1 if you have the header file. */
#undef HAVE_STROPTS_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_SOCKET_H
/* Define to 1 if you have the header file. */
#undef HAVE_SYS_SOCKIO_H
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Use CLOCK_MONOTONIC and adns_if_monotonic */
#undef USE_MONOTONIC
/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
significant byte first (like Motorola and SPARC, unlike Intel). */
#if defined AC_APPLE_UNIVERSAL_BUILD
# if defined __BIG_ENDIAN__
# define WORDS_BIGENDIAN 1
# endif
#else
# ifndef WORDS_BIGENDIAN
# undef WORDS_BIGENDIAN
# endif
#endif
/* -*- c -*- */
/* These used to be in config.h.bot, but are now in configure.in. */
#ifdef __GNUC__
#define NORETURN(_x) void _x __attribute__ ((noreturn))
#define FORMAT(_a,_b,_c) __attribute__ ((format (_a,_b,_c)))
#else
#define NORETURN(_x) _x
#define FORMAT(_a,_b,_c)
#endif
#endif /* _CONFIG_H */
work/configure 0000775 0000000 0000000 00000474075 15063477206 010672 0 ustar #! /bin/sh
# From configure.ac Id: configure.in.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for secnet 0.1.18+.
#
# Report bugs to .
#
#
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir/$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
CONFIG_SHELL=$as_shell as_have_required=yes
if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
break 2
fi
fi
done;;
esac
as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno; then :
$as_echo "$0: This script requires a shell more modern than all"
$as_echo "$0: the shells that I found on your system."
if test x${ZSH_VERSION+set} = xset ; then
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: secnet-discuss@chiark.greenend.org.uk about your
$0: system, including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='secnet'
PACKAGE_TARNAME='secnet'
PACKAGE_VERSION='0.1.18+'
PACKAGE_STRING='secnet 0.1.18+'
PACKAGE_BUGREPORT='secnet-discuss@chiark.greenend.org.uk'
PACKAGE_URL=''
ac_unique_file="secnet.c"
ac_subst_vars='LTLIBOBJS
LIBOBJS
WRITESTRINGS
CPP
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
SET_MAKE
FINK
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL
_SUBDIRMK_MAKEFILES'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_hacky_parallel
'
ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*=) ac_optarg= ;;
*) ac_optarg=yes ;;
esac
# Accept the important Cygnus configure options, so we can diagnose typos.
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
-with-* | --with-*)
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: $ac_useropt"
ac_useropt_orig=$ac_useropt
ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
$as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
$as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures secnet 0.1.18+ to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/secnet]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of secnet 0.1.18+:";;
esac
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-hacky-parallel parallelise slow cryptography (default is no)
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
CPP C preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to .
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for guested configure.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
secnet configure 0.1.18+
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_cpp ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
# the include files in INCLUDES and setting the cache variable VAR
# accordingly.
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
$as_echo_n "checking $2 usability... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_header_compiler=yes
else
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
$as_echo_n "checking $2 presence... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <$2>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
ac_header_preproc=yes
else
ac_header_preproc=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
$as_echo "$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
yes:no: )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
no:yes:* )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
( $as_echo "## ---------------------------------------------------- ##
## Report this to secnet-discuss@chiark.greenend.org.uk ##
## ---------------------------------------------------- ##"
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_mongrel
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
# ac_fn_c_try_run LINENO
# ----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_c_try_run ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then :
ac_retval=0
else
$as_echo "$as_me: program exited with status $ac_status" >&5
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_run
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case declares $2.
For example, HP-UX 11i declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $2 (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef $2
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char $2 ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif
int
main ()
{
return $2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
# ---------------------------------------------
# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
# accordingly.
ac_fn_c_check_decl ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
as_decl_name=`echo $2|sed 's/ *(.*//'`
as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
#ifndef $as_decl_name
#ifdef __cplusplus
(void) $as_decl_use;
#else
(void) $as_decl_name;
#endif
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_decl
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by secnet $as_me 0.1.18+, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
$as_echo "PATH: $as_dir"
done
IFS=$as_save_IFS
} >&5
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
echo
$as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
$as_echo "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
$as_echo "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
$as_echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
$as_echo "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
$as_echo "$as_me: caught signal $ac_signal"
$as_echo "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
$as_echo "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
cat >>confdefs.h <<_ACEOF
#define PACKAGE_NAME "$PACKAGE_NAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_VERSION "$PACKAGE_VERSION"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_STRING "$PACKAGE_STRING"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
_ACEOF
cat >>confdefs.h <<_ACEOF
#define PACKAGE_URL "$PACKAGE_URL"
_ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
ac_site_file1=NONE
ac_site_file2=NONE
if test -n "$CONFIG_SITE"; then
# We do not want a PATH search for config.site.
case $CONFIG_SITE in #((
-*) ac_site_file1=./$CONFIG_SITE;;
*/*) ac_site_file1=$CONFIG_SITE;;
*) ac_site_file1=./$CONFIG_SITE;;
esac
elif test "x$prefix" != xNONE; then
ac_site_file1=$prefix/share/config.site
ac_site_file2=$prefix/etc/config.site
else
ac_site_file1=$ac_default_prefix/share/config.site
ac_site_file2=$ac_default_prefix/etc/config.site
fi
for ac_site_file in "$ac_site_file1" "$ac_site_file2"
do
test "x$ac_site_file" = xNONE && continue
if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
$as_echo "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
$as_echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
$as_echo "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
$as_echo "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_config_headers="$ac_config_headers config.h"
ac_config_files="$ac_config_files main.mk:main.mk.tmp Dir.mk:Dir.mk.tmp Final.mk:Final.mk.tmp"
_SUBDIRMK_MAKEFILES="$_SUBDIRMK_MAKEFILES subdirmk/regen.mk"
ac_config_files="$ac_config_files subdirmk/regen.mk:subdirmk/regen.mk.in"
_SUBDIRMK_MAKEFILES="$_SUBDIRMK_MAKEFILES subdirmk/usual.mk"
ac_config_files="$ac_config_files subdirmk/usual.mk:subdirmk/usual.mk.in"
subdirmk_subdirs="$subdirmk_subdirs 'test-example/'"
ac_config_files="$ac_config_files test-example/Dir.mk:test-example/Dir.mk.tmp"
subdirmk_subdirs="$subdirmk_subdirs 'mtest/'"
ac_config_files="$ac_config_files mtest/Dir.mk:mtest/Dir.mk.tmp"
subdirmk_subdirs="$subdirmk_subdirs 'stest/'"
ac_config_files="$ac_config_files stest/Dir.mk:stest/Dir.mk.tmp"
subdirmk_subdirs="$subdirmk_subdirs 'base91s/'"
ac_config_files="$ac_config_files base91s/Dir.mk:base91s/Dir.mk.tmp"
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
# If fink is on the path then it is assumed we should use it.
# Extract the first word of "fink", so it can be a program name with args.
set dummy fink; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_FINK+:} false; then :
$as_echo_n "(cached) " >&6
else
case $FINK in
[\\/]* | ?:[\\/]*)
ac_cv_path_FINK="$FINK" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_FINK="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
FINK=$ac_cv_path_FINK
if test -n "$FINK"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $FINK" >&5
$as_echo "$FINK" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$FINK" != x; then
finkdir=`echo $FINK|sed 's,/[^/]*/[^/]*$,,'`
CPPFLAGS="-I$finkdir/include ${CPPFLAGS}"
LDFLAGS="-L$finkdir/lib ${LDFLAGS}"
fi
# This is quite unpleasant. It turns out that most header checking
# macros call AC_INCLUDES_DEFAULT. By default AC_INCLUDES_DEFAULT
# implies AC_HEADER_STDC and a bunch of conditional includes. But
# these header checks are obsolete as the documentation for
# AC_HEADER_STDC says. Instead, define AC_INCLUDES_DEFAULT ourselves.
# The list of headers below is the list from `(autoconf) Default
# Includes' (filtered by hand for the modern ones rather than the
# fallbacks). We must include $1 because AC_INCLUDES_DEFAULT is
# called with an argument giving the check-specific haders.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
set x ${MAKE-make}
ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
$as_echo_n "(cached) " >&6
else
cat >conftest.make <<\_ACEOF
SHELL = /bin/sh
all:
@echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
case `${MAKE-make} -f conftest.make 2>/dev/null` in
*@@@%%%=?*=@@@%%%*)
eval ac_cv_prog_make_${ac_make}_set=yes;;
*)
eval ac_cv_prog_make_${ac_make}_set=no;;
esac
rm -f conftest.make
fi
if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
SET_MAKE=
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_CC" && break
done
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
fi
test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&6; }
ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
# safe: cross compilers may not add the suffix if given an `-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
break;;
* )
break;;
esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
else
ac_file=''
fi
if test -z "$ac_file"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
$as_echo_n "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
if ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
$as_echo "$ac_cv_c_compiler_gnu" >&6; }
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
$as_echo "$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
inside strings and character constants. */
#define FOO(x) 'x'
int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
int argc;
char **argv;
int
main ()
{
return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
;
return 0;
}
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
# AC_CACHE_VAL
case "x$ac_cv_prog_cc_c89" in
x)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if ${ac_cv_path_install+:} false; then :
$as_echo_n "(cached) " >&6
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
# Account for people who put trailing slashes in PATH elements.
case $as_dir/ in #((
./ | .// | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
rm -rf conftest.one conftest.two conftest.dir
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
break 3
fi
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
# value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
$as_echo "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
$as_echo_n "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if ${ac_cv_prog_CPP+:} false; then :
$as_echo_n "(cached) " >&6
else
# Double quotes because CPP needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
do
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer to if __STDC__ is defined, since
# exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
break
fi
done
ac_cv_prog_CPP=$CPP
fi
CPP=$ac_cv_prog_CPP
else
ac_cv_prog_CPP=$CPP
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
$as_echo "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# Prefer to if __STDC__ is defined, since
# exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
for ac_header in net/if.h net/route.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "
# include
# include
# include
# include
# include
# include
# include
# include
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
for ac_header in sys/socket.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "sys/socket.h" "ac_cv_header_sys_socket_h" "
# include
# include
# include
# include
# include
# include
# include
# include
"
if test "x$ac_cv_header_sys_socket_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_SYS_SOCKET_H 1
_ACEOF
fi
done
for ac_header in linux/if_tun.h
do :
ac_fn_c_check_header_compile "$LINENO" "linux/if_tun.h" "ac_cv_header_linux_if_tun_h" "
# include
# include
# include
# include
# include
# include
# include
# include
#if HAVE_SYS_SOCKET_H
# include
#endif
"
if test "x$ac_cv_header_linux_if_tun_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LINUX_IF_TUN_H 1
_ACEOF
fi
done
for ac_header in stropts.h sys/sockio.h net/if_tun.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "
# include
# include
# include
# include
# include
# include
# include
# include
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; }
if ${ac_cv_c_bigendian+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_c_bigendian=unknown
# See if we're dealing with a universal compiler.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef __APPLE_CC__
not a universal capable compiler
#endif
typedef int dummy;
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
# Check for potential -arch flags. It is not universal unless
# there are at least two -arch flags with different values.
ac_arch=
ac_prev=
for ac_word in $CC $CFLAGS $CPPFLAGS $LDFLAGS; do
if test -n "$ac_prev"; then
case $ac_word in
i?86 | x86_64 | ppc | ppc64)
if test -z "$ac_arch" || test "$ac_arch" = "$ac_word"; then
ac_arch=$ac_word
else
ac_cv_c_bigendian=universal
break
fi
;;
esac
ac_prev=
elif test "x$ac_word" = "x-arch"; then
ac_prev=arch
fi
done
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_c_bigendian = unknown; then
# See if sys/param.h defines the BYTE_ORDER macro.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \
&& defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \
&& LITTLE_ENDIAN)
bogus endian macros
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
# It does; now see whether it defined to BIG_ENDIAN or not.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
int
main ()
{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_c_bigendian=yes
else
ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris).
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN)
bogus endian macros
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
# It does; now see whether it defined to _BIG_ENDIAN or not.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
#ifndef _BIG_ENDIAN
not big endian
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_c_bigendian=yes
else
ac_cv_c_bigendian=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test $ac_cv_c_bigendian = unknown; then
# Compile a test program.
if test "$cross_compiling" = yes; then :
# Try to guess by grepping values from an object file.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
short int ascii_mm[] =
{ 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
short int ascii_ii[] =
{ 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 };
int use_ascii (int i) {
return ascii_mm[i] + ascii_ii[i];
}
short int ebcdic_ii[] =
{ 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 };
short int ebcdic_mm[] =
{ 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 };
int use_ebcdic (int i) {
return ebcdic_mm[i] + ebcdic_ii[i];
}
extern int foo;
int
main ()
{
return use_ascii (foo) == use_ebcdic (foo);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then
ac_cv_c_bigendian=yes
fi
if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then
if test "$ac_cv_c_bigendian" = unknown; then
ac_cv_c_bigendian=no
else
# finding both strings is unlikely to happen, but who knows?
ac_cv_c_bigendian=unknown
fi
fi
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
# include
# include
# include
# include
# include
# include
# include
# include
int
main ()
{
/* Are we little or big endian? From Harbison&Steele. */
union
{
long int l;
char c[sizeof (long int)];
} u;
u.l = 1;
return u.c[sizeof (long int) - 1] == 1;
;
return 0;
}
_ACEOF
if ac_fn_c_try_run "$LINENO"; then :
ac_cv_c_bigendian=no
else
ac_cv_c_bigendian=yes
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5
$as_echo "$ac_cv_c_bigendian" >&6; }
case $ac_cv_c_bigendian in #(
yes)
$as_echo "#define WORDS_BIGENDIAN 1" >>confdefs.h
;; #(
no)
;; #(
universal)
$as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
;; #(
*)
as_fn_error $? "unknown endianness
presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;;
esac
hard=
if test -z "$hard"; then
msg="C to warn about writing to stringliterals"
else
msg="C to prohibit any write to stringliterals"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $msg" >&5
$as_echo_n "checking $msg... " >&6; }
if ${ac_cv_prog_cc_no_writeable_strings+:} false; then :
$as_echo_n "(cached) " >&6
else
cat > conftest.c <
int main (void)
{
char test[16];
if (strcpy (test, "test")) return 0;
return 1;
}
EOF
if test "$GCC" = "yes";
then
if test -z "$hard"; then
ac_cv_prog_cc_no_writeable_strings="-Wwrite-strings"
else
ac_cv_prog_cc_no_writeable_strings="-fno-writable-strings -Wwrite-strings"
fi
if test -n "`${CC-cc} -c $ac_cv_prog_cc_no_writeable_strings conftest.c 2>&1`" ; then
ac_cv_prog_cc_no_writeable_strings="suppressed: string.h"
fi
elif $CC -flags 2>&1 | grep "Xc.*strict ANSI C" > /dev/null 2>&1 &&
$CC -c -xstrconst conftest.c > /dev/null 2>&1 &&
test -f conftest.o
then
# strings go into readonly segment
ac_cv_prog_cc_no_writeable_strings="-xstrconst"
rm conftest.o
if test -n "`${CC-cc} -c $ac_cv_prog_cc_no_writeable_strings conftest.c 2>&1`" ; then
ac_cv_prog_cc_no_writeable_strings="suppressed: string.h"
fi
elif $CC > /dev/null 2>&1 &&
$CC -c +ESlit conftest.c > /dev/null 2>&1 &&
test -f conftest.o
then
# strings go into readonly segment
ac_cv_prog_cc_no_writeable_strings="+ESlit"
rm conftest.o
if test -n "`${CC-cc} -c $ac_cv_prog_cc_no_writeable_strings conftest.c 2>&1`" ; then
ac_cv_prog_cc_no_writeable_strings="suppressed: string.h"
fi
elif ! $CC > /dev/null 2>&1 &&
$CC -c -readonly_strings conftest.c > /dev/null 2>&1 &&
test -f conftest.o
then
# strings go into readonly segment
ac_cv_prog_cc_no_writeable_strings="-readonly_strings"
rm conftest.o
if test -n "`${CC-cc} -c $ac_cv_prog_cc_no_writeable_strings conftest.c 2>&1`" ; then
ac_cv_prog_cc_no_writeable_strings="suppressed: string.h"
fi
# -use_readonly_const is the default for IRIX C,
# puts them into .rodata, but they are copied later.
# need to be "-G0 -rdatashared" for strictmode but
# I am not sure what effect that has really.
fi
rm -f conftest.*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_no_writeable_strings" >&5
$as_echo "$ac_cv_prog_cc_no_writeable_strings" >&6; }
if test -z "$WRITESTRINGS" ; then
if test -n "$ac_cv_prog_cc_no_writeable_strings" ; then
case "$ac_cv_prog_cc_no_writeable_strings" in
suppressed*) WRITESTRINGS="" ;; # known but suppressed
*) WRITESTRINGS="$ac_cv_prog_cc_no_writeable_strings" ;;
esac
fi
fi
# Check whether --enable-hacky-parallel was given.
if test "${enable_hacky_parallel+set}" = set; then :
enableval=$enable_hacky_parallel;
case "$enableval" in
n|0|no) ;;
y|1|yes) CFLAGS="$CFLAGS -DHACKY_PARALLEL" ;;
*) ;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpz_init_set_str in -lgmp" >&5
$as_echo_n "checking for mpz_init_set_str in -lgmp... " >&6; }
if ${ac_cv_lib_gmp_mpz_init_set_str+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmp $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mpz_init_set_str ();
int
main ()
{
return mpz_init_set_str ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_gmp_mpz_init_set_str=yes
else
ac_cv_lib_gmp_mpz_init_set_str=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmp_mpz_init_set_str" >&5
$as_echo "$ac_cv_lib_gmp_mpz_init_set_str" >&6; }
if test "x$ac_cv_lib_gmp_mpz_init_set_str" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGMP 1
_ACEOF
LIBS="-lgmp $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpz_init_set_str in -lgmp2" >&5
$as_echo_n "checking for mpz_init_set_str in -lgmp2... " >&6; }
if ${ac_cv_lib_gmp2_mpz_init_set_str+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmp2 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char mpz_init_set_str ();
int
main ()
{
return mpz_init_set_str ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_gmp2_mpz_init_set_str=yes
else
ac_cv_lib_gmp2_mpz_init_set_str=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmp2_mpz_init_set_str" >&5
$as_echo "$ac_cv_lib_gmp2_mpz_init_set_str" >&6; }
if test "x$ac_cv_lib_gmp2_mpz_init_set_str" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGMP2 1
_ACEOF
LIBS="-lgmp2 $LIBS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __gmpz_init_set_str in -lgmp" >&5
$as_echo_n "checking for __gmpz_init_set_str in -lgmp... " >&6; }
if ${ac_cv_lib_gmp___gmpz_init_set_str+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lgmp $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char __gmpz_init_set_str ();
int
main ()
{
return __gmpz_init_set_str ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_gmp___gmpz_init_set_str=yes
else
ac_cv_lib_gmp___gmpz_init_set_str=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmp___gmpz_init_set_str" >&5
$as_echo "$ac_cv_lib_gmp___gmpz_init_set_str" >&6; }
if test "x$ac_cv_lib_gmp___gmpz_init_set_str" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBGMP 1
_ACEOF
LIBS="-lgmp $LIBS"
fi
ac_fn_c_check_header_mongrel "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "
# include
# include
# include
# include
# include
# include
# include
# include
"
if test "x$ac_cv_header_gmp_h" = xyes; then :
else
as_fn_error $? "gmp.h not found" "$LINENO" 5
fi
ac_fn_c_check_func "$LINENO" "inet_ntoa" "ac_cv_func_inet_ntoa"
if test "x$ac_cv_func_inet_ntoa" = xyes; then :
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_ntoa in -lnsl" >&5
$as_echo_n "checking for inet_ntoa in -lnsl... " >&6; }
if ${ac_cv_lib_nsl_inet_ntoa+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lnsl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char inet_ntoa ();
int
main ()
{
return inet_ntoa ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_nsl_inet_ntoa=yes
else
ac_cv_lib_nsl_inet_ntoa=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_inet_ntoa" >&5
$as_echo "$ac_cv_lib_nsl_inet_ntoa" >&6; }
if test "x$ac_cv_lib_nsl_inet_ntoa" = xyes; then :
LIBS="-lnsl $LIBS";
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: inet_ntoa is in libnsl, urgh. Must use -lnsl." >&5
$as_echo "$as_me: WARNING: inet_ntoa is in libnsl, urgh. Must use -lnsl." >&2;}
else
as_fn_error $? "cannot find library function inet_ntoa" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5
$as_echo_n "checking for socket in -lsocket... " >&6; }
if ${ac_cv_lib_socket_socket+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsocket $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char socket ();
int
main ()
{
return socket ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_socket_socket=yes
else
ac_cv_lib_socket_socket=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5
$as_echo "$ac_cv_lib_socket_socket" >&6; }
if test "x$ac_cv_lib_socket_socket" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBSOCKET 1
_ACEOF
LIBS="-lsocket $LIBS"
fi
ac_fn_c_check_func "$LINENO" "inet_aton" "ac_cv_func_inet_aton"
if test "x$ac_cv_func_inet_aton" = xyes; then :
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for inet_aton in -lresolv" >&5
$as_echo_n "checking for inet_aton in -lresolv... " >&6; }
if ${ac_cv_lib_resolv_inet_aton+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lresolv $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char inet_aton ();
int
main ()
{
return inet_aton ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_resolv_inet_aton=yes
else
ac_cv_lib_resolv_inet_aton=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_inet_aton" >&5
$as_echo "$ac_cv_lib_resolv_inet_aton" >&6; }
if test "x$ac_cv_lib_resolv_inet_aton" = xyes; then :
LIBS="-lresolv $LIBS";
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: inet_aton is in libresolv, urgh. Must use -lresolv." >&5
$as_echo "$as_me: WARNING: inet_aton is in libresolv, urgh. Must use -lresolv." >&2;}
else
as_fn_error $? "cannot find library function inet_aton" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for adns_init in -ladns" >&5
$as_echo_n "checking for adns_init in -ladns... " >&6; }
if ${ac_cv_lib_adns_adns_init+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ladns $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char adns_init ();
int
main ()
{
return adns_init ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_adns_adns_init=yes
else
ac_cv_lib_adns_adns_init=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_adns_adns_init" >&5
$as_echo "$ac_cv_lib_adns_adns_init" >&6; }
if test "x$ac_cv_lib_adns_adns_init" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBADNS 1
_ACEOF
LIBS="-ladns $LIBS"
fi
ac_fn_c_check_header_mongrel "$LINENO" "adns.h" "ac_cv_header_adns_h" "
# include
# include
# include
# include
# include
# include
# include
# include
"
if test "x$ac_cv_header_adns_h" = xyes; then :
else
as_fn_error $? "adns.h not found" "$LINENO" 5
fi
for ac_func in fmemopen funopen
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
fi
done
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking required gcc -std flag" >&5
$as_echo_n "checking required gcc -std flag... " >&6; }
if ${secnet_cv_gcc_std_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
secnet_cv_gcc_std_flag=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void x(void) { for (int i=0; i<1; i++) { } }
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -std=gnu11"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
void x(void) { for (int i=0; i<1; i++) { } }
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
secnet_cv_gcc_std_flag=" -std=gnu11"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: failure!" >&5
$as_echo "failure!" >&6; }
as_fn_error 1 "cannot get test program to compile" "$LINENO" 5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$old_cflags"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $secnet_cv_gcc_std_flag" >&5
$as_echo "$secnet_cv_gcc_std_flag" >&6; }
CFLAGS="$CFLAGS$secnet_cv_gcc_std_flag"
{ $as_echo "$as_me:${as_lineno-$LINENO}: Checking requirements for IPv6 support..." >&5
$as_echo "$as_me: Checking requirements for IPv6 support..." >&6;}
enable_ipv6=true
ac_fn_c_check_decl "$LINENO" "AF_INET6" "ac_cv_have_decl_AF_INET6" "
# include
# include
# include
# include
# include
# include
# include
# include
#include
"
if test "x$ac_cv_have_decl_AF_INET6" = xyes; then :
else
enable_ipv6=false
fi
ac_fn_c_check_func "$LINENO" "adns_addr2text" "ac_cv_func_adns_addr2text"
if test "x$ac_cv_func_adns_addr2text" = xyes; then :
else
enable_ipv6=false
fi
if $enable_ipv6; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: Enabling IPv6 support" >&5
$as_echo "$as_me: Enabling IPv6 support" >&6;}
$as_echo "#define CONFIG_IPV6 1" >>confdefs.h
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Disabling IPv6 support" >&5
$as_echo "$as_me: WARNING: Disabling IPv6 support" >&2;}
fi
ac_fn_c_check_decl "$LINENO" "adns_if_monotonic" "ac_cv_have_decl_adns_if_monotonic" "
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
# include
#include
"
if test "x$ac_cv_have_decl_adns_if_monotonic" = xyes; then :
$as_echo "#define USE_MONOTONIC 1" >>confdefs.h
else
:
fi
_SUBDIRMK_MAKEFILES="$_SUBDIRMK_MAKEFILES common.make"
ac_config_files="$ac_config_files common.make:common.make.in"
ac_config_commands="$ac_config_commands default"
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
$as_echo "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
case $cache_file in #(
*/* | ?:*)
mv -f confcache "$cache_file"$$ &&
mv -f "$cache_file"$$ "$cache_file" ;; #(
*)
mv -f confcache "$cache_file" ;;
esac
fi
fi
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
as_nl='
'
export as_nl
# Printing a long string crashes Solaris 7 /usr/bin/printf.
as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='printf %s\n'
as_echo_n='printf %s'
else
if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
as_echo_n='/usr/ucb/echo -n'
else
as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
as_echo_n_body='eval
arg=$1;
case $arg in #(
*"$as_nl"*)
expr "X$arg" : "X\\(.*\\)$as_nl";
arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
esac;
expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
'
export as_echo_n_body
as_echo_n='sh -c $as_echo_n_body as_echo'
fi
export as_echo_body
as_echo='sh -c $as_echo_body as_echo'
fi
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# IFS
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent editors from complaining about space-tab.
# (If _AS_PATH_WALK were called with IFS unset, it would disable word
# splitting by setting IFS to empty value.)
IFS=" "" $as_nl"
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
$as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by secnet $as_me 0.1.18+, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
_ACEOF
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
case $ac_config_headers in *"
"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
esac
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
config_commands="$ac_config_commands"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
--header=FILE[:TEMPLATE]
instantiate the configuration header FILE
Configuration files:
$config_files
Configuration headers:
$config_headers
Configuration commands:
$config_commands
Report bugs to ."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
secnet config.status 0.1.18+
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
test -n "\$AWK" || AWK=awk
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
$as_echo "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
$as_echo "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--header | --heade | --head | --hea )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append CONFIG_HEADERS " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h)
# Conflict between --help and --header
as_fn_error $? "ambiguous option: \`$1'
Try \`$0 --help' for more information.";;
--help | --hel | -h )
$as_echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
$as_echo "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
#
# INIT-COMMANDS
#
'$srcdir'/subdirmk/generate --srcdir='$srcdir' $subdirmk_subdirs
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"main.mk") CONFIG_FILES="$CONFIG_FILES main.mk:main.mk.tmp" ;;
"Dir.mk") CONFIG_FILES="$CONFIG_FILES Dir.mk:Dir.mk.tmp" ;;
"Final.mk") CONFIG_FILES="$CONFIG_FILES Final.mk:Final.mk.tmp" ;;
"subdirmk/regen.mk") CONFIG_FILES="$CONFIG_FILES subdirmk/regen.mk:subdirmk/regen.mk.in" ;;
"subdirmk/usual.mk") CONFIG_FILES="$CONFIG_FILES subdirmk/usual.mk:subdirmk/usual.mk.in" ;;
"test-example/Dir.mk") CONFIG_FILES="$CONFIG_FILES test-example/Dir.mk:test-example/Dir.mk.tmp" ;;
"mtest/Dir.mk") CONFIG_FILES="$CONFIG_FILES mtest/Dir.mk:mtest/Dir.mk.tmp" ;;
"stest/Dir.mk") CONFIG_FILES="$CONFIG_FILES stest/Dir.mk:stest/Dir.mk.tmp" ;;
"base91s/Dir.mk") CONFIG_FILES="$CONFIG_FILES base91s/Dir.mk:base91s/Dir.mk.tmp" ;;
"common.make") CONFIG_FILES="$CONFIG_FILES common.make:common.make.in" ;;
"default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' >$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
# Set up the scripts for CONFIG_HEADERS section.
# No need to generate them if there are no CONFIG_HEADERS.
# This happens for instance with `./config.status Makefile'.
if test -n "$CONFIG_HEADERS"; then
cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
BEGIN {
_ACEOF
# Transform confdefs.h into an awk script `defines.awk', embedded as
# here-document in config.status, that substitutes the proper values into
# config.h.in to produce config.h.
# Create a delimiter string that does not exist in confdefs.h, to ease
# handling of long lines.
ac_delim='%!_!# '
for ac_last_try in false false :; do
ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
if test -z "$ac_tt"; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
# For the awk script, D is an array of macro values keyed by name,
# likewise P contains macro parameters if any. Preserve backslash
# newline sequences.
ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
sed -n '
s/.\{148\}/&'"$ac_delim"'/g
t rset
:rset
s/^[ ]*#[ ]*define[ ][ ]*/ /
t def
d
:def
s/\\$//
t bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3"/p
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p
d
:bsnl
s/["\\]/\\&/g
s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\
D["\1"]=" \3\\\\\\n"\\/p
t cont
s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
t cont
d
:cont
n
s/.\{148\}/&'"$ac_delim"'/g
t clear
:clear
s/\\$//
t bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/"/p
d
:bsnlc
s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
b cont
' >$CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
for (key in D) D_is_set[key] = 1
FS = ""
}
/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
line = \$ 0
split(line, arg, " ")
if (arg[1] == "#") {
defundef = arg[2]
mac1 = arg[3]
} else {
defundef = substr(arg[1], 2)
mac1 = arg[2]
}
split(mac1, mac2, "(") #)
macro = mac2[1]
prefix = substr(line, 1, index(line, defundef) - 1)
if (D_is_set[macro]) {
# Preserve the white space surrounding the "#".
print prefix "define", macro P[macro] D[macro]
next
} else {
# Replace #undef with comments. This is necessary, for example,
# in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
if (defundef == "undef") {
print "/*", prefix defundef, macro, "*/"
next
}
}
}
{ print }
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
fi # test -n "$CONFIG_HEADERS"
eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
$as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
$as_echo "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`$as_echo "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
$as_echo X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
:H)
#
# CONFIG_HEADER
#
if test x"$ac_file" != x-; then
{
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
} >"$ac_tmp/config.h" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
$as_echo "$as_me: $ac_file is unchanged" >&6;}
else
rm -f "$ac_file"
mv "$ac_tmp/config.h" "$ac_file" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
fi
else
$as_echo "/* $configure_input */" \
&& eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
;;
:C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
$as_echo "$as_me: executing $ac_file commands" >&6;}
;;
esac
case $ac_file$ac_mode in
"default":C) echo timestamp >config.stamp ;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded. So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status. When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
ac_config_status_args=
test "$silent" = yes &&
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
work/configure.ac 0000664 0000000 0000000 00000012436 15063477206 011236 0 ustar dnl Process this file with autoconf to produce a configure script.
dnl This file is part of secnet.
dnl See README for full list of copyright holders.
dnl
dnl secnet is free software; you can redistribute it and/or modify it
dnl under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 3 of the License, or
dnl (at your option) any later version.
dnl
dnl secnet is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl version 3 along with secnet; if not, see
dnl https://www.gnu.org/licenses/gpl.html.
sinclude(ac_prog_cc_no_writeable_strings.m4)
m4_include(subdirmk/subdirmk.ac)
AC_INIT(secnet,0.1.18+,secnet-discuss@chiark.greenend.org.uk)
AC_CONFIG_SRCDIR(secnet.c)
AC_CONFIG_HEADER(config.h)
SUBDIRMK_SUBDIRS([test-example mtest stest base91s])
AC_PREREQ(2.50)
AC_REVISION($Id: configure.in,v 1.4 2002/09/09 22:05:02 steve Exp $)
AC_LANG_C
# If fink is on the path then it is assumed we should use it.
AC_PATH_PROG([FINK],[fink])
if test "x$FINK" != x; then
finkdir=`echo $FINK|sed 's,/[[^/]]*/[[^/]]*$,,'`
CPPFLAGS="-I$finkdir/include ${CPPFLAGS}"
LDFLAGS="-L$finkdir/lib ${LDFLAGS}"
fi
# This is quite unpleasant. It turns out that most header checking
# macros call AC_INCLUDES_DEFAULT. By default AC_INCLUDES_DEFAULT
# implies AC_HEADER_STDC and a bunch of conditional includes. But
# these header checks are obsolete as the documentation for
# AC_HEADER_STDC says. Instead, define AC_INCLUDES_DEFAULT ourselves.
# The list of headers below is the list from `(autoconf) Default
# Includes' (filtered by hand for the modern ones rather than the
# fallbacks). We must include $1 because AC_INCLUDES_DEFAULT is
# called with an argument giving the check-specific haders.
m4_define([AC_INCLUDES_DEFAULT],[
# include
# include
# include
# include
# include
# include
# include
# include
$1
])
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_CHECK_HEADERS([net/if.h net/route.h])
AC_CHECK_HEADERS([sys/socket.h])
AC_CHECK_HEADERS([linux/if_tun.h], [], [],
[#if HAVE_SYS_SOCKET_H
# include
#endif
])
AC_CHECK_HEADERS([stropts.h sys/sockio.h net/if_tun.h])
AC_C_BIGENDIAN
AC_PROG_CC_NO_WRITEABLE_STRINGS(WRITESTRINGS)
AC_ARG_ENABLE(hacky-parallel,
[AS_HELP_STRING([--enable-hacky-parallel],
[parallelise slow cryptography (default is no)])], [
case "$enableval" in
n|0|no) ;;
y|1|yes) CFLAGS="$CFLAGS -DHACKY_PARALLEL" ;;
*) ;;
esac
])
AC_DEFUN([REQUIRE_HEADER],[AC_CHECK_HEADER($1,,[AC_MSG_ERROR($1 not found)])])
dnl the order in which libraries is checked is important
dnl eg. adns on Solaris 2.5.1 depends on -lnsl and -lsocket
AC_CHECK_LIB(gmp,mpz_init_set_str)
AC_CHECK_LIB(gmp2,mpz_init_set_str)
AC_CHECK_LIB(gmp,__gmpz_init_set_str)
REQUIRE_HEADER([gmp.h])
dnl Would love to barf if no gmp was found, but how to test? Requiring the header will do for now.
SECNET_C_GETFUNC(inet_ntoa,nsl)
AC_CHECK_LIB(socket,socket)
SECNET_C_GETFUNC(inet_aton,resolv)
AC_CHECK_LIB(adns,adns_init)
REQUIRE_HEADER([adns.h])
AC_CHECK_FUNCS([fmemopen funopen])
dnl gcc 4.9.2 (jessie) requires -std=gnu11 to cope with for (int i=...
dnl but we do not want to pass that everywhere because we don't want
dnl to nail down the C dialect this way. Why oh why oh why.
m4_define([for_gcc_std],[
void x(void) { for (int i=0; i<1; i++) { } }
])
AC_CACHE_CHECK([required gcc -std flag],[secnet_cv_gcc_std_flag],[
secnet_cv_gcc_std_flag=""
AC_COMPILE_IFELSE([AC_LANG_SOURCE(for_gcc_std)],[],[
old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -std=gnu11"
AC_COMPILE_IFELSE([AC_LANG_SOURCE(for_gcc_std)],[
secnet_cv_gcc_std_flag=" -std=gnu11"
],[
AC_MSG_RESULT([failure!])
AC_MSG_ERROR([cannot get test program to compile],1)
])
CFLAGS="$old_cflags"
])
])
CFLAGS="$CFLAGS$secnet_cv_gcc_std_flag"
AC_MSG_NOTICE([Checking requirements for IPv6 support...])
enable_ipv6=true
m4_define(NO_IPV6,[enable_ipv6=false])
AC_CHECK_DECL(AF_INET6, [],[NO_IPV6],[#include ])
AC_CHECK_FUNC(adns_addr2text, [],[NO_IPV6])
if $enable_ipv6; then
AC_MSG_NOTICE([Enabling IPv6 support])
AC_DEFINE(CONFIG_IPV6, 1,
[Define to 1 to use IPv6 support in system and adns])
else
AC_MSG_WARN([Disabling IPv6 support])
fi
AC_CHECK_DECL([adns_if_monotonic],[
AC_DEFINE([USE_MONOTONIC],[1],[Use CLOCK_MONOTONIC and adns_if_monotonic])
],[
: dnl AC_MSG_WARN([Using non-monotonic clock, due to lack of adns_if_monotonic])
],[AC_INCLUDES_DEFAULT
#include
])
SUBDIRMK_MAKEFILES(common.make)
AC_OUTPUT(,
echo timestamp >config.stamp)
AH_TOP([
#ifndef _CONFIG_H
#define _CONFIG_H
])
AH_BOTTOM([
/* -*- c -*- */
/* These used to be in config.h.bot, but are now in configure.in. */
#ifdef __GNUC__
#define NORETURN(_x) void _x __attribute__ ((noreturn))
#define FORMAT(_a,_b,_c) __attribute__ ((format (_a,_b,_c)))
#else
#define NORETURN(_x) _x
#define FORMAT(_a,_b,_c)
#endif
#endif /* _CONFIG_H */
])
work/debian/ 0000775 0000000 0000000 00000000000 15063477206 010164 5 ustar work/debian/.gitignore 0000664 0000000 0000000 00000000071 15063477206 012152 0 ustar autoreconf.after
autoreconf.before
debhelper-build-stamp
work/debian/README.source 0000664 0000000 0000000 00000002145 15063477206 012345 0 ustar The source code for this package is maintained in git.
The primary upstream branch is here:
https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git/secnet.git/
Upstream releases are announced here:
https://www.chiark.greenend.org.uk/mailman/listinfo/sgo-software-announce
There is no distinction between the upstream and Debian branches
at this time. We don't maintain a Debian delta (patches), nor Debian
revision numbers.
Some items are included using git-subtree, notably subdirmk:
This designed to be "git-subtree"'d into one's package. That
is the way the upstream package uses it.
It would be possible to make it a separate package and build-depend on
it, at the cost of some additional work. The upside would be a very
small amount of disk space saving, and largely theoretical saving of
work in case of a need to do a security update for subdirmk (which
seems unlikely to be critical since it's build system software which
is designed to execute its input) - and that all only in the case
where a second package in Debian uses subdirmk.
We are deferring this work until subdirmk becomes more widely used.
work/debian/changelog 0000664 0000000 0000000 00000062132 15063477206 012042 0 ustar secnet (0.6.8) unstable; urgency=medium
* Avoid using `bool`, `false` and `true` as identifiers.
Fixes conflicts with modern C and GCC-15. Closes: #1097866.
* Remove now-false caveat that hippotat isn't packaged. It is, now.
[Report from Tomas Pospisek] Closes: #1066029.
-- Ian Jackson Sat, 20 Sep 2025 11:14:30 +0100
secnet (0.6.7) unstable; urgency=medium
* Upstream release of changes since 0.6.2.
(Versions 0.6.5 and 0.6.6 were Debian-only; 0.6.3 and 0.6.4
were not properly released at all and should be disregarded.)
Packaging bugfix:
* Update VERSION in Makefile.
-- Ian Jackson Mon, 09 Jan 2023 00:15:21 +0000
secnet (0.6.6) unstable; urgency=medium
Bugfix:
* polypath: Do not separately log xmit failures.
Tests:
* stest: Fix debugging output about spawning secnet
Packaging:
* Add missing build-dependency on netbase. Closes: #1028102.
* Copyright notices and LICENCE (aka debian/copyright) fixes
and improvements. [Requested by Debian ftpmaster]
* Add Debian upload step to release checklist.
-- Ian Jackson Sun, 08 Jan 2023 18:20:09 +0000
secnet (0.6.5) unstable; urgency=medium
Copyright and source code notices:
* Include notices and licences of all included elements in LICENCE,
not just in the files themselvves.
* Tidy up a handful of notices to the most recent facts.
* Do not claim CC-BY-SA 4.0 is GPL3+ compatible - only GPL3.
* Add a README.source.
* Update my own copyright year.
* Versions 0.6.3 and 0.6.4 burned due to failed uploads.
(See dgit bug #944855.)
-- Ian Jackson Sat, 12 Nov 2022 18:58:02 +0000
secnet (0.6.2) unstable; urgency=medium
Bugfixes to code and build system:
* site: promote creation of st->scratch, allowing new pubkey scheme
to work even when secnet is restarting.
* comm-common.h: Remove unused `notify' variable. [Colin Watson]
* Dir.sd.mk: Prevent builtin make rule overwriting conffile.c.
Documentation:
* configure: Correct bug reporting address. Report from Colin Watson.
* example.conf improvements:
- Comment out some tuning overrides
- Improve syntax by deleting one of the two map examples
- Add a commented-out mobile site setting
- Add mtu-target
* OLD-NEWS, OLD-BUGS: Rename from NEWS and BUGS, and don't ship OLD-BUGS.
Debian packaging changes:
* debian/rules: Use dh sequencer. Resulting changes:
- We now provide debug symbols in the new Debian way.
- The way the prerm stops secnet accords with modern practice.
* init script: source /lib/lsb/init-functions.
* init script: make "restart" work if secnet is not running.
* Expand Description.
* debhelper compat: bump to 12 (stretch-backports).
* debian/rules: Use dh_prep instead of deprecated dh_clean -k.
* Adjust Priority (as per modern policy and lintian).
* Add some lintian overrides.
* Add missing Pre-Depends on init-system-helpers.
Credits and legal documentation improvements:
* Add missing credits for base91 and python argparse extension.
ensure some packaging credits exist in all the places they should be.
* Add copyright/credits notices to many files which were missing them.
* Move and centralise legal information into its own file, LICENCE.
Testing improvements:
* comprehensive-test: Actually allow OLD_SECNET_DIR set to ''
* test-example/common.conf: Fix a reference to the sites file.
* test-example/null-fake-userv: New test utility script.
-- Ian Jackson Thu, 30 Dec 2021 15:10:12 +0000
secnet (0.6.1) unstable; urgency=medium
Logging bugfixes:
* Fix completely broken startup logging. Config errors would not
be repoorted other than via the exit status! (Broken in 0.6.0.)
* Suppress various uninteresting messages during startup, to
avoid noise during successful startup.
* Move "starting" message earlier.
make-secnet-sites bugfixes:
* Fix error handling if caller is in wrong group.
* Fix regressions in handling of delegated sites file fragments
(especially wrt the optional group parameter to `location').
Broken since security fixes in 0.5.0.
Fixes to example config file:
* Use new name-prefixed format for map(site...) runes. Old runes
were desupported by make-secnet-sites security fix (in 0.5.0).
* Fix "transform" syntax (broken since 0.3.0).
Other bugfixes and improvements:
* rsa: Do not crash if private key file is not accessible when
running --just-check-config. (Broken since 0.6.0.)
* rsa: Print errno value if we fail to open key file.
* config parsing: When closure is of wrong type, give details.
* Use CLOCK_MONOTONIC for all our timing needs (but only when
built against an as-yet-unpublished adns feature).
Supporting changes:
* Tests for some of the changes.
* Minor internal refactorings and improvements.
* Merge subdirmk 1.0.
-- Ian Jackson Sun, 24 May 2020 22:14:26 +0100
secnet (0.6.0) unstable; urgency=medium
Bugfixes:
* mobile sites: Do not ever expire peer addresses. In practice
this fixes transitions between IPv6-only and IPv4-only networks.
* make-secnet-sites: Tainted: Fix a lot of bad return values
(which would result in assertions rather than nice error messages).
* Fix hash algo confusion in mixed sha1/md5 configurations (see below).
Incompatible changes:
* site: Always advertise all capabilities, even in MSG1. This is
incompatible with secnets earlier than 0.3.0 (September 2013), which
are all quite badly broken and should have been upgraded long ago.
* Drop support for using the same loaded rsa key with multiple different
hash algorithms (which was broken in 0.5.0). Right now we support
only `sha1' and `md5' so everyone should be using `sha1'.
Installations which specified `md5' anywhere may need config changes.
Major new featureset (use of which is not adviseable yet):
* New facilities for negotiating about the signing keys to use for
authentication during key setup, and selecting and using the
appropriate keys. (``key-cache'/`privcache' and `peer-keys').
Using these new facilities for keyrollover now is in principle
possible but rather complex. Further machinery is planned;
for now, retain your existing config which should keep working.
In summary:
- secnet: new `privcache' closure;
- secnet: `key-cache' and `peer-keys' keys on site closures;
- secnet: new file format for peer public keysets;
- secnet: new `make-public' config operator;
- make-secnet-sites `pub', `pkg', `serial', etc. keywords;
- make-secnet-sites --filter, --pubkeys-*, --output-version.
More minor (logging) improvements:
* Make stderr line buffered and log to it by default.
* Do not log differently with --nodetach.
* New `prefix' option to `logfile' closure.
* Tidy and simplify some messages.
Supporting changes:
* Many substantial internal refactorings in secnet.
* Many substantial internal refactorings in make-secnet-sites.
* make-secnet-sites option parsing totally replaced.
* Imported subtrees for base91-c and base91-python.
* New portablity code, etc.: osdep.[ch], fmemopen reimplementation.
* Explicitly define oddly-rotated dh padding arrangement (write_mpbin).
Build system and packaging:
* Do not fail to build from git when HEAD refers to a packed ref.
* Update to subdirmk 0.3.
* Many makefile fixes (esp. to clean and cdeps).
* configure.ac: Drop or suppress some very obsolete checks.
* autogen.sh: Write a comment about need for autoheader.
* dir-locals: Provide python-indent-offset too.
Test suite bugfixes:
* stest: Use stderr, not tty, for logging.
* stest/udp-preload.c: Fix error handling of sun_prep.
* stest: Fix breakage if nproc is not installed.
Test suite improvements:
* New tests, including tests for new features.
* Existing tests (especially stest) generally made more thorough.
* New comprehensive-test and pretest-to-tested convenience scripts.
* Arrangements for testing with (user-provided) old secnet.
* parallel-test.*: scripts to help with parallelised bisection.
* stest: Print a lot more output about what we are doing.
* stest: Better support for cwd with longish pathname.
* stest: More flexibility, env var hooks, etc.
-- Ian Jackson Sun, 16 Feb 2020 12:48:13 +0000
secnet (0.5.1) unstable; urgency=medium
POTENTIALLY INCOMPATIBLE CHANGE. Some security implications.
* make-secnet-sites: Prefix names when writing secnet sites.conf file.
make-secnet-sites must copy names (vpn, location and site names) from
the input sites file (which is not wholly trusted) to the secnet
config file. Prior to this release, naming a location or site the
same as a secnet predefined name could generate a broken sites.conf
which secnet would reject. (With the existing featureset,
malfunctions other than rejection, eg privilege escalation, are not
possible.)
make-secnet-sites now adds a prefix to these names when writing
sites.conf. This will not affect configurations which use the
make-secnet-sites-provided `all-sites' key, as is usual. Other
configurations will break unless the references in the static part of
the config are adjusted.
Previous behaviour can be restored with the --no-conf-key-prefix
option. (Planned future enhancements to secnet are likely to make use
of that option, with untrusted input, dangerously insecure.)
other changes to make-secnet-sites:
* Fix argument parsing. Fixes a regression affecting -P in 0.5.0,
and also fixes new facilities introduced in 0.5.0.
* Sort the properties on output (and adjust the test case expected
outputs). Tests now pass on (at least) Python 2.7.13, 3.5.3, 3.7.5.
* Delete some unused code.
secnet:
* Change one idiom to avoid a warning from GCC9. No functional change.
build system - MAJOR CHANGES:
* Fix out-of-tree builds. (Broken in 0.5.0)
* Replace recursive make with use of the new subdirmk system.
This represents a fairly comprehensive overhaul of the makefiles.
Several bugs (esp. involving dependencies between files in different
directories) are fixed.
* Drop `make check' from `make all'. (Otherwise there is no way
to ask for `all' without `check'.)
* Suppress two unhelpful new compiler warnings from GCC9.
* Release checklist update.
documentation:
* Credit Mark Wooding properly in CREDITS.
* Include DEVELOPER-CERTIFICATE.
tests:
* Locations now have different names to sites.
* Somewhat better debugging output from mtest.
* Do not run msgcode-test except with `make fullcheck'.
* Other minor bugfixes and improvments.
* stest: Suppress unhelpful -Wno-unused-result (needed for stretch).
-- Ian Jackson Fri, 22 Nov 2019 23:13:14 +0000
secnet (0.5.0) unstable; urgency=medium
make-secnet-sites SECURITY FIX:
* Do not blindly trust inputs; instead, check the syntax for sanity.
Previous releases can be induced to run arbitrary code as the user
invoking secnet (which might be root), if a secnet sites.conf is used
that was generated from an untrustworthy sites file.
* The userv invocation mode of make-secnet-sites seems to have been safe
in itself, but it previously allowed hazardous data to be propagated
into the master sites file. This is now prevented too.
make-secnet-sites overhaul work:
* make-secnet-sites is now in the common subset of Python2 and Python3.
The #! is python3 now, but it works with Python2.7 too.
It will probably *not* work with old versions of Python2.
* We no longer depend on the obsolete `ipaddr' library. We use
`ipaddress' now. And this is onlo a Recommends in the .deb.
* Ad-hoc argument parser been replaced with `argparse'.
There should be no change to existing working invocations.
* Bad address syntax error does not wrongly mention IPv6 scopes.
* Minor refactoring to support forthcoming work. [Mark Wooding]
other bugfixes, improvements and changes to secnet itself:
* Better logging of why we are sending NAK messages.
* Correctly use the verified copy of the peer remote capabilities
from MSG3. (Bug is not a vulnerability.) [Mark Wooding]
* Significant internal rearrangements and refactorings, to support
forthcoming key management work. [Mark Wooding and Ian Jackson]
build system etc.:
* Completely overhaul release checklist; drop dist target.
* Remove dependency on `libfl.a'. [Mark Wooding]
* polypath.c: Fix missing include of . [Mark Wooding]
* Add a Wireshark dissector `secnet-wireshark.lua'. It is not
installed anywhere right now. [Mark Wooding]
documentation:
* Improve documentation of capability negotiation in NOTES, secnet(8)
and magic.h. [Mark Wooding]
-- Ian Jackson Thu, 24 Oct 2019 19:11:54 +0100
secnet (0.4.5) unstable; urgency=medium
* INSTALL: Mention that rsa key generation might need ssh-keygen1.
* mobile: Fix negotiation bug with mixed old/new secnets and
simultaneous key setup attempts by each end. [Mark Wooding]
* Makefile.in: Support installation from a `VPATH' build. [Mark Wooding]
* Portability fixes for clang. [Mark Wooding]
-- Ian Jackson Sat, 21 Sep 2019 12:04:31 +0100
secnet (0.4.4) unstable; urgency=medium
Security fix:
* make-secnet-sites: Don't allow setting new VPN-level properties
when restricted. This could allow denial of service by
users with delegated authorisation. [Mark Wooding]
Bugfixes for poor network environments:
* polypath: cope properly with asymmetric routing, by correcting
the handling of late duplicated packets etc. Protocol is now
incompatible with secnet prior to 0.3.0 when either end is mobile.
* Randomise key setup retry time.
Other bugfixes:
* rsa and cbcmac: Fix configuration error messages. [Mark Wooding]
* Handle IPv4 addresses properly (ie, not foolishly byte-swapped),
when IPv6 is not available. [Mark Wooding]
* Better logging (and less foolish debug), especially about whether
key is set up, and about crossed key setup attempts.
* Internal refactoring and fixes. [Ian Jackson and Mark Wooding]
Build system and portability:
* configure: rerun autogen.sh with autoconf 2.69-10
* Avoid memset(0,0,0) wrt st->sharedsecret. (Fixes compiler warning;
in theory might cause miscompilation.) [Mark Wooding]
Documentation:
* README.make-secnet-sites: new documentation file. [Mark Wooding]
* NOTES: Describe current allocation of capability bits. [Mark Wooding]
* NOTES: tiny fix tot protocol description.
* secnet(8): Delete wrong information about dh groups. [Mark Wooding]
Administrivia:
* Fix erroneous GPL3+ licence notices "version d or later" (!)
* .dir-locals.el: Settings for Python code. [Mark Wooding]
-- Ian Jackson Sun, 08 Sep 2019 22:53:14 +0100
secnet (0.4.3) unstable; urgency=low
Security improvement:
* Use `mpz_powm_sec' for modexps.
Enhancements:
* Implement comm-info and dedicated-interface-addr feature, for
benefit of hippotat.
* Implement `keepalive' site option, to try to keep link always up.
Build etc. fixes:
* #include (fixes the build on jessie).
* Tolerate building from a git checkout, but with git not installed.
(This can happen in chroots.)
* Turn off -Wsign-compare for bison output.
* Makefile.in: Fix `check-ipaddrset' rule to get reference from
$(srcdir). (Makes out-of-tree builds work properly.)
* Release checklist fixes.
* Burn version numbers 0.4.1 and 0.4.2 due to errors in release prep.
Bugfixes:
* When printing messages about dropping IPv6, do not print anything
about ihl. (Check the IP version field first!)
* When turning on debug, turn on verbose too.
-- Ian Jackson Sat, 25 Nov 2017 13:36:41 +0000
secnet (0.4.0) unstable; urgency=low
Debugging improvements:
* Packet-level debugging from site notes errors from transmit.
* Report when transport peers updated as a result of transmit.
-- Ian Jackson Sat, 28 Feb 2015 15:03:00 +0000
secnet (0.4.0~beta2) unstable; urgency=low
Polypath bugfixes:
* Ignore IPv6 Unique Local unicast addresses.
* Skip "tentative" IPv6 local addresses.
* Improve logging and debug output.
Portability fix:
* Build where size_t is not compatible with int.
Build system and packaging fixes:
* Makefile: support DESTDIR.
* debian/rules: set DESTDIR (not prefix).
* debian/rules: Support dpkg-buildflags.
* Install ipaddrset.py and secnet.8 with correct permissions.
* Fix check for and git rid of our copy.
* Use -lresolv only if inet_aton is not found otherwise.
* Use -lnsl only if inet_ntoa is not found otherwise.
* debian/rules: Provide build-arch and build-indep targets.
* debian/rules: Do not run build for *-indep (!)
* Makefile.in: Putative dual (backport and not) release build process doc.
Copyright updates:
* Update to GPLv3. Add missing copyright notices and credits.
* Get rid of old FSF street address; use URL instead.
* Remove obsolete LICENCE.txt (which was for snprintf reimplementation).
* Remove obsolete references to Cendio (for old ipaddr.py).
-- Ian Jackson Sun, 28 Dec 2014 17:14:10 +0000
secnet (0.4.0~beta1) unstable; urgency=low
New features:
* Support transport over IPv6. (We do not yet carry IPv6 in the private
network.) IPv6 support depends on IPv6-capable adns (adns 1.5.x).
* New polypath comm, which can duplicate packets so as to send them via
multiple routes over the public network, for increased
reliability/performance (but increased cost). Currently Linux-only
but should be fairly easy to port.
* Support multiple public addresses for peers.
* Discard previously-received packets (by default).
Logging improvements:
* Report (each first) transmission and reception success and failure.
* Log reason for DNS reolution failure.
* Log unexpected kinds of death from userv.
* Log authbind exit status as errno value (if appropriate).
Configuration adjustments:
* Adjust default number of mobile peer addresses to store when a peer
public address is also configured.
* Make specifying peer public port optional. This avoids making special
arrangements to bind to a port for in mobile sites with no public
stable address.
Bugfixes:
* Hackypar children will die if they get a terminating signal.
* Fix signal dispositions inherited by secnet's child processes.
* Fix off-by-one error which prevented setting transport-peers-max to 5.
Test, build and internal improvements:
* Use conventional IP address handling library ipaddr.py.
* Provide a fuzzer for the slip decoder.
* Build system improvements.
* Many source code cleanups.
-- Ian Jackson Sun, 26 Oct 2014 15:28:31 +0000
secnet (0.3.4) unstable; urgency=low
SECURITY FIX:
* The previous security fix to buffer handling was entirely wrong. This
one is better. Thanks to Simon Tatham for the report and the patch.
-- Ian Jackson Mon, 22 Sep 2014 16:16:11 +0100
secnet (0.3.3) unstable; urgency=high
SECURITY FIXES:
* Pass correct size argument to recvfrom. This is a serious security
problem which may be exploitable from outside the VPN.
* Fix a memory leak in some error logging.
Other related fixes:
* Two other latent bugs in buffer length handling found and fixed.
* Non-critical stylistic improvements to buffer length handling, to make
the code clearer and to assist audit.
-- Ian Jackson Fri, 19 Sep 2014 23:50:45 +0100
secnet (0.3.3~beta1) unstable; urgency=low
Installation compatibility fix:
* In make-secnet-sites, always use our own ipaddr.py even if the
incompatible modern ipaddr.py is installed (eg via python-ipaddr.deb).
(Future versions of secnet are going to need that Python module to be
installed.)
For links involving mobile sites:
* Use source of NAK packets as hint for peer transport address.
* When initiating rekey, make use of data transport peer addresses.
Build fix:
* Provide clean target in test-example/Makefile.
-- Ian Jackson Fri, 19 Sep 2014 00:11:44 +0100
secnet (0.3.2) unstable; urgency=low
* Release of 0.3.2. No code changes since 0.3.1~beta1.
-- Ian Jackson Thu, 26 Jun 2014 20:27:58 +0100
secnet (0.3.2~beta1) unstable; urgency=low
For links involving mobile sites:
* SECURITY: Properly update peer address array when it is full.
* Do name-resolution on peer-initiated key setup too, when we are mobile
(and other name-resolution improvements).
Other minor improvements:
* Log peer addresses on key exchange timeout.
* When printing version (eg during startup), use value from git-describe
and thus include git commit id where applicable.
* Updates to release checklist in Makefile.in.
* Use C99 _Bool for bool_t.
-- Ian Jackson Fri, 06 Jun 2014 01:17:54 +0100
secnet (0.3.1) unstable; urgency=low
* Release of 0.3.1. No code changes since 0.3.1~beta3.
-- Ian Jackson Thu, 15 May 2014 01:08:30 +0100
secnet (0.3.1~beta3) unstable; urgency=low
* Build fixes for non-i386 architectures and gcc 4.8.2.
-- Ian Jackson Thu, 08 May 2014 19:53:43 +0100
secnet (0.3.1~beta2) unstable; urgency=low
Fix relating to new fragmentation / ICMP functionality:
* Generate ICMP packets correctly in point-to-point configurations.
-- Ian Jackson Sat, 03 May 2014 18:58:09 +0100
secnet (0.3.1~beta1) unstable; urgency=low
Security fixes (vulnerabilities are to inside attackers only):
* SECURITY: Fixes to MTU and fragmentation handling.
* SECURITY: Correctly set "unused" ICMP header field.
* SECURITY: Fix IP length check not to crash on very short packets.
New feature:
* Make the inter-site MTU configurable, and negotiate it with the peer.
Bugfixes etc.:
* Fix netlink SEGV on clientless netlinks (i.e. configuration error).
* Fix formatting error in p-t-p startup message.
* Do not send ICMP errors in response to unknown incoming ICMP.
* Fix formatting error in secnet.8 manpage.
* Internal code rearrangements and improvements.
Packaging improvements:
* Updates to release checklist in Makefile.in.
* Additions to the test-example suite.
-- Ian Jackson Thu, 01 May 2014 19:02:56 +0100
secnet (0.3.0) unstable; urgency=low
* Release of 0.3.0. No code changes since 0.3.0~beta3.
* Update release checklist.
-- Ian Jackson Sun, 01 Sep 2013 20:27:48 +0100
secnet (0.3.0~beta3) unstable; urgency=low
* New upstream version.
- Stability bugfix: properly initialise site's scratch buffer.
-- Ian Jackson Mon, 05 Aug 2013 11:54:09 +0100
secnet (0.3.0~beta2) unstable; urgency=low
* New upstream version.
- SECURITY FIX: RSA public modulus and exponent buffer overflow.
- SECURITY FIX: Use constant-time memcmp for message authentication.
- SECURITY FIX: Provide a new transform, eax-serpent, to replace cbcmac.
- SECURITY FIX: No longer send NAKs for NAKs, avoiding NAK storm.
- SECURITY FIX: Fix site name checking when site name A is prefix of B.
- SECURITY FIX: Safely reject too-short IP packets.
- Better robustness for mobile sites (proper user of NAKs, new PROD msg).
- Better robustness against SLIP decoding errors.
- Fix bugs which caused routes to sometimes not be advertised.
- Protocol capability negotiation mechanism.
- Improvements and fixes to protocol and usage documentation.
- Other bugfixes and code tidying up.
-- Ian Jackson Thu, 25 Jul 2013 18:26:01 +0100
secnet (0.3.0~beta1) unstable; urgency=low
* New upstream version.
- SECURITY FIX: avoid crashes (or buffer overrun) on short packets.
- Bugfixes relating to packet loss during key exchange.
- Bugfixes relating to link up/down status.
- Bugfixes relating to logging.
- make-secnet-sites made more sophisticated to support two vpns on chiark.
- Documentation improvements.
- Build system improvements.
* Debian packaging improvements:
- Native package.
- Maintainer / uploaders.
- init script requires $remove_fs since we're in /usr.
-- Ian Jackson Thu, 12 Jul 2012 20:18:16 +0100
secnet (0.2.1-1) unstable; urgency=low
* New upstream version. (authbind endianness fix)
-- Ian Jackson