pax_global_header 0000666 0000000 0000000 00000000064 14014612315 0014507 g ustar 00root root 0000000 0000000 52 comment=3eba02ef820a393bd5781be9f8fcda1611ae7c3d
lacme-0.8.0/ 0000775 0000000 0000000 00000000000 14014612315 0012575 5 ustar 00root root 0000000 0000000 lacme-0.8.0/.gitignore 0000664 0000000 0000000 00000000043 14014612315 0014562 0 ustar 00root root 0000000 0000000 # vim swapfiles
.*.sw[po]
/build/
lacme-0.8.0/COPYING 0000664 0000000 0000000 00000104517 14014612315 0013640 0 ustar 00root root 0000000 0000000 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
.
lacme-0.8.0/Changelog 0000664 0000000 0000000 00000026240 14014612315 0014413 0 ustar 00root root 0000000 0000000 lacme (0.8.0) upstream;
* Breaking change: 'challenge-directory' now needs to be set to an
*existing* directory (writable by the lacme client user). Since
lacme(8) spawns a builtin webserver by default the change doesn't
affect default configurations.
Thanks to Benjamin Tietz for the idea and initial patch.
* Breaking change: the 'iptables' option is now ignored unless the
builtin webserver is used.
* Unprivileged user/group for the internal client resp. webserver are
now configurable at install time.
* lacme: new flag `--force`, which aliases to `--min-days=-1`, i.e.,
forces renewal regardless of the expiration date of existing
certificates.
* Remove decomissioned intermediate CAs Authority X3 and X4 from the
bundle.
* Remove cross-signed intermediate CAs from the bundle and add the
(self-signed) ISRG Root X1 and X2 instead. This allows us to fully
validate provided X.509 chains using that self-contained bundle,
regardless of which CAs is marqued as trusted under /etc/ssl/certs.
This change bumps the minimum OpenSSL version to 1.1.0.
* Breaking change: lacme(8) and lacme-accountd(1) respectively load
their configuration file from /etc/lacme/lacme.conf resp.
/etc/lacme/lacme-accountd.conf when running as root, and
$XDG_CONFIG_HOME/lacme/lacme.conf resp.
$XDG_CONFIG_HOME/lacme/lacme-accountd.conf when running as a normal
user. There is no fallback to /etc anymore, and the lookup in the
current directory as prefered choice is removed too. However
lacme-accountd(1) can be used without configuration file under
~/.config/lacme as it treats a non-existent default location as an
empty file.
* The client, webserver, and accountd commands are now split on
whitespace. This doesn't change the default behavior but allows
using `ssh -T lacme@account.example.net lacme-accountd` to spawn a
remote lacme-accountd server for instance.
* Add test suite against Let's Encrypt's staging environment
https://letsencrypt.org/docs/staging-environment/ .
* lacme(8)'s 'config' option in the [accountd] section no longer have a
default value. The previous default /etc/lacme/lacme-accountd.conf
is still honored when root privileges are preserved (the default).
* Deprecate setting 'privkey' in [accountd] section of the lacme(8)
configuration file. One need to use the lacme-accountd(1)
configuration file for that instead.
* lacme(8): add %-specifiers support for --config=, --socket=,
--config-certs= (and 'socket'/'config-certs'/'challenge-directory'
configuration options *before* privilege drop; and for the [accountd]
section 'command'/'config' configuration options *after* privilege
drop).
* lacme-accountd(1): add %-specifiers support for --config=, --socket=
and --privkey= (and 'socket'/'privkey' configuration options).
* lacme-accountd(1): base64url-decode incoming signature requests shown
in messages to the standard error.
* lacme-accountd(1): new setting 'logfile' to log (decoded) incoming
signature requests to a file.
* lacme-accountd(1): new setting 'keyid' to easily revoke all account
management access from the client.
+ Improve nginx/apache2 snippets for direct serving of challenge files
(with the new 'challenge-directory' logic symlinks can be disabled).
+ Split Nginx and Apapche2 static configuration snippets into seperate
files. That way users prefering that over reverse-proxying can just
source/enable the relevant files without having to uncomment
anything.
+ Add support for TLS Feature extension from RFC 7633; this is mostly
useful for OCSP Must-Staple.
+ client: use "lacme-client/$VERSION" as User-Agent header.
+ Consolidate error messages for consistency.
+ Sanitize environment when spawning the lacme client, webserver and
accountd.
+ accountd: replace internal option --conn-fd=FD with flag --stdio.
Using stdin/stdout makes it possible to tunnel the accountd
connection through ssh. The new flag is documented to allow safe
usage is authorized_keys(5) restrictions.
+ Remove dependency on List::Util (core module).
+ accountd: Pass JWA and JWK thumbprint via extended greeting data.
This gives better forward flexibility.
- lacme: delay webserver socket shutdown to after the process has
terminated.
- documentation: suggest to generate private key material with
genpkey(1ssl); also suggest a command to generate an ECDSA key not
just RSA; hint at which key algorithms are supported.
- documentation: clarify that "file:/path/to/account.key" can point to
a symmetrically-encrypted private key.
- documentation: emphasize default values in the config file, and move
the most common options ('hash', 'keyUsage', 'CAfile', 'min-days') to
the default section.
- Raise client timeout from 10 to 30s.
- Remove dependency on Types::Serialiser.
- client: fail immediately when the accountd is unreachable.
- Makefile: set executable bit for $(bindir)/lacme-accountd and
$(sbindir)/lacme.
- client: avoid "Use of uninitialized value in pattern match (m//)"
perl warnings when the accountd socket can't be reached.
- webserver: reopen stdin from /dev/null.
- Use 'acme-challenge.XXXXXXXXXX' as template for the temporary ACME
challenge directory.
- Set the DEBUG environment variable to 0/1 instead of ""/1.
- Use File::Basename::dirname() to correctly extract the parent
directory of the socket path.
- client: Print Terms of Service URL for 'account' command.
-- Guilhem Moulin Mon, 22 Feb 2021 03:19:57 +0100
lacme (0.7) upstream;
* Breaking change: the certificate indicated by 'CAfile' is no longer
used as is in 'certificate-chain' (along with the leaf cert). The
chain returned by the ACME v2 endpoint is used instead. This allows
for more flexibility with respect to key/CA rotation, cf.
https://letsencrypt.org/2020/11/06/own-two-feet.html and
https://community.letsencrypt.org/t/beginning-issuance-from-r3/139018
+ 'CAfile' now defaults to @@datadir@@/lacme/ca-certificates.crt which
is a concatenation of all known active CA certificates (which
includes the previous default).
-- Guilhem Moulin Wed, 25 Nov 2020 23:39:39 +0100
lacme (0.6.1) upstream;
+ Adapt Apache2 snippet to Apache2 2.4.
+ Ignore [accountd] section from lacme.conf when the --socket option is
defined. This allows remotely-controlled lacme processes being
controlled without modifying an config files.
* Makefile: major refactoring, add install and uninstall targets, honor
BUILD_DOCDIR and DESTDIR variables.
* Install lacme manual to section 8.
* Change default libexec dir from /usr/lib/lacme to /usr/libexec/lacme.
* Makefile: Use variables for target directories etc.
-- Guilhem Moulin Tue, 04 Aug 2020 01:39:47 +0200
lacme (0.6) upstream;
+ client: poll order URL instead of each authz URL successively.
+ lacme: new option 'account --deactivate' for client-initiated account
deactivation, see RFC 8555 sec. 7.3.6.
- lacme, client: new dependency Date::Parse, don't parse RFC 3339
datetime strings from X.509 certs manually.
- lacme: assume that the iptables(8) binaries are under /usr/sbin not
/sbin. As of Buster this is the case, and the maintainer plans to
drop compatibility symlinks once Bullseye is released.
- Link to RFC 8555 instead of the
ACME I-D URL.
- Issue GET and POST-as-GET requests (RFC 8555 sec. 6.3) for the
authorizations, order and certificate URLs.
-- Guilhem Moulin Wed, 21 Aug 2019 18:23:50 +0200
lacme (0.5) upstream;
+ Use ACME v2 endpoints (update protocol to the last draft of the spec
https://tools.ietf.org/html/draft-ietf-acme-acme-12 ). Remove the
'reg=' command, and rename the 'new-reg', 'new-cert' and
'revoke-cert' commands to 'account', 'newOrder', and 'revokeCert'
respectively, to match the the URI resource names. For backward
compatibility 'new-cert' and 'revoke-cert' remain supported.
- Fix manpage generation with pandoc >=2.1
-- Guilhem Moulin Thu, 26 Apr 2018 16:48:13 +0200
lacme (0.4) upstream;
* Fix generation of manpages with pandoc >=1.18
* Copy snippets/*.conf to /etc/lacme
-- Guilhem Moulin Fri, 28 Jul 2017 00:16:06 +0200
lacme (0.3) upstream;
+ When parsing config-cert files and directories (default "lacme-certs.conf
lacme-certs.conf.d"), import the default section of files read earlier.
+ new-cert: create certificate files atomically.
+ webserver: allow listening to multiple addresses (useful when
dual IPv4/IPv6 stack is not supported). Listen to a UNIX-domain
socket by default .
+ webserver: don't install temporary iptables by default. Hosts
without a public HTTP daemon listening on port 80 need to set the
'listen' option to [::] and/or 0.0.0.0, and possibly set the
'iptables' option to Yes.
+ Change 'min-days' default from 10 to 21, to avoid expiration notices
from Let's Encrypt when auto-renewal is done by a cronjob.
+ Provide nginx and apache2 configuration snippets.
- Ensure lacme's config file descriptor is not passed to the accountd
or webserver components.
- new-cert: sort section names if not passed explicitely.
- new-cert: new CLI option "min-days" overriding the value found in
the configuration file.
- new-cert: mark the basicConstraints (CA:FALSE) and keyUsage x509v3
extensions as critical in the CSR, following upstream fix of
Boulder's issue #565.
- webserver: refuse to follow symlink when serving ACME challenge
responses. When dropping privileges to a dedicated UID
(recommended) only the ACME client could write to its current
directory anyway, so following symlinks was not a serious
vulnerability.
- lacme(1), lacme-accountd(1): fix version number shown with
--version.
- client: remove potential race when creating ACME challenge response
files.
- When using open with mode "<&=" or ">&=", ensure the expression
(fileno) is interpreted as an integer. (This failed in Perl v5.14.2
from Debian Jessie.)
- Specify minimum required Perl version (v5.14.2). Moreover lacme(1)
requires Socket 1.95 or later (for instance for IPPROTO_IPV6).
-- Guilhem Moulin Sun, 19 Feb 2017 13:08:41 +0100
lacme (0.2) upstream;
+ Honor Retry-After headers for certificate issuance and challenge
responses.
+ Update example of Subscriber Agreement URL to v1.1.1.
+ lacme: automaticall spawn lacme-acountd when a "[accountd]" section
is present in the configuration file. The "socket" option is then
ignored, and the two processes communicate through a socket pair.
+ lacme: add an option --quiet to avoid mentioning valid certs (useful
in cronjobs)
+ "config-certs" now points to a space separated list of files or
directories. New default "lacme-certs.conf lacme-certs.conf.d/".
- Minor manpage fixes
- More useful message upon Validation Challenge failure.
-- Guilhem Moulin Sat, 03 Dec 2016 16:40:56 +0100
lacme (0.1) upstream;
* Initial public release. Development was started in December 2015.
-- Guilhem Moulin Tue, 14 Jun 2016 17:30:58 +0200
lacme-0.8.0/INSTALL 0000664 0000000 0000000 00000003344 14014612315 0013632 0 ustar 00root root 0000000 0000000 lacme-accountd depends on the following Perl modules:
- Config::Tiny
- Crypt::OpenSSL::RSA (for PEM-encoded key material)
- Crypt::OpenSSL::Bignum (for PEM-encoded key material)
- Errno (core module)
- File::Basename (core module)
- Getopt::Long (core module)
- JSON (optionally C/XS-accelerated with JSON::XS)
- MIME::Base64 (core module)
- Socket (core module)
On Debian GNU/Linux systems, these dependencies can be installed with
the following command:
apt-get install libconfig-tiny-perl libcrypt-openssl-rsa-perl libcrypt-openssl-bignum-perl libjson-perl
lacme depends on OpenSSL ≥1.1.0 and the following Perl modules:
- Config::Tiny
- Digest::SHA (core module)
- Date::Parse
- Errno (core module)
- Fcntl (core module)
- File::Basename (core module)
- File::Temp (core module)
- Getopt::Long (core module)
- JSON (optionally C/XS-accelerated with JSON::XS)
- LWP::UserAgent
- LWP::Protocol::https (for https:// ACME directory URIs)
- MIME::Base64 (core module)
- Net::SSLeay
- POSIX (core module)
- Socket (core module)
On Debian GNU/Linux systems, these dependencies can be installed with
the following command:
apt-get install openssl \
libconfig-tiny-perl \
libtimedate-perl \
libjson-perl \
libwww-perl \
liblwp-protocol-https-perl \
libnet-ssleay-perl \
libtypes-serialiser-perl
However Debian GNU/Linux users can also use gbp(1) from git-buildpackage
to build their own package:
$ git checkout debian/latest
$ AUTO_DEBSIGN=no gbp buildpackage
Alternatively, for the development version:
$ git checkout debian/latest
$ git merge master
$ AUTO_DEBSIGN=no gbp buildpackage --git-force-create --git-upstream-tree=BRANCH
lacme-0.8.0/Makefile 0000664 0000000 0000000 00000010104 14014612315 0014231 0 ustar 00root root 0000000 0000000 DESTDIR ?= /usr/local
BUILDDIR ?= ./build
MANUAL_FILES = $(addprefix $(BUILDDIR)/,$(patsubst ./%.md,%,$(wildcard ./*.[1-9].md)))
all: manual $(addprefix $(BUILDDIR)/,lacme lacme-accountd client webserver \
$(wildcard certs/* config/* snippets/*) \
certs/ca-certificates.crt certs-staging/ca-certificates.crt)
doc: manual
manual: $(MANUAL_FILES)
# upper case the headers and remove the links
$(MANUAL_FILES): $(BUILDDIR)/%: $(BUILDDIR)/%.md
pandoc -f markdown -t json -- "$<" | ./pandoc2man.jq | pandoc -s -f json -t man -o "$@"
# used for validation, see https://letsencrypt.org/certificates/
$(BUILDDIR)/certs/ca-certificates.crt: \
certs/isrgrootx1.pem \
certs/isrg-root-x2.pem \
certs/lets-encrypt-r[34].pem \
certs/lets-encrypt-e[12].pem
mkdir -pv -- $(dir $@)
cat -- $^ >$@
# Staging Environment for tests, see https://letsencrypt.org/docs/staging-environment/
$(BUILDDIR)/certs-staging/ca-certificates.crt: \
certs-staging/letsencrypt-stg-root-x[12].pem \
certs-staging/letsencrypt-stg-int-r[34].pem \
certs-staging/letsencrypt-stg-int-e[12].pem
mkdir -pv -- $(dir $@)
cat -- $^ >$@
prefix ?= $(DESTDIR)
exec_prefix ?= $(prefix)
bindir ?= $(exec_prefix)/bin
sbindir ?= $(exec_prefix)/sbin
libexecdir ?= $(exec_prefix)/libexec
datarootdir ?= $(prefix)/share
datadir ?= $(datarootdir)
sysconfdir ?= $(prefix)/etc
localstatedir ?= $(prefix)/var
runstatedir ?= $(localstatedir)/run
mandir ?= $(datarootdir)/man
man1dir ?= $(mandir)/man1
man8dir ?= $(mandir)/man8
lacme_www_user ?= www-data
lacme_www_group ?= www-data
lacme_client_user ?= nobody
lacme_client_group ?= nogroup
acmeapi_server ?= https://acme-v02.api.letsencrypt.org/directory
$(BUILDDIR)/%: %
mkdir -pv -- $(dir $@)
cp --no-dereference --preserve=mode,links,xattr -vfT -- "$<" "$@"
sed -i "s#@@bindir@@#$(bindir)#g; \
s#@@sbindir@@#$(sbindir)#g; \
s#@@libexecdir@@#$(libexecdir)#g; \
s#@@datadir@@#$(datadir)#g; \
s#@@localstatedir@@#$(localstatedir)#g; \
s#@@runstatedir@@#$(runstatedir)#g; \
s#@@sysconfdir@@#$(sysconfdir)#g; \
s#@@lacme_www_user@@#$(lacme_www_user)#g; \
s#@@lacme_www_group@@#$(lacme_www_group)#g; \
s#@@lacme_client_user@@#$(lacme_client_user)#g; \
s#@@lacme_client_group@@#$(lacme_client_group)#g; \
s#@@acmeapi_server@@#$(acmeapi_server)#g; \
" -- "$@"
release:
@if ! git diff HEAD --quiet -- ./Changelog ./lacme ./lacme-accountd ./client; then \
echo "Dirty state, refusing to release!" >&2; \
exit 1; \
fi
VERS=$$(dpkg-parsechangelog -l Changelog -SVersion 2>/dev/null) && \
if git rev-parse -q --verify "refs/tags/v$$VERS" >/dev/null; then echo "tag exists" 2>/dev/null; exit 1; fi && \
sed -ri "0,/^( -- .*) .*/ s//\\1 $(shell date -R)/" ./Changelog && \
sed -ri "0,/^(our\\s+\\\$$VERSION\\s*=\\s*)'[0-9.]+'\\s*;/ s//\\1'$$VERS';/" \
-- ./lacme ./lacme-accountd ./client && \
git commit -m "Prepare new release v$$VERS." \
-- ./Changelog ./lacme ./lacme-accountd ./client && \
git tag -sm "Release version $$VERS" "v$$VERS"
install: all
install -m0644 -vDt $(sysconfdir)/lacme -- $(BUILDDIR)/config/*.conf $(BUILDDIR)/snippets/*.conf
install -m0755 -vd -- $(sysconfdir)/lacme/lacme-certs.conf.d
install -m0644 -vDt $(datadir)/lacme -- $(BUILDDIR)/certs/*
install -m0755 -vDt $(libexecdir)/lacme -- $(BUILDDIR)/client $(BUILDDIR)/webserver
install -m0644 -vDt $(man1dir) -- $(BUILDDIR)/lacme-accountd.1
install -m0644 -vDt $(man8dir) -- $(BUILDDIR)/lacme.8
install -m0755 -vDt $(sbindir) -- $(BUILDDIR)/lacme
install -m0755 -vDt $(bindir) -- $(BUILDDIR)/lacme-accountd
install -m0755 -vdD -- $(sysconfdir)/apache2/conf-available
ln -sv -- ../../lacme/apache2.conf $(sysconfdir)/apache2/conf-available/lacme.conf
uninstall:
rm -vf -- $(bindir)/lacme-accountd $(sbindir)/lacme
rm -vf -- $(man1dir)/lacme-accountd.1 $(man8dir)/lacme.8
rm -rvf -- $(sysconfdir)/lacme $(datadir)/lacme $(libexecdir)/lacme
rm -vf -- $(sysconfdir)/apache2/conf-available/lacme.conf
clean:
rm -rvf -- $(BUILDDIR)
.PHONY: all doc manual release install uninstall clean
lacme-0.8.0/README 0000664 0000000 0000000 00000006401 14014612315 0013456 0 ustar 00root root 0000000 0000000 lacme is a small ACME client written with process isolation and minimal
privileges in mind. It is divided into four components, each with its
own executable:
* A process to manage the account key and issue SHA-256 signatures
needed for each ACME command. (This process binds to a UNIX-domain
socket to reply to signature requests from the ACME client.) One
can use the UNIX-domain socket forwarding facility of OpenSSH 6.7
and later to run this process on a different host.
* A "master" process, which runs as root and is the only component
with access to the private key material of the server keys. It is
used to fork the ACME client (and optionally the ACME webserver)
after dropping root privileges. For certificate issuances,
it also generates Certificate Signing Requests, then verifies the
validity of the issued certificate, and optionally reloads or
restarts services when the notify option is set.
* An actual ACME client, which builds ACME commands and dialogues with
the remote ACME server. Since ACME commands need to be signed with
the account key, the "master" process passes the UNIX-domain socket
of the account key manager to the ACME client: data signatures are
requested by writing the data to be signed to the socket.
* For certificate issuances, an optional webserver which is spawned by
the "master". (The only challenge type currently supported is
"http-01", which requires a webserver to answer challenges.) That
webserver only processes GET and HEAD requests under the
"/.well-known/acme-challenge/" URI. Moreover temporary iptables(8)
rules can be automatically installed to open the HTTP port.
Consult the manuals for more information.
https://guilhem.org/man/lacme.8.html
https://guilhem.org/man/lacme-accountd.1.html
_______________________________________________________________________
Requesting new Certificate Issuance with the ACME protocol generally
works as follows:
1. Generate a Certificate Signing Request. This requires access to
the private part of the server key.
2. Issue an issuance request against the ACME server.
3. Answer the ACME Identifier Validation Challenges. The challenge
type "http-01" requires a webserver to listen on port 80 for each
address for which an authorization request is issued; if there is
no running webserver, root privileges are required to bind against
port 80 and to install firewall rules to temporarily open the port.
4. Install the certificate (after verification) and restart the
service. This usually requires root access as well.
Steps 1,3,4 need to be run on the host for which an authorization
request is issued. However the the issuance itself (step 2) could be
done from another machine. Furthermore, each ACME command (step 2), as
well as the key authorization token in step 3, need to be signed using
an account key. The account key can be stored on another machine, or
even on a smartcard.
_______________________________________________________________________
lacme is Copyright © 2015-2021 Guilhem Moulin ⟨guilhem@fripost.org⟩, and
licensed for use under the GNU General Public License version 3 or
later. See ‘COPYING’ for specific terms and distribution information.
lacme-0.8.0/certs-staging/ 0000775 0000000 0000000 00000000000 14014612315 0015347 5 ustar 00root root 0000000 0000000 lacme-0.8.0/certs-staging/letsencrypt-stg-int-e1.pem 0000664 0000000 0000000 00000002133 14014612315 0022313 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIDCzCCApGgAwIBAgIRALRY4992FVxZJKOJ3bpffWIwCgYIKoZIzj0EAwMwaDEL
MAkGA1UEBhMCVVMxMzAxBgNVBAoTKihTVEFHSU5HKSBJbnRlcm5ldCBTZWN1cml0
eSBSZXNlYXJjaCBHcm91cDEkMCIGA1UEAxMbKFNUQUdJTkcpIEJvZ3VzIEJyb2Nj
b2xpIFgyMB4XDTIwMDkwNDAwMDAwMFoXDTI1MDkxNTE2MDAwMFowVTELMAkGA1UE
BhMCVVMxIDAeBgNVBAoTFyhTVEFHSU5HKSBMZXQncyBFbmNyeXB0MSQwIgYDVQQD
ExsoU1RBR0lORykgRXJzYXR6IEVkYW1hbWUgRTEwdjAQBgcqhkjOPQIBBgUrgQQA
IgNiAAT9v/PJUtHOTk28nXCXrpP665vI4Z094h8o7R+5E6yNajZa0UubqjpZFoGq
u785/vGXj6mdfIzc9boITGusZCSWeMj5ySMZGZkS+VSvf8VQqj+3YdEu4PLZEjBA
ivRFpEejggEQMIIBDDAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUH
AwIGCCsGAQUFBwMBMBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFOv5JcKA
KGbibQiSMvPC4a3D/zVFMB8GA1UdIwQYMBaAFN7Ro1lkDsGaNqNG7rAQdu+ul5Vm
MDYGCCsGAQUFBwEBBCowKDAmBggrBgEFBQcwAoYaaHR0cDovL3N0Zy14Mi5pLmxl
bmNyLm9yZy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3N0Zy14Mi5jLmxlbmNy
Lm9yZy8wIgYDVR0gBBswGTAIBgZngQwBAgEwDQYLKwYBBAGC3xMBAQEwCgYIKoZI
zj0EAwMDaAAwZQIwXcZbdgxcGH9rTErfSTkXfBKKygU0yO7OpbuNeY1id0FZ/hRY
N5fdLOGuc+aHfCsMAjEA0P/xwKr6NQ9MN7vrfGAzO397PApdqfM7VdFK18aEu1xm
3HMFKzIR8eEPsMx4smMl
-----END CERTIFICATE-----
lacme-0.8.0/certs-staging/letsencrypt-stg-int-e2.pem 0000664 0000000 0000000 00000002133 14014612315 0022314 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIDCjCCApCgAwIBAgIQQuJJzkyQeLKT5OSWP41qRTAKBggqhkjOPQQDAzBoMQsw
CQYDVQQGEwJVUzEzMDEGA1UEChMqKFNUQUdJTkcpIEludGVybmV0IFNlY3VyaXR5
IFJlc2VhcmNoIEdyb3VwMSQwIgYDVQQDExsoU1RBR0lORykgQm9ndXMgQnJvY2Nv
bGkgWDIwHhcNMjAwOTA0MDAwMDAwWhcNMjUwOTE1MTYwMDAwWjBVMQswCQYDVQQG
EwJVUzEgMB4GA1UEChMXKFNUQUdJTkcpIExldCdzIEVuY3J5cHQxJDAiBgNVBAMT
GyhTVEFHSU5HKSBFcnNhdHogRWRhbWFtZSBFMjB2MBAGByqGSM49AgEGBSuBBAAi
A2IABEpsxJnmT3EQu6hL6LeYyvVggZd1aOj6QepgX+mdhOYxCgAvb4etuL80y7EP
sUUJh3Y20WhgXsZW21jukrL+PzdKfctcRoOM7CFBBk+09Ubalyys69O99+B6doRx
GYWWp6OCARAwggEMMA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcD
AgYIKwYBBQUHAwEwEgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUbPiNRb5I
GjoDUBH28pJdQ2OphogwHwYDVR0jBBgwFoAU3tGjWWQOwZo2o0busBB2766XlWYw
NgYIKwYBBQUHAQEEKjAoMCYGCCsGAQUFBzAChhpodHRwOi8vc3RnLXgyLmkubGVu
Y3Iub3JnLzArBgNVHR8EJDAiMCCgHqAchhpodHRwOi8vc3RnLXgyLmMubGVuY3Iu
b3JnLzAiBgNVHSAEGzAZMAgGBmeBDAECATANBgsrBgEEAYLfEwEBATAKBggqhkjO
PQQDAwNoADBlAjEAv19ESEwzY8fAt1WkE4Nkm6bJxQEJZwILGNnvPuEmAKlngKov
dm1feBw0q45Fl8MEAjA24IoWYt7txJSbPQpxETJfsjO8aLWxedQpqHWS1x0zEB4L
K5uFc99+L56DIgmqjKM=
-----END CERTIFICATE-----
lacme-0.8.0/certs-staging/letsencrypt-stg-int-r3.pem 0000664 0000000 0000000 00000003577 14014612315 0022347 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIFWzCCA0OgAwIBAgIQTfQrldHumzpMLrM7jRBd1jANBgkqhkiG9w0BAQsFADBm
MQswCQYDVQQGEwJVUzEzMDEGA1UEChMqKFNUQUdJTkcpIEludGVybmV0IFNlY3Vy
aXR5IFJlc2VhcmNoIEdyb3VwMSIwIAYDVQQDExkoU1RBR0lORykgUHJldGVuZCBQ
ZWFyIFgxMB4XDTIwMDkwNDAwMDAwMFoXDTI1MDkxNTE2MDAwMFowWTELMAkGA1UE
BhMCVVMxIDAeBgNVBAoTFyhTVEFHSU5HKSBMZXQncyBFbmNyeXB0MSgwJgYDVQQD
Ex8oU1RBR0lORykgQXJ0aWZpY2lhbCBBcHJpY290IFIzMIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEAu6TR8+74b46mOE1FUwBrvxzEYLck3iasmKrcQkb+
gy/z9Jy7QNIAl0B9pVKp4YU76JwxF5DOZZhi7vK7SbCkK6FbHlyU5BiDYIxbbfvO
L/jVGqdsSjNaJQTg3C3XrJja/HA4WCFEMVoT2wDZm8ABC1N+IQe7Q6FEqc8NwmTS
nmmRQm4TQvr06DP+zgFK/MNubxWWDSbSKKTH5im5j2fZfg+j/tM1bGaczFWw8/lS
nukyn5J2L+NJYnclzkXoh9nMFnyPmVbfyDPOc4Y25aTzVoeBKXa/cZ5MM+WddjdL
biWvm19f1sYn1aRaAIrkppv7kkn83vcth8X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
hSjpTUFGSiQrR2JK2Evp+o6AETUkBCO1aw0PpQBPDQ==
-----END CERTIFICATE-----
lacme-0.8.0/certs-staging/letsencrypt-stg-int-r4.pem 0000664 0000000 0000000 00000003577 14014612315 0022350 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIFWzCCA0OgAwIBAgIQaCYQ95QBw3BbcmLyhdXHzjANBgkqhkiG9w0BAQsFADBm
MQswCQYDVQQGEwJVUzEzMDEGA1UEChMqKFNUQUdJTkcpIEludGVybmV0IFNlY3Vy
aXR5IFJlc2VhcmNoIEdyb3VwMSIwIAYDVQQDExkoU1RBR0lORykgUHJldGVuZCBQ
ZWFyIFgxMB4XDTIwMDkwNDAwMDAwMFoXDTI1MDkxNTE2MDAwMFowWTELMAkGA1UE
BhMCVVMxIDAeBgNVBAoTFyhTVEFHSU5HKSBMZXQncyBFbmNyeXB0MSgwJgYDVQQD
Ex8oU1RBR0lORykgQXJ0aWZpY2lhbCBBcHJpY290IFI0MIIBIjANBgkqhkiG9w0B
AQEFAAOCAQ8AMIIBCgKCAQEA6J8Tmlh6z62axF2+KzRgHHmxf0c5LHGA+wVx9ukJ
nB9zkqdG+gyGfYBnwPlxny0JWBS/1/wu7ry+IhtYOqar1Rg+f+gD0+SqOYmngNW8
IIw0WTjHhqYB2d2Fxsr9bPIpDwpHRbgE8HkozAKwrWs5xDthZlaMZfEyAKzdx8mC
PttZzKW4ubSptmNMoGHx5t/pBWrNGz5EFuTYcy0DkknMvKedkVJn+jJBxVQ/ef/y
Gep7+1WjpW/UQvwJ5H2sm6UtBRAfos5U2TubN7fiI9OGsRmIp73BP9TsyP0Mi1rZ
kVAfMEU6pI5dJXTNt6hmzuE6frt+NlHaC9yrs9iEG1m6DQIDAQABo4IBEDCCAQww
DgYDVR0PAQH/BAQDAgGGMB0GA1UdJQQWMBQGCCsGAQUFBwMCBggrBgEFBQcDATAS
BgNVHRMBAf8ECDAGAQH/AgEAMB0GA1UdDgQWBBSa7sAVo3Q7x+zxBWCmwpOn+U8a
NTAfBgNVHSMEGDAWgBS182Xy/rAKkh/7PH3zRKCsYyXDFDA2BggrBgEFBQcBAQQq
MCgwJgYIKwYBBQUHMAKGGmh0dHA6Ly9zdGcteDEuaS5sZW5jci5vcmcvMCsGA1Ud
HwQkMCIwIKAeoByGGmh0dHA6Ly9zdGcteDEuYy5sZW5jci5vcmcvMCIGA1UdIAQb
MBkwCAYGZ4EMAQIBMA0GCysGAQQBgt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCw
o/xtzOLhliWC6F6XTdgCqt2FrjLQAXRUnCwnwg44oVbD+Gh9qXREpdpRPVrlIS7T
tobw8Z329nsLZ+wiGvm3wkC3Ka3RWbThLE/MuwVMysaTi5jXLJcQLvHRlW00jHgM
/V8vtJPr5s443KuOX1TFUV5Z/0ZilrBY3sAbgVk2n/fgyonX/JCdiGXt3HODpBh3
eJH1kKM/EIrVVZwxHCwG1x/LuKpcUpbelF+NDI11neL+AzhU6wmBhgplg4OxzYWD
Xg0LCi6W0/t73HnG8SaRiCAcPyJOGBZtLQLUgfVKSd6DtRMhVcTzM6EjFiJYZuv4
JHj65p1yFh8+kgJL/kyIWp2+mHgj/QCDaQEJccmWl+dpXm0jyyNBbjKG7oOlCzvH
HEBmrYSlzWI4XcK5C2+1SmSQqXv7vPo8jEVXSftg4Z6mEA8e2S6dt/rvreiQ+fDm
gixNiQRd7lkUqPv1EZhiGMYxhW52taj9A3xlcnD9/tfD7BKFe38ilVblYTU423WY
zAslpz6oDEiftKCZ2VmaUzEsS6Hma/r/SkF5oorVlaz7hE1qcu9HLkRohXPJtw3k
XJcK1hT3rITPasaSTREfwKBQS+y6guxv+IpkZftMEiOUix2cRoICJesxsYDE5tei
Pwrakf/zlLfF4WDZVqrYKsddVqddAoa64LfXxS/B4Q==
-----END CERTIFICATE-----
lacme-0.8.0/certs-staging/letsencrypt-stg-root-x1.pem 0000664 0000000 0000000 00000003720 14014612315 0022532 0 ustar 00root root 0000000 0000000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dxIdndqrjy+QVAmCebyDx9eVEGOIpn26bW5LKeru
mJxa/CFBaKi4bRvmdJRLAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMB
Af8EBTADAQH/MB0GA1UdDgQWBBS182Xy/rAKkh/7PH3zRKCsYyXDFDANBgkqhkiG
9w0BAQsFAAOCAgEAncDZNytDbrrVe68UT6py1lfF2h6Tm2p8ro42i87WWyP2LK8Y
nLHC0hvNfWeWmjZQYBQfGC5c7aQRezak+tHLdmrNKHkn5kn+9E9LCjCaEsyIIn2j
qdHlAkepu/C3KnNtVx5tW07e5bvIjJScwkCDbP3akWQixPpRFAsnP+ULx7k0aO1x
qAeaAhQ2rgo1F58hcflgqKTXnpPM02intVfiVVkX5GXpJjK5EoQtLceyGOrkxlM/
sTPq4UrnypmsqSagWV3HcUlYtDinc+nukFk6eR4XkzXBbwKajl0YjztfrCIHOn5Q
CJL6TERVDbM/aAPly8kJ1sWGLuvvWYzMYgLzDul//rUF10gEMWaXVZV51KpS9DY/
5CunuvCXmEQJHo7kGcViT7sETn6Jz9KOhvYcXkJ7po6d93A/jy4GKPIPnsKKNEmR
xUuXY4xRdh45tMJnLTUDdC9FIU0flTeO9/vNpVA8OPU1i14vCz+MU8KX1bV3GXm/
fxlB7VBBjX9v5oUep0o/j68R/iDlCOM4VVfRa8gX6T2FU7fNdatvGro7uQzIvWof
gN9WUwCbEMBy/YhBSrXycKA8crgGg3x1mIsopn88JKwmMBa68oS7EHM9w7C4y71M
7DiA+/9Qdp9RBWJpTS9i/mDnJg1xvo8Xz49mrrgfmcAXTCJqXi24NatI3Oc=
-----END CERTIFICATE-----
lacme-0.8.0/certs-staging/letsencrypt-stg-root-x2.pem 0000664 0000000 0000000 00000001533 14014612315 0022533 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIICTjCCAdSgAwIBAgIRAIPgc3k5LlLVLtUUvs4K/QcwCgYIKoZIzj0EAwMwaDEL
MAkGA1UEBhMCVVMxMzAxBgNVBAoTKihTVEFHSU5HKSBJbnRlcm5ldCBTZWN1cml0
eSBSZXNlYXJjaCBHcm91cDEkMCIGA1UEAxMbKFNUQUdJTkcpIEJvZ3VzIEJyb2Nj
b2xpIFgyMB4XDTIwMDkwNDAwMDAwMFoXDTQwMDkxNzE2MDAwMFowaDELMAkGA1UE
BhMCVVMxMzAxBgNVBAoTKihTVEFHSU5HKSBJbnRlcm5ldCBTZWN1cml0eSBSZXNl
YXJjaCBHcm91cDEkMCIGA1UEAxMbKFNUQUdJTkcpIEJvZ3VzIEJyb2Njb2xpIFgy
MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEOvS+w1kCzAxYOJbA06Aw0HFP2tLBLKPo
FQqR9AMskl1nC2975eQqycR+ACvYelA8rfwFXObMHYXJ23XLB+dAjPJVOJ2OcsjT
VqO4dcDWu+rQ2VILdnJRYypnV1MMThVxo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYD
VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU3tGjWWQOwZo2o0busBB2766XlWYwCgYI
KoZIzj0EAwMDaAAwZQIwRcp4ZKBsq9XkUuN8wfX+GEbY1N5nmCRc8e80kUkuAefo
uc2j3cICeXo1cOybQ1iWAjEA3Ooawl8eQyR4wrjCofUE8h44p0j7Yl/kBlJZT8+9
vbtH7QiVzeKCOTQPINyRql6P
-----END CERTIFICATE-----
lacme-0.8.0/certs/ 0000775 0000000 0000000 00000000000 14014612315 0013715 5 ustar 00root root 0000000 0000000 lacme-0.8.0/certs/isrg-root-x2.pem 0000664 0000000 0000000 00000001426 14014612315 0016677 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIICGzCCAaGgAwIBAgIQQdKd0XLq7qeAwSxs6S+HUjAKBggqhkjOPQQDAzBPMQsw
CQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2gg
R3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw00
MDA5MTcxNjAwMDBaME8xCzAJBgNVBAYTAlVTMSkwJwYDVQQKEyBJbnRlcm5ldCBT
ZWN1cml0eSBSZXNlYXJjaCBHcm91cDEVMBMGA1UEAxMMSVNSRyBSb290IFgyMHYw
EAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0HttwW
+1qLFNvicWDEukWVEYmO6gbf9yoWHKS5xcUy4APgHoIYOIvXRdgKam7mAHf7AlF9
ItgKbppbd9/w+kHsOdx1ymgHDB/qo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0T
AQH/BAUwAwEB/zAdBgNVHQ4EFgQUfEKWrt5LSDv6kviejM9ti6lyN5UwCgYIKoZI
zj0EAwMDaAAwZQIwe3lORlCEwkSHRhtFcP9Ymd70/aTSVaYgLXTWNLxBo1BfASdW
tL4ndQavEi51mI38AjEAi/V3bNTIZargCyzuFJ0nN6T5U6VR5CmD1/iQMVtCnwr1
/q4AaOeMSQ+2b1tbFfLn
-----END CERTIFICATE-----
lacme-0.8.0/certs/isrgrootx1.pem 0000664 0000000 0000000 00000003623 14014612315 0016545 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4
WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu
ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY
MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVyg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im57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur
TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC
jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc
oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq
4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA
mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d
emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc=
-----END CERTIFICATE-----
lacme-0.8.0/certs/lets-encrypt-e1.pem 0000664 0000000 0000000 00000001775 14014612315 0017366 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIICxjCCAk2gAwIBAgIRALO93/inhFu86QOgQTWzSkUwCgYIKoZIzj0EAwMwTzEL
MAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2VhcmNo
IEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDIwHhcNMjAwOTA0MDAwMDAwWhcN
MjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3MgRW5j
cnlwdDELMAkGA1UEAxMCRTEwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQkXC2iKv0c
S6Zdl3MnMayyoGli72XoprDwrEuf/xwLcA/TmC9N/A8AmzfwdAVXMpcuBe8qQyWj
+240JxP2T35p0wKZXuskR5LBJJvmsSGPwSSB/GjMH2m6WPUZIvd0xhajggEIMIIB
BDAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMB
MBIGA1UdEwEB/wQIMAYBAf8CAQAwHQYDVR0OBBYEFFrz7Sv8NsI3eblSMOpUb89V
yy6sMB8GA1UdIwQYMBaAFHxClq7eS0g7+pL4nozPbYupcjeVMDIGCCsGAQUFBwEB
BCYwJDAiBggrBgEFBQcwAoYWaHR0cDovL3gyLmkubGVuY3Iub3JnLzAnBgNVHR8E
IDAeMBygGqAYhhZodHRwOi8veDIuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYG
Z4EMAQIBMA0GCysGAQQBgt8TAQEBMAoGCCqGSM49BAMDA2cAMGQCMHt01VITjWH+
Dbo/AwCd89eYhNlXLr3pD5xcSAQh8suzYHKOl9YST8pE9kLJ03uGqQIwWrGxtO3q
YJkgsTgDyj2gJrjubi1K9sZmHzOa25JK1fUpE8ZwYii6I4zPPS/Lgul/
-----END CERTIFICATE-----
lacme-0.8.0/certs/lets-encrypt-e2.pem 0000664 0000000 0000000 00000001775 14014612315 0017367 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIICxjCCAkygAwIBAgIQTtI99q9+x/mwxHJv+VEqdzAKBggqhkjOPQQDAzBPMQsw
CQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2gg
R3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw0y
NTA5MTUxNjAwMDBaMDIxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNy
eXB0MQswCQYDVQQDEwJFMjB2MBAGByqGSM49AgEGBSuBBAAiA2IABCOaLO3lixmN
YVWex+ZVYOiTLgi0SgNWtU4hufk50VU4Zp/LbBVDxCsnsI7vuf4xp4Cu+ETNggGE
yBqJ3j8iUwe5Yt/qfSrRf1/D5R58duaJ+IvLRXeASRqEL+VkDXrW3qOCAQgwggEE
MA4GA1UdDwEB/wQEAwIBhjAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUHAwEw
EgYDVR0TAQH/BAgwBgEB/wIBADAdBgNVHQ4EFgQUbZkq9U0C6+MRwWC6km+NPS7x
6kQwHwYDVR0jBBgwFoAUfEKWrt5LSDv6kviejM9ti6lyN5UwMgYIKwYBBQUHAQEE
JjAkMCIGCCsGAQUFBzAChhZodHRwOi8veDIuaS5sZW5jci5vcmcvMCcGA1UdHwQg
MB4wHKAaoBiGFmh0dHA6Ly94Mi5jLmxlbmNyLm9yZy8wIgYDVR0gBBswGTAIBgZn
gQwBAgEwDQYLKwYBBAGC3xMBAQEwCgYIKoZIzj0EAwMDaAAwZQIxAPJCN9qpyDmZ
tX8K3m8UYQvK51BrXclM6WfrdeZlUBKyhTXUmFAtJw4X6A0x9mQFPAIwJa/No+KQ
UAM1u34E36neL/Zba7ombkIOchSgx1iVxzqtFWGddgoG+tppRPWhuhhn
-----END CERTIFICATE-----
lacme-0.8.0/certs/lets-encrypt-r3-cross-signed.pem 0000664 0000000 0000000 00000003062 14014612315 0021772 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIEZTCCA02gAwIBAgIQQAF1BIMUpMghjISpDBbN3zANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTIwMTAwNzE5MjE0MFoXDTIxMDkyOTE5MjE0MFow
MjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxCzAJBgNVBAMT
AlIzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuwIVKMz2oJTTDxLs
jVWSw/iC8ZmmekKIp10mqrUrucVMsa+Oa/l1yKPXD0eUFFU1V4yeqKI5GfWCPEKp
Tm71O8Mu243AsFzzWTjn7c9p8FoLG77AlCQlh/o3cbMT5xys4Zvv2+Q7RVJFlqnB
U840yFLuta7tj95gcOKlVKu2bQ6XpUA0ayvTvG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HRw
Oi8veDEuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYGZ4EMAQIBMA0GCysGAQQB
gt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCFyk5HPqP3hUSFvNVneLKYY611TR6W
PTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl
ikfmZW4/RvTZ8M6UK+5UzhK8jCdLuMGYL6KvzXGRSgi3yLgjewQtCPkIVz6D2QQz
CkcheAmCJ8MqyJu5zlzyZMjAvnnAT45tRAxekrsu94sQ4egdRCnbWSDtY7kh+BIm
lJNXoB1lBMEKIq4QDUOXoRgffuDghje1WrG9ML+Hbisq/yFOGwXD9RiX8F6sw6W4
avAuvDszue5L3sz85K+EC4Y/wFVDNvZo4TYXao6Z0f+lQKc0t8DQYzk1OXVu8rp2
yJMC6alLbBfODALZvYH7n7do1AZls4I9d1P4jnkDrQoxB3UqQ9hVl3LEKQ73xF1O
yK5GhDDX8oVfGKF5u+decIsH4YaTw7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids
hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+
HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv
MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX
nLRbwHOoq7hHwg==
-----END CERTIFICATE-----
lacme-0.8.0/certs/lets-encrypt-r4-cross-signed.pem 0000664 0000000 0000000 00000003062 14014612315 0021773 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIEZTCCA02gAwIBAgIQQAF1BIMlO+Rkt3exI9CKgjANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTIw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xGiCPQqVxPgfNSh+2CPd2Xv04lNeuw6gG89DlOhHuoFKRlmPnom+gwqhz3ZXMfz
TfmvjrBokzCICA==
-----END CERTIFICATE-----
lacme-0.8.0/certs/lets-encrypt-x1-cross-signed.pem 0000664 0000000 0000000 00000003213 14014612315 0021774 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIEqDCCA5CgAwIBAgIRAJgT9HUT5XULQ+dDHpceRL0wDQYJKoZIhvcNAQELBQAw
PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD
Ew5EU1QgUm9vdCBDQSBYMzAeFw0xNTEwMTkyMjMzMzZaFw0yMDEwMTkyMjMzMzZa
MEoxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1MZXQncyBFbmNyeXB0MSMwIQYDVQQD
ExpMZXQncyBFbmNyeXB0IEF1dGhvcml0eSBYMTCCASIwDQYJKoZIhvcNAQEBBQAD
ggEPADCCAQoCggEBAJzTDPBa5S5Ht3JdN4OzaGMw6tc1Jhkl4b2+NfFwki+3uEtB
BaupnjUIWOyxKsRohwuj43Xk5vOnYnG6eYFgH9eRmp/z0HhncchpDpWRz/7mmelg
PEjMfspNdxIknUcbWuu57B43ABycrHunBerOSuu9QeU2mLnL/W08lmjfIypCkAyG
dGfIf6WauFJhFBM/ZemCh8vb+g5W9oaJ84U/l4avsNwa72sNlRZ9xCugZbKZBDZ1
gGusSvMbkEl4L6KWTyogJSkExnTA0DHNjzE4lRa6qDO4Q/GxH8Mwf6J5MRM9LTb4
4/zyM2q5OTHFr8SNDR1kFjOq+oQpttQLwNh9w5MCAwEAAaOCAZIwggGOMBIGA1Ud
EwEB/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgGGMH8GCCsGAQUFBwEBBHMwcTAy
BggrBgEFBQcwAYYmaHR0cDovL2lzcmcudHJ1c3RpZC5vY3NwLmlkZW50cnVzdC5j
b20wOwYIKwYBBQUHMAKGL2h0dHA6Ly9hcHBzLmlkZW50cnVzdC5jb20vcm9vdHMv
ZHN0cm9vdGNheDMucDdjMB8GA1UdIwQYMBaAFMSnsaR7LHH62+FLkHX/xBVghYkQ
MFQGA1UdIARNMEswCAYGZ4EMAQIBMD8GCysGAQQBgt8TAQEBMDAwLgYIKwYBBQUH
AgEWImh0dHA6Ly9jcHMucm9vdC14MS5sZXRzZW5jcnlwdC5vcmcwPAYDVR0fBDUw
MzAxoC+gLYYraHR0cDovL2NybC5pZGVudHJ1c3QuY29tL0RTVFJPT1RDQVgzQ1JM
LmNybDATBgNVHR4EDDAKoQgwBoIELm1pbDAdBgNVHQ4EFgQUqEpqYwR93brm0Tm3
pkVl7/Oo7KEwDQYJKoZIhvcNAQELBQADggEBANHIIkus7+MJiZZQsY14cCoBG1hd
v0J20/FyWo5ppnfjL78S2k4s2GLRJ7iD9ZDKErndvbNFGcsW+9kKK/TnY21hp4Dd
ITv8S9ZYQ7oaoqs7HwhEMY9sibED4aXw09xrJZTC9zK1uIfW6t5dHQjuOWv+HHoW
ZnupyxpsEUlEaFb+/SCI4KCSBdAsYxAcsHYI5xxEI4LutHp6s3OT2FuO90WfdsIk
6q78OMSdn875bNjdBYAqxUp2/LEIHfDBkLoQz0hFJmwAbYahqKaLn73PAAm1X2kj
f1w8DdnkabOLGeOVcj9LQ+s67vBykx4anTjURkbqZslUEUsn2k5xeua2zUk=
-----END CERTIFICATE-----
lacme-0.8.0/certs/lets-encrypt-x2-cross-signed.pem 0000664 0000000 0000000 00000003213 14014612315 0021775 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIEqDCCA5CgAwIBAgIRAMODTJjAvWslLKN5tm+lKw4wDQYJKoZIhvcNAQELBQAw
PzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMRcwFQYDVQQD
Ew5EU1QgUm9vdCBDQSBYMzAeFw0xNTEwMTkyMjM1MDFaFw0yMDEwMTkyMjM1MDFa
MEo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cNAQELBQADggEBAAcSAhaE7rvHxyUnhgkEpMR56o2I
IH+mlw5kknjhAuvaBIAM59MZkFbFg5CrNWt8K+G3UoxJgFwv7HvJJxqwgPpNgXC/
uT3prkvwt+2lvzKJKbqdH+lo40P8EuSyyJOz2hjrRzNMHbJHYDS9OhF5WC5LOQQa
ydgLZ/JHxXgJypEZqcmVgQ+yYBs0XPwXjE7OE8vbx5REwu7gToMIqAoWRoWW2MxS
g28RGPVnHzHk2XV1nZGy9T+NYQ91vWWJr1pzNEFZ0cnA2xGwTeJ+zZ3URCfw3Z1U
+YAL3YUmrvdoRBlASOTmNJmXSo9qvMYPa3DEomAPoFQFZqsSN6kuqDEIqMA=
-----END CERTIFICATE-----
lacme-0.8.0/certs/lets-encrypt-x3-cross-signed.pem 0000664 0000000 0000000 00000003157 14014612315 0022005 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIEkjCCA3qgAwIBAgIQCgFBQgAAAVOFc2oLheynCDANBgkqhkiG9w0BAQsFADA/
MSQwIgYDVQQKExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMT
DkRTVCBSb290IENBIFgzMB4XDTE2MDMxNzE2NDA0NloXDTIxMDMxNzE2NDA0Nlow
SjELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUxldCdzIEVuY3J5cHQxIzAhBgNVBAMT
GkxldCdzIEVuY3J5cHQgQXV0aG9yaXR5IFgzMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAnNMM8FrlLke3cl03g7NoYzDq1zUmGSXhvb418XCSL7e4S0EF
q6meNQhY7LEqxGiHC6PjdeTm86dicbp5gWAf15Gan/PQeGdxyGkOlZHP/uaZ6WA8
SMx+yk13EiSdRxta67nsHjcAHJyse6cF6s5K671B5TaYucv9bTyWaN8jKkKQDIZ0
Z8h/pZq4UmEUEz9l6YKHy9v6Dlb2honzhT+Xhq+w3Brvaw2VFn3EK6BlspkENnWA
a6xK8xuQSXgvopZPKiAlKQTGdMDQMc2PMTiVFrqoM7hD8bEfwzB/onkxEz0tNvjj
/PIzark5McWvxI0NHWQWM6r6hCm21AvA2H3DkwIDAQABo4IBfTCCAXkwEgYDVR0T
AQH/BAgwBgEB/wIBADAOBgNVHQ8BAf8EBAMCAYYwfwYIKwYBBQUHAQEEczBxMDIG
CCsGAQUFBzABhiZodHRwOi8vaXNyZy50cnVzdGlkLm9jc3AuaWRlbnRydXN0LmNv
bTA7BggrBgEFBQcwAoYvaHR0cDovL2FwcHMuaWRlbnRydXN0LmNvbS9yb290cy9k
c3Ryb290Y2F4My5wN2MwHwYDVR0jBBgwFoAUxKexpHsscfrb4UuQdf/EFWCFiRAw
VAYDVR0gBE0wSzAIBgZngQwBAgEwPwYLKwYBBAGC3xMBAQEwMDAuBggrBgEFBQcC
ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz
MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu
Y3JsMB0GA1UdDgQWBBSoSmpjBH3duubRObemRWXv86jsoTANBgkqhkiG9w0BAQsF
AAOCAQEA3TPXEfNjWDjdGBX7CVW+dla5cEilaUcne8IkCJLxWh9KEik3JHRRHGJo
uM2VcGfl96S8TihRzZvoroed6ti6WqEBmtzw3Wodatg+VyOeph4EYpr/1wXKtx8/
wApIvJSwtmVi4MFU5aMqrSDE6ea73Mj2tcMyo5jMd6jmeWUHK8so/joWUoHOUgwu
X4Po1QYz+3dszkDqMp4fklxBwXRsW10KXzPMTZ+sOPAveyxindmjkW8lGy+QsRlG
PfZ+G6Z6h7mjem0Y+iWlkYcV4PIWL1iwBi8saCbGS5jN2p8M+X+Q7UNKEkROb3N6
KOqkqm57TH2H3eDJAkSnh6/DNFu0Qg==
-----END CERTIFICATE-----
lacme-0.8.0/certs/lets-encrypt-x4-cross-signed.pem 0000664 0000000 0000000 00000003157 14014612315 0022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AuBggrBgEFBQcC
ARYiaHR0cDovL2Nwcy5yb290LXgxLmxldHNlbmNyeXB0Lm9yZzA8BgNVHR8ENTAz
MDGgL6AthitodHRwOi8vY3JsLmlkZW50cnVzdC5jb20vRFNUUk9PVENBWDNDUkwu
Y3JsMB0GA1UdDgQWBBTFsatOTLHNZDCTfsGEmQWr5gPiJTANBgkqhkiG9w0BAQsF
AAOCAQEANlaeSdstfAtqFN3jdRZJFjx9X+Ob3PIDlekPYQ1OQ1Uw43rE1FUj7hUw
g2MJKfs9b7M0WoQg7C20nJY/ajsg7pWhUG3J6rlkDTfVY9faeWi0qsPYXE6BpBDr
5BrW/Xv8yT8U2BiEAmNggWq8dmFl82fghmLzHBM8X8NZ3ZwA1fGePA53AP5IoD+0
ArpW8Ik1sSuQBjZ8oQLfN+G8OoY7MNRopyLyQQCNy4aWfE+xYnoVoa5+yr+aPiX0
7YQrY/cKawAn7QB4PyF5//IKSAVs7mAuB68wbMdE3FKfOHfJ24W4z/bIJTrTY8Y5
Sr4AUhtzf8oVDrHZYWRrP4joIcOu/Q==
-----END CERTIFICATE-----
lacme-0.8.0/certs/letsencryptauthorityx1.pem 0000664 0000000 0000000 00000003702 14014612315 0021220 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIFjTCCA3WgAwIBAgIRAOeTkL6SBwNJGF95dYHlyoMwDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTIwMDIw
WhcNMjAwNjA0MTIwMDIwWjBKMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
RW5jcnlwdDEjMCEGA1UEAxMaTGV0J3MgRW5jcnlwdCBBdXRob3JpdHkgWDEwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCc0wzwWuUuR7d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mdDTwKn/pyLOkJFeA/dm/oP99UmKCFoeOa5w9YJr2Vi7ic
Xd59CU8mprWhxFXnma1oU3T8ZNovjib3UHocjlEJfNbDy9zgKTYURcMVweo1dkbH
NbLc5mIjIk/kJ+RPD+chR+gJjy3Gh9xMNkDrZQKfsIO93hxTsZMmgZQ4c+vujC1M
jSak+Ai87YZeYQPh1fCGMSTno5III37DUCtIn8BJxJixuPeOMKsjLLD5AtMVy0fp
d19lcUek4bjDY8/Ujb5/wfn2+Kk7z72SxWdekjtHOWBmKxqq8jDuuMw4ymg1g5n7
R7TZ/Y3y4bTpWUDkBHFo03xNM21wBFDIrCZZeVhvDW4MtT6+Ass2bcpoHwYcGol2
gaLDa5k2dkG41OGtXa0fY+TjdryY4cOcstJUKjv2MJku4yaTtjjECX1rJvFLnqYe
wC+FmxjgWPuyRNuLDAWK30mmpcJZ3CmD6dFtAi4h7H37
-----END CERTIFICATE-----
lacme-0.8.0/certs/letsencryptauthorityx2.pem 0000664 0000000 0000000 00000003702 14014612315 0021221 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIFjTCCA3WgAwIBAgIRAJY2TKc4C+SL3JDGzeC33mgwDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTIwMDMx
WhcNMjAwNjA0MTIwMDMxWjBKMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
RW5jcnlwdDEjMCEGA1UEAxMaTGV0J3MgRW5jcnlwdCBBdXRob3JpdHkgWDIwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDhJHRCe7eRMdlz/ziq2M5EXLc5
CtxErg29RbmXN2evvVBPX9MQVGv3QdqOY+ZtW8DoQKmMQfzRA4n/YmEJYNYHBXia
kL0aZD5P3M93L4lry2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qBK
VSFDDMifJ8HzCaVLyMvY1Kf7iR+840EkX1EGC+Z39EaK1hjm314LYpLoYGvYYLJO
/J76XAx8ZgpofqHz1gAEfiMLMLxLQkOjKLXqoUEd5KdnzaO3aLH91gnasy8aD4D5
9RfEO2xcaozD2rbYsoAMVzcZZHw0Smdmobaz2YazMBjFRcqGntg6s5Xqwusaleiy
snjMCC/9mvIPqGyuVnBPTBaUDFDEhX6qD2MX4dzODL91Z0ogYDWcFLN+uLnZKHje
4JoNuzkJ2FXWOREcsW93KXb+3T8COjhTDKvK4H6ufdrZxxusx60ajJAMBzW0XTf5
nm2yGEDtyVoMgJLp0rkiPlormgHxSkFDOJbY94J7yxRK
-----END CERTIFICATE-----
lacme-0.8.0/certs/letsencryptauthorityx3.pem 0000664 0000000 0000000 00000003700 14014612315 0021220 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIFjTCCA3WgAwIBAgIRANOxciY0IzLc9AUoUSrsnGowDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTYxMDA2MTU0MzU1
WhcNMjExMDA2MTU0MzU1WjBKMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
RW5jcnlwdDEjMCEGA1UEAxMaTGV0J3MgRW5jcnlwdCBBdXRob3JpdHkgWDMwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCc0wzwWuUuR7dyXTeDs2hjMOrX
NSYZJeG9vjXxcJIvt7hLQQWrqZ41CFjssSrEaIcLo+N15Obzp2JxunmBYB/XkZqf
89B4Z3HIaQ6Vkc/+5pnpYDxIzH7KTXcSJJ1HG1rrueweNwAcnKx7pwXqzkrrvUHl
Npi5y/1tPJZo3yMqQpAMhnRnyH+lmrhSYRQTP2XpgofL2/oOVvaGifOFP5eGr7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ky0VgVUsfxo52mwFYs1JKY
2PGDuWx8M6DlS6qQkvHaRUo0FMd8TsSlbF0/v965qGFKhSDeQoMpYnwcmQilRh/0
ayLThlHLN81gSkJjVrPI0Y8xCVPB4twb1PFUd2fPM3sA1tJ83sZ5v8vgFv2yofKR
PB0t6JzUA81mSqM3kxl5e+IZwhYAyO0OTg3/fs8HqGTNKd9BqoUwSRBzp06JMg5b
rUCGwbCUDI0mxadJ3Bz4WxR6fyNpBK2yAinWEsikxqEt
-----END CERTIFICATE-----
lacme-0.8.0/certs/letsencryptauthorityx4.pem 0000664 0000000 0000000 00000003700 14014612315 0021221 0 ustar 00root root 0000000 0000000 -----BEGIN CERTIFICATE-----
MIIFjTCCA3WgAwIBAgIRAJObmZ6kjhYNW0JZtD0gE9owDQYJKoZIhvcNAQELBQAw
TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh
cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTYxMDA2MTU0NDM0
WhcNMjExMDA2MTU0NDM0WjBKMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg
RW5jcnlwdDEjMCEGA1UEAxMaTGV0J3MgRW5jcnlwdCBBdXRob3JpdHkgWDQwggEi
MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDhJHRCe7eRMdlz/ziq2M5EXLc5
CtxErg29RbmXN2evvVBPX9MQVGv3QdqOY+ZtW8DoQKmMQfzRA4n/YmEJYNYHBXia
kL0aZD5P3M93L4lry2evQU3FjQDAa/6NhNy18pUxqOj2kKBDSpN0XLM+Q2lLiSJH
dFE+mWTDzSQB+YQvKHcXIqfdw2wITGYvN3TFb5OOsEY3FmHRUJjIsA9PWFN8rPba
LZZhUK1D3AqmT561Urmcju9O30azMdwg/GnCoyB1Puw4GzZOZmbS3/VmpJMve6YO
lD5gPUpLHG+6tE0cPJFYbi9NxNpw2+0BOXbASefpNb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EKeZTHddQ1t96zvNd2s9ewSKx/DblXbKsBDzIdHJ+qi6+
F9DIVM5/ICdtDdulOO+dr/BXB+pBZ3uVxjRANvJKKpdxkePyluITSNZHbanWRN07
gMvwBWOL060i4VrL9er1sBQrRjU9iNpZQGTnLVAxQVFu
-----END CERTIFICATE-----
lacme-0.8.0/client 0000775 0000000 0000000 00000037401 14014612315 0014006 0 ustar 00root root 0000000 0000000 #!/usr/bin/perl -T
#----------------------------------------------------------------------
# ACME client written with process isolation and minimal privileges in mind
# Copyright © 2015-2021 Guilhem Moulin
#
# 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 .
#----------------------------------------------------------------------
use v5.14.2;
use strict;
use warnings;
# Usage: client COMMAND CONFIG_FD SOCKET_FD [ARGUMENTS]
#
# fdopen(3) the file descriptor SOCKET_FD (corresponding to the
# listening lacme-accountd socket), connect(2) to it to retrieve the
# account key's public parameters and later send data to be signed by
# the master component (using the account key).
#
# CONFIG_FD is a read-only file descriptor associated with the
# configuration file at pos 0. (This is needed since this process
# doesn't know its name and might not have read access to it.)
#
# NOTE: one needs to chdir(2) to an appropriate ACME challenge directory
# before running this program, since challenge tokens are (on purpose)
# only written to the current directory. If COMMAND is challenge-less,
# one should chdir(2) to the root directory "/" instead.
#
# NOTE: one should run this program as an unprivileged user:group such
# as "nobody:nogroup"; bind(2)'ing to a restricted UNIX socket (for
# instance own by another user and created with umask 0177) is not a
# problem since SOCKET_FD can be bound as root prior to the execve(2).
our $VERSION = '0.8.0';
my $PROTOCOL_VERSION = 1;
my $NAME = 'lacme-client';
use Errno 'EEXIST';
use Fcntl qw/O_CREAT O_EXCL O_WRONLY/;
use Digest::SHA 'sha256';
use MIME::Base64 qw/encode_base64 encode_base64url/;
use Date::Parse ();
use LWP::UserAgent ();
use JSON ();
use Config::Tiny ();
# Clean up PATH
$ENV{PATH} = join ':', qw{/usr/bin /bin};
delete @ENV{qw/IFS CDPATH ENV BASH_ENV/};
my $COMMAND = shift @ARGV // die;
# Untaint and fdopen(3) the configuration file and listening socket
(shift @ARGV // die) =~ /\A(\d+)\z/ or die;
open (my $CONFFILE, '<&=', $1+0) or die "fdopen $1: $!";
(shift @ARGV // die) =~ /\A(\d+)\z/ or die;
open (my $S, '+<&=', $1+0) or die "fdopen $1: $!";
# JSON keys need to be sorted lexicographically (for instance in the thumbprint)
sub json() { JSON::->new->utf8->canonical(); }
#############################################################################
# Read the protocol version and JSON Web Key (RFC 7517) from the
# lacme-accountd socket
#
my ($JWK, $JWK_thumbprint, $ALG, $KID);
do {
my $greeting = $S->getline();
die "Error: Invalid client version\n" unless defined $greeting and
$greeting =~ /\A(\d+) OK(?: (.*))?\r\n\z/ and $1 == $PROTOCOL_VERSION;
if (defined (my $extra = $2)) {
my $h = eval { JSON::->new->decode($extra) };
if ($@ or !defined $h) {
print STDERR "WARN: Ignoring extra greeting data from accountd \"$extra\"\n";
} else {
print STDERR "Received extra greeting data from accountd: $extra\n" if $ENV{DEBUG};
($JWK_thumbprint, $ALG, $KID) = @$h{qw/jwk-thumbprint alg kid/};
}
}
my $jwk_str = $S->getline() // die "ERROR: No JWK from lacme-accountd\n";
$JWK = JSON::->new->decode($jwk_str);
$JWK_thumbprint //= encode_base64url(sha256(json()->encode($JWK))); # SHA-256 is hardcoded, see RFC 8555 sec. 8.1
$ALG //= "RS256";
};
#############################################################################
# Parse configuration (already validated by the master) and create the
# LWP::UserAgent object
#
my $CONFIG = do {
my $conf = do { local $/ = undef; <$CONFFILE> };
close $CONFFILE or die "close: $!";
my $h = Config::Tiny::->read_string($conf) or die Config::Tiny::->errstr()."\n";
$h->{_} //= {};
$h->{client}->{$_} //= $h->{_}->{$_} foreach keys %{$h->{_}}; # add defaults
$h->{client};
};
my $UA = do {
my %args = %$CONFIG;
my $verify = lc (delete $args{SSL_verify} // 'Yes') eq 'no' ? 0 : 1;
my %ssl_opts = ( verify_hostname => $verify );
$ssl_opts{$_} = $args{$_} foreach grep /^SSL_/, keys %args;
LWP::UserAgent::->new( agent => "$NAME/$VERSION", ssl_opts => \%ssl_opts );
} // die "Can't create LWP::UserAgent object";
$UA->default_header( 'Accept-Language' => 'en' );
my $NONCE;
#############################################################################
# Send an HTTP request to the ACME server. If $json is defined, send
# its encoding as the request content, with "application/jose+json" as
# Content-Type.
#
sub request($$;$) {
my ($method, $uri, $json) = @_;
print STDERR "[$$] >>> $method $uri <<<\n" if $ENV{DEBUG};
my $req = HTTP::Request::->new($method => $uri) or die "Can't $method $uri";
if (defined $json) {
$req->content_type('application/jose+json');
$req->content(json()->encode($json));
}
my $r = $UA->request($req) or die "Can't $method $uri";
$NONCE //= $r->header('Replay-Nonce'); # undef $NONCE if the header is missing
print STDERR "[$$] >>> ", $r->status_line, "\n", $r->headers->as_string("\n") if $ENV{DEBUG};
return $r;
}
# The request's Status Line; if the Content-Type is
# application/problem+json (RFC 7807), parse the decoded content as JSON
# and add the value of the 'detail' field to the Status Line.
sub request_status_line($) {
my $r = shift;
my $msg = $r->status_line;
if (!$r->is_success() and $r->content_type() eq 'application/problem+json') {
my $content = json()->decode($r->decoded_content());
print STDERR json()->pretty->encode($content), "\n" if $ENV{DEBUG};
$msg .= " (".$content->{detail}.")" if defined $content->{detail};
}
return $msg;
}
# The request's Retry-After header (RFC 7231 sec. 7.1.3), converted to
# waiting time in seconds.
sub request_retry_after($) {
my $r = shift;
my $v = $r->header('Retry-After');
if (defined $v and $v !~ /\A\d+\z/) {
$v = Date::Parse::str2time($v);
if (defined $v) {
$v = $v - time;
undef $v if $v <= 0;
}
}
return $v;
}
# Parse and return the request's decoded content as JSON; or print the
# Status Line and fail if the request failed.
# If $dump is set, also pretty-print the decoded content.
sub request_json_decode($;$$) {
my $r = shift;
my $dump = shift || $ENV{DEBUG};
my $fh = shift // \*STDERR;
die request_status_line($r), "\n" unless $r->is_success();
my $content = $r->decoded_content();
die "Content-Type: ".$r->content_type()." is not application/json\n"
unless $r->content_type() eq 'application/json';
my $json = json()->decode($content);
print $fh (-t $fh ? (json()->pretty->encode($json)."\n") : $content)
if $dump;
return $json;
}
#############################################################################
# JSON-encode the hash reference $payload and send it to the ACME server
# $url encapsulated it in a JSON Web Signature (JWS). $header MUST
# contain either "jwk" (JSON Web Key) or "kid" per RFC 8555 sec. 6.2
# https://tools.ietf.org/html/rfc8555
#
sub acme2($$;$) {
my ($url, $header, $payload) = @_;
# Produce the JSON Web Signature: RFC 7515 section 5
$header->{alg} = $ALG;
$header->{nonce} = $NONCE // die "Missing nonce\n";
$header->{url} = $url;
my $protected = encode_base64url(json()->encode($header));
$payload = defined $payload ? encode_base64url(json()->encode($payload)) : "";
$S->printflush($protected, ".", $payload, "\r\n");
my $sig = $S->getline() // die "ERROR: No response from lacme-accountd\n";
$sig =~ s/\r\n\z// or die;
undef $NONCE; # consume the nonce
# Flattened JSON Serialization, RFC 7515 section 7.2.2
request(POST => $url, {
payload => $payload,
protected => $protected,
signature => $sig
});
}
# Like above, but always use "kid"
sub acme($;$) {
my ($url, $payload) = @_;
die "Missing KID\n" unless defined $KID;
acme2($url, {kid => $KID}, $payload)
}
my $SERVER_URI = $CONFIG->{server} // '@@acmeapi_server@@';
my %RES;
# Get the resource URI from the directory
sub acme_resource($%) {
my $r = shift;
my %payload = @_;
my %protected;
unless (%RES) {
# query the ACME directory to get resources URIs
%RES = %{ request_json_decode(request(GET => $SERVER_URI)) };
# send a HEAD request to the newNonce resource to get a fresh nonce
die "Unknown resource 'newNonce'\n" unless defined $RES{newNonce};
request(HEAD => $RES{newNonce});
}
my $uri = $RES{$r} // die "Unknown resource '$r'\n";
if ($r eq "newAccount" or ($r eq "revokeCert" and !defined $KID)) {
# per RFC 8555 sec. 6.2 these requests MUST have a JWK
print STDERR "WARNING: lacme-accountd supplied an empty JWK; try removing 'keyid' ",
"setting from lacme-accountd.conf if the ACME resource request fails.\n"
unless %$JWK;
return acme2($uri, {jwk => $JWK}, \%payload);
} else {
# per RFC 8555 sec. 6.2 all other requests MUST have a KID
return acme($uri, \%payload);
}
}
# Set the key ID (registration URI)
sub set_kid(;$) {
my $die = shift // 1;
return if defined $KID; # already set
my $r = acme_resource('newAccount', onlyReturnExisting => JSON::true );
if ($r->is_success()) {
$KID = $r->header('Location');
} elsif ($die) {
die request_status_line($r), "\n";
}
}
#############################################################################
# account FLAGS [CONTACT ..]
#
if ($COMMAND eq 'account') {
my $flags = shift @ARGV;
my %h = ( contact => \@ARGV ) if @ARGV;
$h{onlyReturnExisting} = JSON::true unless $flags & 0x01;
$h{termsOfServiceAgreed} = JSON::true if $flags & 0x02;
$h{status} = "deactivated" if $flags & 0x04;
print STDERR "Requesting new registration ".(@ARGV ? ("for ".join(', ', @ARGV)) : "")."\n"
if $flags & 0x01;
my $r = acme_resource('newAccount', %h);
# TODO: list account orders: https://github.com/letsencrypt/boulder/issues/3335
print STDERR "Terms of Service: $RES{meta}->{termsOfService}\n"
if defined $RES{meta} and defined $RES{meta}->{termsOfService};
if ($r->is_success()) {
$KID = $r->header('Location');
print STDERR "Key ID: $KID\n";
$r = acme($KID, \%h);
request_json_decode($r, 1, \*STDOUT)
if $r->is_success() and $r->content_type() eq 'application/json';
}
print STDERR request_status_line($r), "\n"
if !$r->is_success() or $ENV{DEBUG};
exit ($r->is_success() ? 0 : 1);
}
#############################################################################
# newOrder AUTHZ [AUTHZ ..]
# Read the CSR (in DER format) from STDIN, print the cert (in PEM format
# to STDOUT)
#
elsif ($COMMAND eq 'newOrder') {
die unless @ARGV;
my $timeout = $CONFIG->{timeout} // 30;
my $csr = do { local $/ = undef; };
set_kid();
my @identifiers = map {{ type => 'dns', value => $_ }} @ARGV;
my $r = acme_resource('newOrder', identifiers => \@identifiers);
my $order = request_json_decode($r);
my $orderurl = $r->header('Location');
foreach (@{$order->{authorizations}}) {
my $authz = request_json_decode(acme($_));
next unless $authz->{status} eq 'pending';
my $identifier = $authz->{identifier}->{value};
my ($challenge) = grep {$_->{type} eq 'http-01'} @{$authz->{challenges} // []};
die "Missing 'http-01' challenge in server response for '$identifier'\n"
unless defined $challenge;
die "Invalid challenge token ".($challenge->{token} // '')."\n"
# ensure we don't write outside the cwd
unless ($challenge->{token} // '') =~ /\A[A-Za-z0-9_\-]+\z/;
my $keyAuthorization = $challenge->{token}.'.'.$JWK_thumbprint;
# serve $keyAuthorization at http://$domain/.well-known/acme-challenge/$challenge->{token}
if (sysopen(my $fh, $challenge->{token}, O_CREAT|O_EXCL|O_WRONLY, 0644)) {
$fh->print($keyAuthorization);
$fh->close() or die "close: $!";
} elsif ($! == EEXIST) {
print STDERR "WARNING: File exists: $challenge->{token}\n";
} else {
die "open($challenge->{token}): $!";
}
my $r = acme($challenge->{url}, {});
request_json_decode($r);
}
# poll the order URL (to get the status of all challenges at once)
# until the status become 'valid'
my $orderstr = join(', ', map {uc($_->{type}) .":". $_->{value}} @identifiers);
my $certuri;
for (my $i = 0;;) {
my $r = acme($orderurl);
my $resp = request_json_decode($r);
if (defined (my $problem = $resp->{error})) { # problem document (RFC 7807)
my $msg = $problem->{status};
$msg .= " " .$problem->{title} if defined $problem->{title};
$msg .= " (".$problem->{detail}.")" if defined $problem->{detail};
die $msg, "\n";
}
my $status = $resp->{status};
if (!defined $status or $status eq "invalid") {
die "Error: Invalid order $orderstr\n";
}
elsif ($status eq "ready") {
my $r = acme($order->{finalize}, {csr => encode_base64url($csr)});
my $resp = request_json_decode($r);
$certuri = $resp->{certificate};
last;
}
elsif ($status eq "valid") {
$certuri = $resp->{certificate} //
die "Error: Missing \"certificate\" field in \"valid\" order\n";
last;
}
elsif ($status ne "pending" and $status ne "processing") {
warn "Unknown order status: $status\n";
}
my $retry_after = request_retry_after($r) // 1;
print STDERR "Retrying after $retry_after seconds...\n";
$i += $retry_after;
die "Timeout exceeded while waiting for challenges to pass ($orderstr)\n"
if $timeout > 0 and $i >= $timeout;
sleep $retry_after;
}
# poll until the cert is available
print STDERR "Certificate URI: $certuri\n";
for (my $i = 0;;) {
$r = acme($certuri);
die request_status_line($r), "\n" unless $r->is_success();
last unless $r->code == 202; # Accepted
my $retry_after = request_retry_after($r) // 1;
print STDERR "Retrying after $retry_after seconds...\n";
$i += $retry_after;
die "Timeout exceeded while waiting for certificate\n" if $timeout > 0 and $i >= $timeout;
sleep $retry_after;
}
print $r->decoded_content();
}
#############################################################################
# revokeCert
# The certificate to revoke is passed (in DER format) to STDIN; this
# is needed since the ACME client might not have read access to the
# X.509 file
#
elsif ($COMMAND eq 'revokeCert') {
die if @ARGV;
my $der = do { local $/ = undef; };
close STDIN or die "close: $!";
# RFC 8555 sec. 6.2: send a KID if the request is signed with the
# acccount key, otherwise send a JWK
# We have no way to know which of the account key or certificate key
# is used, so we try to get a KID and fallback to sending the JWK
set_kid(0);
my $r = acme_resource('revokeCert', certificate => encode_base64url($der));
exit 0 if $r->is_success();
die request_status_line($r), "\n";
}
lacme-0.8.0/config/ 0000775 0000000 0000000 00000000000 14014612315 0014042 5 ustar 00root root 0000000 0000000 lacme-0.8.0/config/lacme-accountd.conf 0000664 0000000 0000000 00000002114 14014612315 0017566 0 ustar 00root root 0000000 0000000 # The value of "privkey" specifies the (private) account key to use
# for signing requests. Currently supported values are:
#
# - file:FILE, for a private key in PEM format (optionally encrypted)
# - gpg:FILE, for a gpg-encrypted private key
#
#privkey = file:/path/to/account.key
#privkey = gpg:/path/to/encrypted/account.key.gpg
# For a gpg-encrypted private account key, "gpg" specifies the binary
# gpg(1) to use, as well as some default options. Default: "gpg
# --quiet".
#
#gpg = gpg --quiet --no-auto-check-trustdb
# The value of "socket" specifies the UNIX-domain socket to bind against
# for signature requests from the ACME client. An error is raised if
# the path exists or if its parent directory is writable by other
# users.
#
#socket = %t/S.lacme
# An optional file where to log to.
#
#logfile =
# The "Key ID", as shown by `acme account`, to give the ACME client.
# A non-empty value revokes all account management access (status
# change, contact address updates etc.) from the client.
#
#keyid =
# Be quiet. Possible values: "Yes"/"No".
#
#quiet = Yes
; vim:ft=dosini
lacme-0.8.0/config/lacme-certs.conf 0000664 0000000 0000000 00000003775 14014612315 0017124 0 ustar 00root root 0000000 0000000 # Each non-default section refer to separate certificate issuance
# requests. Settings in the default section apply to each sections.
# Message digest to sign the Certificate Signing Request with,
# overriding the req(1ssl) default.
#
#hash =
# Comma-separated list of Key Usages, for instance "digitalSignature,
# keyEncipherment", to include in the Certificate Signing Request.
# See x509v3_config(5ssl) for a list of possible values. Note that the
# ACME might override the value provided here.
#
#keyUsage =
# Path to the bundle of trusted issuer certificates. This is used for
# validating each certificate after issuance or renewal. Specifying an
# empty value skips certificate validation.
#
#CAfile = @@datadir@@/lacme/ca-certificates.crt
# For an existing certificate, the minimum number of days before its
# expiration date the section is considered for re-issuance.
#
#min-days = 21
#[www]
# Path the service's private key. This setting is required.
#
#certificate-key = /etc/nginx/ssl/srv.key
# Where to store the issued certificate (in PEM format).
#
#certificate = /etc/nginx/ssl/srv.crt
# Where to store the issued certificate along with its chain of trust
# (in PEM format).
#
#certificate-chain = /etc/nginx/ssl/srv.chain.crt
# Subject field of the Certificate Signing Request. This setting is
# required.
#
#subject = /CN=example.org
# Comma-separated list of Subject Alternative Names.
#
#subjectAltName = DNS:example.org,DNS:www.example.org
# username[:groupname] to chown the issued certificate and
# certificate-chain with.
#
#chown = root:root
# Octal mode to chmod the issued certificate and certificate-chain with.
#
#chmod = 0644
# Command to pass the the system's command shell ("/bin/sh -c") after
# successful installation of the certificate and/or certificate-chain.
#
#notify = /bin/systemctl reload nginx
#[smtp]
#certificate-key = /etc/postfix/ssl/srv.key
#certificate-chain = /etc/postfix/ssl/srv.crt
#subject = /CN=smtp.example.org
#notify = /bin/systemctl reload postfix
; vim:ft=dosini
lacme-0.8.0/config/lacme.conf 0000664 0000000 0000000 00000007106 14014612315 0015776 0 ustar 00root root 0000000 0000000 # For certificate issuance (newOrder command), specify a space-separated
# certificate configuration files or directories to use
#
#config-certs = lacme-certs.conf lacme-certs.conf.d/
[client]
# The value of "socket" specifies the path to the lacme-accountd(1)
# UNIX-domain socket to connect to for signature requests from the ACME
# client. lacme(8) aborts if the socket is readable or writable by
# other users, or if its parent directory is writable by other users.
# This setting is ignored when lacme-accountd(1) is spawned by lacme(8),
# since the two processes communicate through a socket pair. See the
# "accountd" section below for details.
#
#socket = %t/S.lacme
# username to drop privileges to (setting both effective and real uid).
# Skip privilege drop if the value is empty (not recommended).
#
#user = @@lacme_client_user@@
# groupname to drop privileges to (setting both effective and real gid,
# and also setting the list of supplementary gids to that single group).
# Skip privilege drop if the value is empty (not recommended).
#
#group = @@lacme_client_group@@
# ACME client command.
#
#command = @@libexecdir@@/lacme/client
# URI of the ACME server's directory. NOTE: Use the staging server
# for testing
# as it has relaxed rate-limiting.
#
#server = @@acmeapi_server@@
# Timeout in seconds after which the client stops polling the ACME
# server and considers the request failed.
#
#timeout = 30
# Whether to verify the server certificate chain.
#
#SSL_verify = yes
# Specify the version of the SSL protocol used to transmit data.
#
#SSL_version = SSLv23:!TLSv1_1:!TLSv1:!SSLv3:!SSLv2
# Specify the cipher list for the connection.
#
#SSL_cipher_list = EECDH+AESGCM:!MEDIUM:!LOW:!EXP:!aNULL:!eNULL
[webserver]
# Comma- or space-separated list of addresses to listen on, for instance
# "0.0.0.0:80 [::]:80".
#
#listen = @@runstatedir@@/lacme-www.socket
# Directory under which an external HTTP daemon is configured to serve
# GET requests for challenge files under "/.well-known/acme-challenge/"
# (for each virtual host requiring authorization) as static files.
# NOTE: the directory must exist and be writable by the lacme client
# user.
#
#challenge-directory =
# username to drop privileges to (setting both effective and real uid).
# Skip privilege drop if the value is empty (not recommended).
#
#user = @@lacme_www_user@@
# groupname to drop privileges to (setting both effective and real gid,
# and also setting the list of supplementary gids to that single group).
# Skip privilege drop if the value is empty (not recommended).
#
#group = @@lacme_www_group@@
# ACME webserver command.
#
#command = @@libexecdir@@/lacme/webserver
# Whether to automatically install iptables(8) rules to open the
# ADDRESS[:PORT] specified with listen. Theses rules are automatically
# removed once lacme(8) exits.
#
#iptables = No
[accountd]
# lacme-accound(1) section. Comment out this section (including its
# header), or use the --socket= CLI option, to make lacme(8) connect to
# an existing lacme-accountd(1) process via a UNIX-domain socket.
# username to drop privileges to (setting both effective and real uid).
# Skip privilege drop if the value is empty.
#
#user =
# groupname to drop privileges to (setting both effective and real gid,
# and also setting the list of supplementary gids to that single group).
# Skip privilege drop if the value is empty.
#
#group =
# lacme-accountd(1) command.
#
#command = @@bindir@@/lacme-accountd
# Path to the lacme-accountd(1) configuration file.
#
#config =
# Be quiet.
#
#quiet = Yes
; vim:ft=dosini
lacme-0.8.0/lacme 0000775 0000000 0000000 00000110775 14014612315 0013617 0 ustar 00root root 0000000 0000000 #!/usr/bin/perl -T
#----------------------------------------------------------------------
# ACME client written with process isolation and minimal privileges in mind
# Copyright © 2015-2021 Guilhem Moulin
#
# 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 .
#----------------------------------------------------------------------
use v5.14.2;
use strict;
use warnings;
our $VERSION = '0.8.0';
my $NAME = 'lacme';
use Errno 'EINTR';
use Fcntl qw/F_GETFD F_SETFD FD_CLOEXEC O_CREAT O_EXCL O_WRONLY SEEK_SET/;
use File::Basename 'dirname';
use File::Temp ();
use Getopt::Long qw/:config posix_default no_ignore_case gnu_getopt auto_version/;
use POSIX ();
use Socket 1.95 qw/AF_UNIX AF_INET AF_INET6 PF_UNIX PF_INET PF_INET6 PF_UNSPEC
INADDR_ANY IN6ADDR_ANY IPPROTO_IPV6
SOCK_STREAM SOL_SOCKET SO_REUSEADDR SHUT_RDWR/;
use Config::Tiny ();
use Date::Parse ();
use Net::SSLeay ();
# Clean up PATH
$ENV{PATH} = join ':', qw{/usr/bin /bin};
delete @ENV{qw/IFS CDPATH ENV BASH_ENV/};
my ($COMMAND, %OPTS, $CONFFILE, $CONFIG, @CLEANUP);
$SIG{$_} = sub() { exit 1 } foreach qw/INT TERM/; # run the END block upon SIGINT/SIGTERM
#############################################################################
# Parse and validate configuration
#
sub usage(;$$) {
my $rv = shift // 0;
if ($rv) {
my $msg = shift;
print STDERR $msg."\n" if defined $msg;
print STDERR "Try '$NAME --help' or consult the manpage for more information.\n";
}
else {
print STDERR "Usage: $NAME [--config=FILE] [--socket=PATH] [OPTIONS] COMMAND [ARGUMENT ..]\n"
."Consult the manpage for more information.\n";
}
exit $rv;
}
usage(1) unless GetOptions(\%OPTS, qw/config=s config-certs=s@ socket=s
register tos-agreed deactivate
min-days=i force
quiet|q
debug help|h/);
usage(0) if $OPTS{help};
$COMMAND = shift(@ARGV) // usage(1, "Missing command");
$COMMAND = $COMMAND =~ /\A(account|newOrder|new-cert|revokeCert|revoke-cert)\z/ ? $1
: usage(1, "Invalid command: $COMMAND"); # validate and untaint $COMMAND
@ARGV = map { /\A(\p{Print}*)\z/ ? $1 : die } @ARGV; # untaint @ARGV
sub env_fallback($$) {
my $v = $ENV{ shift() };
return (defined $v and $v ne "") ? $v : shift;
}
sub spec_expand($) {
my $str = shift;
$str =~ s#%(.)# my $x =
$1 eq "C" ? ($< == 0 ? "@@localstatedir@@/cache" : env_fallback(XDG_CACHE_HOME => "$ENV{HOME}/.cache"))
: $1 eq "E" ? ($< == 0 ? "@@sysconfdir@@" : env_fallback(XDG_CONFIG_HOME => "$ENV{HOME}/.config"))
: $1 eq "g" ? (getgrgid((split /\s/,$()[0]))[0]
: $1 eq "G" ? $( =~ s/\s.*//r
: $1 eq "h" ? (getpwuid($<))[7]
: $1 eq "u" ? (getpwuid($<))[0]
: $1 eq "U" ? $<
: $1 eq "t" ? ($< == 0 ? "@@runstatedir@@" : $ENV{XDG_RUNTIME_DIR})
: $1 eq "T" ? env_fallback(TMPDIR => "/tmp")
: $1 eq "%" ? "%"
: die "Error: \"$str\" has unknown specifier %$1\n";
die "Error: Undefined expansion %$1 in \"$str\"\n" unless defined $x;
$x;
#ge;
return $str;
}
sub set_FD_CLOEXEC($$);
my $CONFFILENAME = spec_expand($OPTS{config} // "%E/lacme/$NAME.conf");
do {
print STDERR "Using configuration file: $CONFFILENAME\n" if $OPTS{debug};
open $CONFFILE, '<', $CONFFILENAME or die "Can't open $CONFFILENAME: $!\n";
my $conf = do { local $/ = undef; <$CONFFILE> };
# don't close $CONFFILE so we can pass it to the client
set_FD_CLOEXEC($CONFFILE, 1);
my $h = Config::Tiny::->read_string($conf) or die Config::Tiny::->errstr()."\n";
my $defaults = delete $h->{_} // {};
my $accountd = defined $OPTS{socket} ? 0 : exists $h->{accountd} ? 1 : 0;
my %valid = (
client => {
socket => '%t/S.lacme',
user => '@@lacme_client_user@@',
group => '@@lacme_client_group@@',
command => '@@libexecdir@@/lacme/client',
# the rest is for the ACME client
map {$_ => undef} qw/server timeout SSL_verify SSL_version SSL_cipher_list/
},
webserver => {
listen => '@@runstatedir@@/lacme-www.socket',
'challenge-directory' => undef,
user => '@@lacme_www_user@@',
group => '@@lacme_www_group@@',
command => '@@libexecdir@@/lacme/webserver',
iptables => 'No'
},
accountd => {
user => '',
group => '',
command => '@@bindir@@/lacme-accountd',
config => '',
privkey => '',
quiet => 'Yes',
}
);
foreach my $s (keys %valid) {
my $h = delete $h->{$s} // {};
my %v = map { $_ => delete $h->{$_} // $valid{$s}->{$_} } keys %{$valid{$s}};
die "Unknown option(s) in [$s]: ".join(', ', keys %$h)."\n" if %$h;
$h->{$_} //= $defaults->{$_} foreach keys %$defaults;
$CONFIG->{$s} = \%v;
}
die "Invalid section(s): ".join(', ', keys %$h)."\n" if %$h;
$CONFIG->{_} = $defaults;
delete $CONFIG->{accountd} unless $accountd;
$OPTS{quiet} = 0 if $OPTS{debug};
};
# Regular expressions for domain validation
my $RE_LABEL = qr/[0-9a-z](?:[0-9a-z\x2D]{0,61}[0-9a-z])?/aai;
my $RE_DOMAIN = qr/$RE_LABEL(?:\.$RE_LABEL)+/;
#############################################################################
# Generate a Certificate Signing Request (in DER format)
#
sub gen_csr(%) {
my %args = @_;
return unless defined $args{'certificate-key'} and defined $args{subject};
return if defined $args{hash} and !grep { $args{hash} eq $_ } qw/md5 rmd160 sha1 sha224 sha256 sha384 sha512/;
my $config = File::Temp::->new(SUFFIX => '.conf', TMPDIR => 1) // die;
$config->print(
"[ req ]\n",
"distinguished_name = req_distinguished_name\n",
"req_extensions = v3_req\n",
"[ req_distinguished_name ]\n",
"[ v3_req ]\n",
"basicConstraints = critical, CA:FALSE\n",
"subjectKeyIdentifier = hash\n"
);
$config->print("keyUsage = critical, $args{keyUsage}\n") if defined $args{keyUsage};
$config->print("subjectAltName = $args{subjectAltName}\n") if defined $args{subjectAltName};
$config->print("tlsfeature = $args{tlsfeature}\n") if defined $args{tlsfeature};
$config->close() or die "close: $!";
my @args = (qw/-new -batch -key/, $args{'certificate-key'});
push @args, "-$args{hash}" if defined $args{hash};
push @args, '-subj', $args{subject}, '-config', $config->filename(), qw/-reqexts v3_req/;
open my $fh, '-|', qw/openssl req -outform DER/, @args or die "fork: $!";
my $csr = do { local $/ = undef; <$fh> };
close $fh or $! ? die "close: $!" : return;
if ($OPTS{debug}) {
# print out the CSR in text form
pipe my $rd, my $wd or die "pipe: $!";
my $pid = fork // die "fork: $!";
unless ($pid) {
open STDIN, '<&', $rd or die "dup: $!";
open STDOUT, '>&', \*STDERR or die "dup: $!";
exec qw/openssl req -noout -text -inform DER/ or die;
}
$rd->close() or die "close: $!";
$wd->print($csr);
$wd->close() or die "close: $!";
waitpid $pid => 0;
die $? if $? > 0;
}
return $csr;
}
#############################################################################
# Get the timestamp of the given cert's expiration date.
# Internally the expiration date is stored as a RFC3339 string (such as
# yyyy-mm-ddThh:mm:ssZ); we convert it to a timestamp manually.
#
sub x509_enddate($) {
my $filename = shift;
my ($bio, $x509, $time, $dt);
$bio = Net::SSLeay::BIO_new_file($filename, 'r');
$x509 = Net::SSLeay::PEM_read_bio_X509($bio) if defined $bio;
$time = Net::SSLeay::X509_get_notAfter($x509) if defined $x509;
$dt = Net::SSLeay::P_ASN1_TIME_get_isotime($time) if defined $time;
my $t = Date::Parse::str2time($dt) if defined $dt;
Net::SSLeay::X509_free($x509) if defined $x509;
Net::SSLeay::BIO_free($bio) if defined $bio;
return $t;
}
#############################################################################
# Drop privileges and chdir afterwards
#
sub drop_privileges($$$) {
my ($user, $group, $dir) = @_;
# set effective and real gid; also set the list of supplementary gids to that single gid
if ($group ne '') {
my $gid = getgrnam($group) // die "getgrnam($group): $!";
$) = "$gid $gid";
die "setgroups: $!" if $@;
POSIX::setgid($gid) or die "setgid: $!";
die "Couldn't setgid/setguid" unless $( eq "$gid $gid" and $) eq "$gid $gid"; # safety check
}
# set effective and real uid
if ($user ne '') {
my $uid = getpwnam($user) // die "getpwnam($user): $!";
POSIX::setuid($uid) or die "setuid: $!";
die "Couldn't setuid/seteuid" unless $< == $uid and $> == $uid; # safety check
}
# sanitize environment
my $term = $ENV{TERM};
my @ent = getpwuid($<) or die "getpwuid($<): $!";
%ENV = ( USER => $ent[0], LOGNAME => $ent[0], HOME => $ent[7], SHELL => $ent[8] );
$ENV{PATH} = $< == 0 ? "/usr/sbin:/usr/bin:/sbin:/bin" : "/usr/bin:/bin";
$ENV{TERM} = $term if defined $term; # preserve $TERM
chdir $dir or die "chdir($dir): $!";
}
#############################################################################
# Ensure the FD_CLOEXEC bit is $set on $fd
#
sub set_FD_CLOEXEC($$) {
my ($fd, $set) = @_;
my $flags = fcntl($fd, F_GETFD, 0) or die "fcntl F_GETFD: $!";
my $flags2 = $set ? ($flags | FD_CLOEXEC) : ($flags & ~FD_CLOEXEC);
return if $flags == $flags2;
fcntl($fd, F_SETFD, $flags2) or die "fcntl F_SETFD: $!";
}
#############################################################################
# If 'listen' is not empty, bind socket(s) to the given addresse(s) and
# spawn webserver(s) to serve ACME challenge reponses.
# The temporary challenge directory is returned.
#
sub spawn_webserver() {
my $conf = $CONFIG->{webserver};
# parse and pack addresses to listen to
my @sockaddr;
foreach my $a (split /[[:blank:],]\s*/, $conf->{listen}) {
my $sockaddr;
if ($a =~ /\A\//) { # absolute path to a unix domain socket
$sockaddr = Socket::pack_sockaddr_un($a);
} elsif ($a =~ /\A(\d+(?:\.\d+){3})(?::(\d+))?\z/) {
my $n = Socket::inet_pton(AF_INET, $1);
$sockaddr = Socket::pack_sockaddr_in($2 // 80, $n) if defined $n;
} elsif ($a =~ /\A\[([[:xdigit:]:.]{2,39})\](?::(\d+))?\z/) {
my $n = Socket::inet_pton(AF_INET6, $1);
$sockaddr = Socket::pack_sockaddr_in6($2 // 80, $n) if defined $n;
}
die "Invalid address: $a\n" unless defined $sockaddr;
push @sockaddr, $sockaddr;
}
# Use existing HTTPd to serve challenge files using 'challenge-directory'
# as document root
if (defined (my $dir = $conf->{'challenge-directory'})) {
$dir = spec_expand($dir);
print STDERR "[$$] Using existing webserver on $dir\n" if $OPTS{debug};
# lacme(8) doesn't have the list of challenge files to delete on
# cleanup -- instead, we unlink all files and fails at
# initialization stage when the challenge directory is not empty
opendir my $dh, $dir or die "opendir($dir): $!\n";
while (readdir $dh) {
die "Error: Refusing to use non-empty challenge directory $dir\n"
unless $_ eq '.' or $_ eq '..';
}
closedir $dh or die "closedir: $!";
undef $dh;
# use a "lock file" (NFS-friendly) to avoid concurrent usages
my $lockfile = ".$NAME.lock";
sysopen(my $fh, "$dir/$lockfile", O_CREAT|O_EXCL|O_WRONLY, 0600)
or die "Can't create lockfile in challenge directory: $!";
print $fh $$, "\n";
close $fh or die "close: $!";
undef $fh;
push @CLEANUP, sub() {
if (opendir(my $dh, $dir)) {
my @files = grep { $_ ne '.' and $_ ne '..' and $_ ne $lockfile } readdir $dh;
closedir $dh or warn "closedir: $!";
push @files, $lockfile; # unlink $lockfile last
foreach (@files) {
die unless /\A(.+)\z/; # untaint
unlink "$dir/$1" or warn "unlink($dir/$1): $!";
}
} else {
warn "opendir($dir): $!\n";
}
};
return $dir; # ignore 'listen' and 'iptables'
}
die "'challenge-directory' option is required in section [webserver] when 'listen' is empty\n"
unless @sockaddr;
# create a temporary directory; give write access to the ACME client
# and read access to the webserver
my $tmpdir = File::Temp::->newdir(CLEANUP => 1, TMPDIR => 1, TEMPLATE => "acme-challenge.XXXXXXXXXX") // die;
chmod 0755, $tmpdir or die "chmod: $!";
if ((my $username = $CONFIG->{client}->{user}) ne '') {
my $uid = getpwnam($username) // die "getpwnam($username): $!";
chown($uid, -1, $tmpdir) or die "chown: $!";
}
# create socket(s) and spawn webserver(s)
my @sockaddr4;
foreach my $sockaddr (@sockaddr) {
my $domain = Socket::sockaddr_family($sockaddr) // die;
socket(my $sock, $domain, SOCK_STREAM, 0) or die "socket: $!";
setsockopt($sock, SOL_SOCKET, SO_REUSEADDR, pack("l", 1))
if $domain == AF_INET or $domain == AF_INET6;
my $p; # pretty-print the address/port
if ($domain == AF_UNIX) {
$p = Socket::unpack_sockaddr_un($sockaddr);
} elsif ($domain == AF_INET) {
my ($port, $addr) = Socket::unpack_sockaddr_in($sockaddr);
$p = Socket::inet_ntop($domain, $addr).":$port";
} elsif ($domain == AF_INET6) {
my ($port, $addr) = Socket::unpack_sockaddr_in6($sockaddr);
$p = "[".Socket::inet_ntop($domain, $addr)."]:$port";
}
if ($domain == AF_UNIX) {
# bind(2) with a loose umask(2) to allow anyone to connect
my $umask = umask(0111) // die "umask: $!";
my $path = Socket::unpack_sockaddr_un($sockaddr);
bind($sock, $sockaddr) or die "Couldn't bind to $p: $!";
push @CLEANUP, sub() {
print STDERR "Unlinking $path\n" if $OPTS{debug};
unlink $path or warn "Warning: Couldn't unlink $path: $!";
};
umask($umask) // die "umask: $!";
}
else {
bind($sock, $sockaddr) or die "Couldn't bind to $p: $!";
}
listen($sock, 5) or die "listen: $!";
# spawn a webserver component bound to the given socket
my $pid = fork() // "fork: $!";
unless ($pid) {
drop_privileges($conf->{user}, $conf->{group}, $tmpdir);
open STDIN, '<', '/dev/null' or die "open(/dev/null): $!";
set_FD_CLOEXEC($sock, 0);
$ENV{DEBUG} = $OPTS{debug} // 0;
# use execve(2) rather than a Perl pseudo-process to ensure that
# the child doesn't have access to the parent's memory
my ($cmd, @args) = split(/\s+/, $conf->{command}) or die "Empty webserver command\n";
exec { $cmd } $cmd, @args, fileno($sock) or die;
}
print STDERR "[$$] Forking ACME webserver bound to $p, child PID $pid\n" if $OPTS{debug};
set_FD_CLOEXEC($sock, 1);
push @CLEANUP, sub() {
print STDERR "[$$] Shutting down ACME webserver bound to $p\n" if $OPTS{debug};
kill 15 => $pid;
waitpid $pid => 0;
shutdown($sock, SHUT_RDWR) or warn "shutdown: $!";
};
# on dual-stack ipv4/ipv6, we'll need to open the port for the
# v4-mapped address as well
if ($domain == AF_INET6) {
my $v6only = getsockopt($sock, Socket::IPPROTO_IPV6, Socket::IPV6_V6ONLY)
// die "getsockopt(IPV6_V6ONLY): $!";
my ($port, $addr) = Socket::unpack_sockaddr_in6($sockaddr);
my $mask = "\xFF" x 12 . "\x00" x 4;
my $prefix = "\x00" x 10 . "\xFF" x 2 . "\x00" x 4;
if (unpack('i', $v6only) == 0) {
if ($addr eq IN6ADDR_ANY) {
push @sockaddr4, Socket::pack_sockaddr_in($port, INADDR_ANY);
} elsif (($addr & $mask) eq $prefix) {
my $v4 = substr($addr, 12);
push @sockaddr4, Socket::pack_sockaddr_in($port, $v4);
}
}
}
}
# allow incoming traffic on the given addresses
if (lc ($conf->{iptables} // 'No') eq 'yes') {
iptables_save(AF_INET, @sockaddr, @sockaddr4);
iptables_save(AF_INET6, @sockaddr);
}
return $tmpdir;
}
#############################################################################
# Save current iptables/ipv6tables to a temporary file and install
# temporary rules to open the given addresses/ports.
sub iptables_save($@) {
my $domain = shift;
my @sockaddr = grep { Socket::sockaddr_family($_) == $domain } @_;
return unless @sockaddr; # no address in that domain
# install iptables
my $iptables_bin = $domain == AF_INET ? 'iptables' : $domain == AF_INET6 ? 'ip6tables' : die;
my $iptables_tmp = File::Temp::->new(TMPDIR => 1) // die;
set_FD_CLOEXEC($iptables_tmp, 1);
my $pid = fork() // die "fork: $!";
unless ($pid) {
open STDIN, '<', '/dev/null' or die "open(/dev/null): $!";
open STDOUT, '>&', $iptables_tmp or die "dup: $!";
$| = 1; # turn off buffering for STDOUT
exec "/usr/sbin/$iptables_bin-save", "-c" or die;
}
waitpid $pid => 0;
die "Error: /usr/sbin/$iptables_bin-save exited with value ".($? >> 8) if $? > 0;
# seek back to the begining, as we'll restore directly from the
# handle and not from the file. XXX if there was a way in Perl to
# use open(2) with the O_TMPFILE flag we would use that to avoid
# creating a file to start with
seek($iptables_tmp, SEEK_SET, 0) or die "seek: $!";
push @CLEANUP, sub() {
print STDERR "[$$] Restoring $iptables_bin\n" if $OPTS{debug};
my $pid = fork() // die "fork: $!";
unless ($pid) {
open STDIN, '<&', $iptables_tmp or die "dup: $!";
open STDOUT, '>', '/dev/null' or die "open(/dev/null): $!";
exec "/usr/sbin/$iptables_bin-restore", "-c" or die;
}
waitpid $pid => 0;
warn "Warning: /usr/sbin/$iptables_bin-restore exited with value ".($? >> 8) if $? > 0;
};
# it's safe to install the new iptables to open $addr:$port now that
# the restore hook is in place
foreach my $sockaddr (@sockaddr) {
my ($port, $addr, $mask);
if ($domain == AF_INET) {
($port, $addr) = Socket::unpack_sockaddr_in($sockaddr);
$mask = $addr eq INADDR_ANY ? '0' : '32';
} elsif ($domain == AF_INET6) {
($port, $addr) = Socket::unpack_sockaddr_in6($sockaddr);
$mask = $addr eq IN6ADDR_ANY ? '0' : '128';
}
my $dest = Socket::inet_ntop($domain, $addr) .'/'. $mask;
system ("/usr/sbin/$iptables_bin", qw/-I INPUT -p tcp -m tcp -m state/,
'-d', $dest, '--dport', $port,
'--state', 'NEW,ESTABLISHED', '-j', 'ACCEPT') == 0 or die;
system ("/usr/sbin/$iptables_bin", qw/-I OUTPUT -p tcp -m tcp -m state/,
'-s', $dest, '--sport', $port,
'--state', 'ESTABLISHED', '-j', 'ACCEPT') == 0 or die;
}
}
#############################################################################
# Spawn the client component, and wait for it to return.
# If $args->{in} is defined, the data is written to the client's STDIN.
# If $args->{out} is defined, its value is set to client's STDOUT data.
#
sub acme_client($@) {
my $args = shift;
my @args = @_;
my ($client, $cleanup);
my $conf = $CONFIG->{client};
if (defined (my $accountd = $CONFIG->{accountd})) {
warn "Setting 'privkey' in lacme.conf's [accountd] section is deprecated and will become an error in a future release! "
."Set it in lacme-accountd.conf instead.\n" if $accountd->{privkey} ne '';
my $GPG_TTY = $ENV{GPG_TTY};
socketpair($client, my $s, AF_UNIX, SOCK_STREAM, PF_UNSPEC) or die "socketpair: $!";
my $pid = fork() // "fork: $!";
unless ($pid) {
drop_privileges($accountd->{user}, $accountd->{group}, '/');
$client->close() or die "close: $!";
open STDIN, '<&', $s or die "dup: $!";
open STDOUT, '>&', $s or die "dup: $!";
set_FD_CLOEXEC($s, 1);
$ENV{GPG_TTY} = $GPG_TTY if defined $GPG_TTY;
my ($cmd, @args) = split(/\s+/, $accountd->{command}) or die "Empty accountd command\n";
$_ = spec_expand($_) foreach ($cmd, @args); # expand %-specifiers after privilege drop and whitespace split
push @args, '--stdio';
push @args, '--config='.spec_expand($accountd->{config}) if $accountd->{config} ne '';
push @args, '--privkey='.$accountd->{privkey} if $accountd->{privkey} ne ''; # XXX deprecated in 0.8.0
push @args, '--quiet' unless lc $accountd->{quiet} eq 'no';
push @args, '--debug' if $OPTS{debug};
exec { $cmd } $cmd, @args or die;
}
print STDERR "[$$] Forking lacme-accountd, child PID $pid\n" if $OPTS{debug};
$s->close() or die "close: $!";
$cleanup = sub() {
print STDERR "[$$] Shutting down lacme-accountd\n" if $OPTS{debug};
shutdown($client, SHUT_RDWR) or warn "shutdown: $!";
$client->close() or warn "close: $!";
};
push @CLEANUP, $cleanup;
}
else {
my @stat;
my $sockname = spec_expand($OPTS{socket} // $conf->{socket});
$sockname = $sockname =~ /\A(\p{Print}+)\z/ ? $1 : die "Invalid socket name\n"; # untaint $sockname
# ensure we're the only user with write access to the parent dir
my $dirname = dirname($sockname);
@stat = stat($dirname) or die "Error: stat($dirname): $!\n";
die "Error: Insecure permissions on $dirname\n" if ($stat[2] & 0022) != 0;
# ensure we're the only user with read/write access to the socket
@stat = stat($sockname) or die "Can't stat $sockname: $! (Is lacme-accountd running?)\n";
die "Error: Insecure permissions on $sockname\n" if ($stat[2] & 0066) != 0;
# connect(2) to the socket
socket($client, PF_UNIX, SOCK_STREAM, 0) or die "socket: $!";
my $sockaddr = Socket::sockaddr_un($sockname) // die "Invalid address $sockname\n";
until (connect($client, $sockaddr)) {
next if $! == EINTR; # try again if connect(2) was interrupted by a signal
die "connect: $!";
}
}
# use execve(2) rather than a Perl pseudo-process to ensure that the
# child doesn't have access to the parent's memory
my ($cmd, @args2) = split(/\s+/, $conf->{command}) or die "Empty client command\n";
my @fileno = map { fileno($_) =~ /^(\d+)$/ ? $1 : die } ($CONFFILE, $client); # untaint fileno
set_FD_CLOEXEC($client, 1);
my $rv = spawn({in => $args->{in}, out => $args->{out}, child => sub() {
drop_privileges($conf->{user}, $conf->{group}, $args->{chdir} // '/');
set_FD_CLOEXEC($_, 0) foreach ($CONFFILE, $client);
seek($CONFFILE, SEEK_SET, 0) or die "seek: $!";
$ENV{DEBUG} = $OPTS{debug} // 0;
}}, $cmd, @args2, $COMMAND, @fileno, @args);
if (defined $cleanup) {
@CLEANUP = grep { $_ ne $cleanup } @CLEANUP;
$cleanup->();
}
return $rv;
}
sub spawn($@) {
my $args = shift;
my ($cmd, @args) = @_;
# create communication pipes if needed
my ($in_rd, $in_wd, $out_rd, $out_wd);
if (defined $args->{in}) {
pipe $in_rd, $in_wd or die "pipe: $!";
}
if (defined $args->{out} and ref $args->{out} ne 'GLOB') {
pipe $out_rd, $out_wd or die "pipe: $!";
}
my $pid = fork() // "fork: $!";
unless ($pid) {
# child
$args->{child}->() if defined $args->{child};
if (defined $args->{in}) {
close $in_wd or die "close: $!";
open STDIN, '<&', $in_rd or die "dup: $!";
} else {
open STDIN, '<', '/dev/null' or die "open(/dev/null): $!";
}
if (!defined $args->{out}) {
open STDOUT, '>', '/dev/null' or die "open(/dev/null): $!";
} elsif (ref $args->{out} ne 'GLOB') {
close $out_rd or die "close: $!";
open STDOUT, '>&', $out_wd or die "dup: $!";
} elsif (fileno(STDOUT) != fileno($args->{out})) {
open STDOUT, '>&', $args->{out} or die "dup: $!";
}
exec { $cmd } $cmd, @args or die;
}
push @CLEANUP, sub() {
kill 15 => $pid;
waitpid $pid => 0;
};
# parent
print STDERR "[$$] Forking $cmd, child PID $pid\n" if $OPTS{debug};
if (defined $args->{in}) {
$in_rd->close() or die "close: $!";
$in_wd->print($args->{in});
$in_wd->close() or die "close: $!";
}
if (defined $args->{out} and ref $args->{out} ne 'GLOB') {
$out_wd->close() or die "close: $!";
if (ref $args->{out} eq 'CODE') {
$args->{out}->($out_rd);
} elsif (ref $args->{out} eq 'SCALAR') {
${$args->{out}} = do { local $/ = undef; $out_rd->getline() };
}
$out_rd->close() or die "close: $!";
}
waitpid $pid => 0;
pop @CLEANUP;
undef ${$args->{out}} if defined $args->{out} and ref $args->{out} eq 'SCALAR' and $? > 0;
return $? > 255 ? ($? >> 8) : $? > 0 ? 1 : 0;
}
#############################################################################
# Install the certificate (optionally excluding the chain of trust)
#
sub install_cert($$;$) {
my ($filename, $chain, $leafonly) = @_;
my ($dirname, $basename) =
$filename =~ /\A(.*)\/([^\/]+)\z/ ? ($1, $2) : ('.', $filename);
my $fh = File::Temp::->new(UNLINK => 0, DIR => $dirname,
TEMPLATE => "$basename.XXXXXX") // die;
eval {
my $umask = umask() // die "umask: $!";
chmod(0644 &~ $umask, $fh) or die "chmod: $!";
if ($leafonly) {
# keep only the leaf certificate
pipe my $rd, my $wd or die "pipe: $!";
my $pid = fork // die "fork: $!";
unless ($pid) {
open STDIN, '<&', $rd or die "dup: $!";
open STDOUT, '>&', $fh or die "dup: $!";
exec qw/openssl x509 -outform PEM/ or die;
}
$rd->close() or die "close: $!";
$wd->print($chain);
$wd->close() or die "close: $!";
waitpid $pid => 0;
die $? if $? > 0;
} else {
$fh->print($chain) or die "print: $!";
}
$fh->close() or die "close: $!";
};
my $path = $fh->filename();
if ($@) {
print STDERR "Unlinking $path\n" if $OPTS{debug};
unlink $path or warn "unlink($path): $!";
die $@;
}
rename($path, $filename) or die "rename($path, $filename): $!";
}
#############################################################################
# account [--tos-agreed] [CONTACT ..]
#
if ($COMMAND eq 'account') {
my $flags = 0;
$flags |= 1 if $OPTS{'register'};
$flags |= 2 if $OPTS{'tos-agreed'};
$flags |= 4 if $OPTS{'deactivate'};
exit acme_client({out => \*STDOUT}, $flags, @ARGV);
}
#############################################################################
# newOrder [SECTION ..]
#
elsif ($COMMAND eq 'newOrder' or $COMMAND eq 'new-cert') {
$OPTS{'min-days'} = -1 if $OPTS{force};
$COMMAND = 'newOrder';
my $conffiles = defined $OPTS{'config-certs'} ? $OPTS{'config-certs'}
: defined $CONFIG->{_}->{'config-certs'} ? [ split(/\s+/, $CONFIG->{_}->{'config-certs'}) ]
: [ "$NAME-certs.conf", "$NAME-certs.conf.d/" ];
$_ = spec_expand($_) foreach @$conffiles;
my ($conf, %defaults);
foreach my $conffile (@$conffiles) {
$conffile = dirname($CONFFILENAME) .'/'. $conffile unless $conffile =~ /\A\//;
my @filenames;
unless ($conffile =~ s#/\z## or -d $conffile) {
@filenames = ($conffile);
} else {
opendir my $dh, $conffile or die "opendir($conffile): $!\n";
while (readdir $dh) {
if (/\.conf\z/) {
push @filenames, "$conffile/$_";
} elsif ($_ ne '.' and $_ ne '..') {
warn "$conffile/$_ has unknown suffix, skipping\n";
}
}
closedir $dh or die "closedir: $!";
}
foreach my $filename (sort @filenames) {
print STDERR "Reading $filename\n" if $OPTS{debug};
my $h = Config::Tiny::->read($filename) or die Config::Tiny::->errstr()."\n";
my $def = delete $h->{_} // {};
$defaults{$_} = $def->{$_} foreach keys %$def;
my @valid = qw/certificate certificate-chain certificate-key min-days CAfile
hash keyUsage subject subjectAltName tlsfeature chown chmod notify/;
foreach my $s (keys %$h) {
$conf->{$s} = { map { $_ => delete $h->{$s}->{$_} } @valid };
die "Unknown option(s) in [$s]: ".join(', ', keys %{$h->{$s}})."\n" if %{$h->{$s}};
$conf->{$s}->{$_} //= $defaults{$_} foreach keys %defaults;
}
}
}
my $challenge_dir;
my $rv = 0;
foreach my $s (@ARGV ? @ARGV : sort (keys %$conf)) {
my $conf = $conf->{$s} // do {
print STDERR "Warning: No such section $s, skipping\n";
$rv = 1;
next;
};
if ($OPTS{debug}) {
print STDERR "Configuration option for $s:\n";
print STDERR " $_ = $conf->{$_}\n" foreach grep { defined $conf->{$_} } (sort keys %$conf);
}
my $cert = $conf->{'certificate-chain'} // $conf->{'certificate'};
unless (defined $cert) {
print STDERR "[$s] Warning: Missing 'certificate' and 'certificate-chain', skipping\n";
$rv = 1;
next;
}
# skip certificates that expire at least $conf->{'min-days'} days in the future
if (-f $cert and defined (my $t = x509_enddate($cert))) {
my $d = $OPTS{'min-days'} // $conf->{'min-days'} // 21;
if ($d >= 0 and $t - time > $d*86400) {
my $d = POSIX::strftime('%Y-%m-%d %H:%M:%S UTC', gmtime($t));
print STDERR "[$s] Valid until $d, skipping\n" unless $OPTS{quiet};
next;
}
}
# generate the CSR
my $csr = gen_csr(map {$_ => $conf->{$_}} qw/certificate-key keyUsage subject subjectAltName tlsfeature hash/) // do {
print STDERR "[$s] Warning: Couldn't generate CSR, skipping\n";
$rv = 1;
next;
};
# spawn the webserver if not done already
$challenge_dir //= spawn_webserver();
# list all authorization domains to request
my @authz;
push @authz, $1 if defined $conf->{subject} =~ /\A.*\/CN=($RE_DOMAIN)\z/o;
if (defined $conf->{subjectAltName}) {
foreach my $d (split /,/, $conf->{subjectAltName}) {
next unless $d =~ s/\A\s*DNS://;
if ($d =~ /\A$RE_DOMAIN\z/o) {
push @authz, $d unless grep {$_ eq $d} @authz;
} else {
print STDERR "[$s] Warning: Ignoring invalid domain $d\n";
}
}
}
my ($x509, $csr_pubkey, $x509_pubkey);
print STDERR "[$s] Will request authorization for: ".join(", ", @authz), "\n" if $OPTS{debug};
if (acme_client({chdir => $challenge_dir, in => $csr, out => \$x509}, @authz)) {
print STDERR "[$s] Error: Couldn't issue X.509 certificate!\n";
$rv = 1;
next;
}
# extract pubkeys from CSR and cert, and ensure they match
spawn({in => $csr, out => \$csr_pubkey }, qw/openssl req -inform DER -noout -pubkey/);
spawn({in => $x509, out => \$x509_pubkey}, qw/openssl x509 -inform PEM -noout -pubkey/);
unless (defined $x509_pubkey and defined $csr_pubkey and $x509_pubkey eq $csr_pubkey) {
print STDERR "[$s] Error: Received bogus X.509 certificate from ACME server!\n";
$rv = 1;
next;
};
# verify certificate validity against the CA bundle
if ((my $CAfile = $conf->{CAfile} // '@@datadir@@/lacme/ca-certificates.crt') ne '') {
my %args = (in => $x509);
$args{out} = \*STDERR if $OPTS{debug};
my @options = ('-trusted', $CAfile, '-purpose', 'sslserver', '-x509_strict');
push @options, '-show_chain' if $OPTS{debug};
if (spawn(\%args, 'openssl', 'verify', @options)) {
print STDERR "[$s] Error: Received invalid X.509 certificate from ACME server!\n";
$rv = 1;
next;
}
}
# install certificate
if (defined $conf->{'certificate'}) {
print STDERR "Installing X.509 certificate $conf->{'certificate'}\n";
install_cert($conf->{'certificate'}, $x509, 1);
}
if (defined $conf->{'certificate-chain'}) {
print STDERR "Installing X.509 certificate chain $conf->{'certificate-chain'}\n";
install_cert($conf->{'certificate-chain'}, $x509);
}
if (defined $conf->{chown}) {
my ($user, $group) = split /:/, $conf->{chown}, 2;
my $uid = getpwnam($user) // die "getpwnam($user): $!";
my $gid = defined $group ? (getgrnam($group) // die "getgrnam($group): $!") : -1;
foreach (grep defined, @$conf{qw/certificate certificate-chain/}) {
chown($uid, $gid, $_) or die "chown: $!";
}
}
if (defined $conf->{chmod}) {
my $mode = oct($conf->{chmod}) // die;
foreach (grep defined, @$conf{qw/certificate certificate-chain/}) {
chmod($mode, $_) or die "chown: $!";
}
}
my @certopts = join ',', qw/no_header no_version no_pubkey no_sigdump/;
open my $fh, '|-', qw/openssl x509 -noout -fingerprint -sha256 -text -certopt/, @certopts
or die "fork: $!";
print $fh $x509;
close $fh or die $! ?
"close: $!" :
"Error: x509(1ssl) exited with value ".($? >> 8)."\n";
if (defined $conf->{notify}) {
print STDERR "Running notification command `$conf->{notify}`\n";
if (system($conf->{notify}) != 0) {
print STDERR "Warning: notification command exited with value ".($? >> 8)."\n";
$rv = 1;
}
}
}
undef $challenge_dir;
exit $rv;
}
#############################################################################
# revokeCert FILE [FILE ..]
#
elsif ($COMMAND eq 'revokeCert' or $COMMAND eq 'revoke-cert') {
die "Nothing to revoke\n" unless @ARGV;
my $rv = 0;
$COMMAND = 'revokeCert';
foreach my $filename (@ARGV) {
print STDERR "Revoking $filename\n";
# conversion PEM -> DER
open my $fh, '-|', qw/openssl x509 -outform DER -in/, $filename or die "fork: $!";
my $der = do { local $/ = undef; <$fh> };
close $fh or die $! ?
"close: $!" :
"Error: x509(1ssl) exited with value ".($? >> 8)."\n";
my @certopts = join ',', qw/no_header no_version no_pubkey no_sigdump no_extensions/;
open my $fh2, '|-', qw/openssl x509 -inform DER -noout -fingerprint -sha256 -text -certopt/, @certopts
or die "fork: $!";
print $fh2 $der;
close $fh2 or die $! ?
"close: $!" :
"Error: x509(1ssl) exited with value ".($? >> 8)."\n";
if (acme_client({in => $der})) {
print STDERR "Warning: Couldn't revoke $filename\n";
$rv = 1;
}
}
exit $rv;
}
#############################################################################
#
else {
die "Unknown command $COMMAND"
}
END {
local $?;
$_->() foreach reverse @CLEANUP;
}
lacme-0.8.0/lacme-accountd 0000775 0000000 0000000 00000024563 14014612315 0015414 0 ustar 00root root 0000000 0000000 #!/usr/bin/perl -T
#----------------------------------------------------------------------
# ACME client written with process isolation and minimal privileges in mind
# (account key manager)
# Copyright © 2015-2021 Guilhem Moulin
#
# 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 .
#----------------------------------------------------------------------
use v5.14.2;
use strict;
use warnings;
our $VERSION = '0.8.0';
my $PROTOCOL_VERSION = 1;
my $NAME = 'lacme-accountd';
use Digest::SHA 'sha256';
use Errno 'EINTR';
use File::Basename 'dirname';
use Getopt::Long qw/:config posix_default no_ignore_case gnu_getopt auto_version/;
use MIME::Base64 qw/decode_base64url encode_base64url/;
use Socket qw/PF_UNIX SOCK_STREAM SHUT_RDWR/;
use Config::Tiny ();
use JSON ();
# Clean up PATH
$ENV{PATH} = join ':', qw{/usr/bin /bin};
delete @ENV{qw/IFS CDPATH ENV BASH_ENV/};
my ($SOCKNAME, $S, %OPTS);
$SIG{$_} = sub() { exit } foreach qw/INT TERM/; # run the END block upon SIGINT/SIGTERM
#############################################################################
# Parse and validate configuration
#
sub usage(;$$) {
my $rv = shift // 0;
if ($rv) {
my $msg = shift;
print STDERR $msg."\n" if defined $msg;
print STDERR "Try '$NAME --help' or consult the manpage for more information.\n";
}
else {
print STDERR "Usage: $NAME [--config=FILE] [--privkey=ARG] [--socket=PATH] [--quiet]\n"
."Consult the manpage for more information.\n";
}
exit $rv;
}
usage(1) unless GetOptions(\%OPTS, qw/config=s privkey=s socket=s stdio quiet|q debug help|h/);
usage(0) if $OPTS{help};
my $LOG;
sub logmsg($@) {
my $lvl = shift // "all";
if (defined $LOG) {
my $now = localtime;
$LOG->printflush("[", $now, "] ", @_, "\n") or warn "print: $!";
}
unless (($lvl eq "debug" and !$OPTS{debug}) or ($lvl eq "noquiet" and $OPTS{quiet})) {
print STDERR @_, "\n" or warn "print: $!";
}
}
sub info(@) { logmsg(all => @_); }
sub error(@) {
my @msg = ("Error: ", @_);
info(@msg);
exit 255;
}
sub panic(@) {
my @loc = caller;
my @msg = (@_, " at line $loc[2] in $loc[1]");
info(@msg);
exit 255;
}
sub env_fallback($$) {
my $v = $ENV{ shift() };
return (defined $v and $v ne "") ? $v : shift;
}
sub spec_expand($) {
my $str = shift;
$str =~ s#%(.)# my $x =
$1 eq "C" ? ($< == 0 ? "@@localstatedir@@/cache" : env_fallback(XDG_CACHE_HOME => "$ENV{HOME}/.cache"))
: $1 eq "E" ? ($< == 0 ? "@@sysconfdir@@" : env_fallback(XDG_CONFIG_HOME => "$ENV{HOME}/.config"))
: $1 eq "g" ? (getgrgid((split /\s/,$()[0]))[0]
: $1 eq "G" ? $( =~ s/\s.*//r
: $1 eq "h" ? (getpwuid($<))[7]
: $1 eq "u" ? (getpwuid($<))[0]
: $1 eq "U" ? $<
: $1 eq "t" ? ($< == 0 ? "@@runstatedir@@" : $ENV{XDG_RUNTIME_DIR})
: $1 eq "T" ? env_fallback(TMPDIR => "/tmp")
: $1 eq "%" ? "%"
: error("\"$str\" has unknown specifier %$1");
error("Undefined expansion %$1 in \"$str\"") unless defined $x;
$x;
#ge;
return $str;
}
do {
my $conffile = spec_expand($OPTS{config} // "%E/lacme/$NAME.conf");
if (defined $OPTS{config} or -e $conffile) {
print STDERR "Using configuration file: $conffile\n" if $OPTS{debug};
my $h = Config::Tiny::->read($conffile) or error(Config::Tiny::->errstr());
my $h2 = delete $h->{_} // {};
if ((my $logfile = $h2->{logfile} // "") ne "") {
$logfile = spec_expand($logfile);
die "Invalid log file name\n" unless $logfile =~ /\A(\p{Print}+)\z/; # untaint
open $LOG, ">>", $1 or die "Can't open $1: $!"; # open ASAP (before config validation)
}
error("Invalid section(s): ".join(', ', keys %$h)) if %$h;
my %h = map { $_ => delete $h2->{$_} } qw/privkey gpg socket logfile keyid quiet/;
error("Unknown option(s): ".join(', ', keys %$h2)) if %$h2;
$h{quiet} = lc $h{quiet} eq 'yes' ? 1 : 0 if defined $h{quiet};
$OPTS{$_} //= $h{$_} foreach grep {defined $h{$_}} keys %h;
} else {
print STDERR "Ignoring missing configuration file at default location $conffile\n" if $OPTS{debug};
}
$OPTS{quiet} = 0 if $OPTS{debug};
error("'privkey' is not specified") unless defined $OPTS{privkey};
};
#############################################################################
# Build the JSON Web Key (RFC 7517) from the account key's public parameters,
# and determine the signing method $SIGN.
#
my ($EXTRA_GREETING_STR, $JWK_STR, $SIGN);
if ($OPTS{privkey} =~ /\A(file|gpg):(\p{Print}+)\z/) {
my ($method, $filename) = ($1, spec_expand($2));
my ($fh, @command);
if ($method eq 'file') {
# generate with `openssl genpkey -algorithm RSA`
open $fh, '<', $filename or error("Can't open $filename: $!");
}
elsif ($method eq 'gpg') {
@command = split /\s+/, ($OPTS{gpg} // 'gpg --quiet');
open $fh, '-|', @command, qw/-o - --decrypt --/, $filename or panic("fork: $!");
}
else {
panic(); # impossible
}
my $str = do {local $/ = undef; <$fh>};
close $fh or ($! or !@command) ?
panic("close: $!") :
error("$command[0] exited with value ".($? >> 8));
require 'Crypt/OpenSSL/RSA.pm';
my $rsa = Crypt::OpenSSL::RSA->new_private_key($str);
undef $str;
error("$filename: Not a private key") unless $rsa->is_private();
error("$filename: Invalid key") unless $rsa->check_key();
$rsa->use_sha256_hash();
require 'Crypt/OpenSSL/Bignum.pm';
my ($n, $e) = $rsa->get_key_parameters(); # don't include private params!
$_ = encode_base64url($_->to_bin()) foreach ($n, $e);
my %extra_greeting;
my %jwk = ( kty => 'RSA', n => $n, e => $e );
$extra_greeting{alg} = 'RS256'; # SHA256withRSA (RFC 7518 sec. A.1)
$SIGN = sub($) { $rsa->sign($_[0]) };
# use of SHA-256 digest in the thumbprint is hardcoded, see RFC 8555 sec. 8.1
$JWK_STR = JSON::->new->utf8->canonical->encode(\%jwk);
$extra_greeting{"jwk-thumbprint"} = encode_base64url(sha256($JWK_STR));
if ((my $kid = $OPTS{keyid} // "") ne "") {
$extra_greeting{kid} = $kid;
$JWK_STR = "{}";
}
$EXTRA_GREETING_STR = JSON::->new->encode(\%extra_greeting);
}
else {
error("Unsupported method: $OPTS{privkey}");
}
#############################################################################
# Create the server UNIX socket and bind(2) against it.
# NOTE: We don't use the abstract namespace so we can rely on the file
# permissions to keep other users out. (Also, OpenSSH 7.1 doesn't seem
# to support the abstract namespace.) The downside is that we have to
# delete the file manually.
#
unless (defined $OPTS{stdio}) {
my $sockname = spec_expand($OPTS{socket} // '%t/S.lacme');
$sockname = $sockname =~ /\A(\p{Print}+)\z/ ? $1 : error("Invalid socket name"); # untaint
# ensure we're the only user with write access to the parent dir
my $dirname = dirname($sockname);
my @stat = stat($dirname) or error("stat($dirname): $!");
error("Insecure permissions on $dirname") if ($stat[2] & 0022) != 0;
my $umask = umask(0177) // panic("umask: $!");
logmsg(noquiet => "Starting lacme Account Key Manager at $sockname");
socket(my $sock, PF_UNIX, SOCK_STREAM, 0) or panic("socket: $!");
my $sockaddr = Socket::sockaddr_un($sockname) // panic();
bind($sock, $sockaddr) or panic("bind: $!");
($SOCKNAME, $S) = ($sockname, $sock);
listen($S, 1) or panic("listen: $!");
umask($umask) // panic("umask: $!");
};
#############################################################################
# For each new connection, send the protocol version and the account key's
# public parameters, then sign whatever comes in
#
sub conn($$$) {
my ($in, $out, $id) = @_;
$out->printflush( "$PROTOCOL_VERSION OK ", $EXTRA_GREETING_STR, "\r\n",
$JWK_STR, "\r\n" ) or warn "print: $!";
# sign whatever comes in
while (defined (my $data = $in->getline())) {
$data =~ s/\r\n\z// or panic();
my ($header, $payload) = split(/\./, $data, 2);
unless (defined $header and $header =~ /\A[A-Za-z0-9\-_]+\z/) {
info("[$id] >>> Error: Refusing to sign request: Malformed protected header");
last;
}
unless (defined $payload and $payload =~ /\A[A-Za-z0-9\-_]*\z/) {
# POST-as-GET yields an empty payload
info("[$id] >>> Error: Refusing to sign request: Malformed payload");
last;
}
logmsg(noquiet => "[$id] >>> OK signing request: ",
"header=base64url(", decode_base64url($header), "); ",
"playload=base64url(", decode_base64url($payload), ")");
my $sig = $SIGN->($data);
$out->printflush( encode_base64url($sig), "\r\n" ) or warn "print: $!";
}
}
if (defined $OPTS{stdio}) {
conn(\*STDIN, \*STDOUT, $$);
} else {
$SIG{PIPE} = 'IGNORE'; # ignore broken pipes
for (my $count = 0;; $count++) {
accept(my $conn, $S) or do {
next if $! == EINTR; # try again if accept(2) was interrupted by a signal
panic("accept: $!");
};
logmsg(noquiet => "[$count] >>> Accepted new connection");
conn($conn, $conn, $count);
logmsg(noquiet => "[$count] >>> Connection terminated");
$conn->close() or warn "close: $!";
}
}
#############################################################################
#
END {
if (defined $SOCKNAME and -S $SOCKNAME) {
logmsg(debug => "Unlinking $SOCKNAME");
unlink $SOCKNAME or info("Error: unlink($SOCKNAME): $!");
}
if (defined $S) {
logmsg(noquiet => "Shutting down and closing lacme Account Key Manager");
shutdown($S, SHUT_RDWR) or info("Error: shutdown: $!");
close $S or info("Error: close: $!");
}
}
lacme-0.8.0/lacme-accountd.1.md 0000664 0000000 0000000 00000016320 14014612315 0016137 0 ustar 00root root 0000000 0000000 % lacme-accountd(1)
% [Guilhem Moulin](mailto:guilhem@fripost.org)
% March 2016
Name
====
lacme-accountd - [ACME] client written with process isolation and
minimal privileges in mind (account key manager)
Synopsis
========
`lacme-accountd` [`--config=FILENAME`] [`--privkey=ARG`] [`--socket=PATH`] [`--quiet`]
Description
===========
`lacme-accountd` is the account key manager component of [`lacme`(8)], a
small [ACME] client written with process isolation and minimal
privileges in mind. No other [`lacme`(8)] component needs access to the
account key; in fact the account key could as well be stored on another
host or a smartcard.
`lacme-accountd` binds to a UNIX-domain socket (specified with
`--socket=`), which [ACME] clients can connect to in order to request
data signatures.
As a consequence, `lacme-accountd` needs to be up and running before
using [`lacme`(8)] to issue [ACME] commands. Also, the process does not
automatically terminate after the last signature request: instead, one
sends an `INT` or `TERM` [`signal`(7)] to bring the server down.
Furthermore, one can use the UNIX-domain socket forwarding facility of
[OpenSSH] 6.7 and later to run `lacme-accountd` and [`lacme`(8)] on
different hosts. For instance one could store the account key on a
machine that is not exposed to the internet. See the
**[examples](#examples)** section below.
Options
=======
`--config=`*filename*
: Use *filename* as configuration file instead of
`%E/lacme/lacme-accountd.conf`. The value is subject to
[%-specifier expansion](#percent-specifiers). `lacme-accountd`
fails when `--config=` is used with a non-existent file, but a
non-existent default location is treated as if it were an empty
file.
See the **[configuration file](#configuration-file)** section below
for the configuration options.
`--privkey=`*value*
: Specify the (private) account key to use for signing requests.
Currently supported *value*s are:
* `file:`*FILE*, for a private key in PEM format (optionally
symmetrically encrypted)
* `gpg:`*FILE*, for a [`gpg`(1)]-encrypted private key
*FILE* is subject to [%-specifier expansion](#percent-specifiers).
The [`genpkey`(1ssl)] command can be used to generate a new private
(account) key:
$ install -vm0600 /dev/null /path/to/account.key
$ openssl genpkey -algorithm RSA -out /path/to/account.key
Currently `lacme-accountd` only supports RSA account keys.
`--socket=`*path*
: Use *path* as the UNIX-domain socket to bind to for signature
requests from the [ACME] client. The value is subject to
[%-specifier expansion](#percent-specifiers). `lacme-accountd`
aborts if *path* exists or if its parent directory is writable by
other users.
Default: `%t/S.lacme` (omitting `--socket=` therefore yields an
error when `lacme-accountd` doesn't run as and the `XDG_RUNTIME_DIR`
environment variable is unset or empty).
`--stdio`
: Read signature requests from the standard input and write signatures
to the standard output, instead of using a UNIX-domain socket for
communication with the [ACME] client.
This _internal_ flag should never be used by standalone
`lacme-accountd` instances, only for those [`lacme`(8)] spawns.
`-h`, `--help`
: Display a brief help and exit.
`-q`, `--quiet`
: Be quiet.
`--debug`
: Turn on debug mode.
Configuration file
==================
When given on the command line, the `--privkey=`, `--socket=` and
`--quiet` options take precedence over their counterpart (without
leading `--`) in the configuration file. Valid settings are:
*privkey*
: See `--privkey=`. This setting is required when `--privkey=` is not
specified on the command line.
*gpg*
: For a [`gpg`(1)]-encrypted private account key, specify the binary
[`gpg`(1)] to use, as well as some default options.
Default: `gpg --quiet`.
*socket*
: See `--socket=`.
*logfile*
: An optional file where to log to. The value is subject to
[%-specifier expansion](#percent-specifiers).
*keyid*
: The "Key ID", as shown by `` `acme account` ``, to give the [ACME]
client. With an empty *keyid* (the default) the client forwards the
JSON Web Key (JWK) to the [ACME] server to retrieve the correct
value. A non-empty value therefore saves a round-trip.
A non-empty value also causes `lacme-accountd` to send an empty JWK,
thereby revoking all account management access (status change,
contact address updates etc.) from the client: any `` `acme account` ``
command (or any command from [`lacme`(8)] before version 0.8.0) is
bound to be rejected by the [ACME] server. This provides a
safeguard against malicious clients.
*quiet*
: Be quiet. Possible values: `Yes`/`No`.
%-specifiers {#percent-specifiers}
============
The value the `--config=`, `--privkey=` and `--socket=` CLI options (and
also the *privkey*, *socket* and *logfile* settings from the
configuration file) are subject to %-expansion for the following
specifiers.
---- ------------------------------------------------------------------
`%C` `@@localstatedir@@/cache` for the root user, and `$XDG_CACHE_HOME`
for other users (or `$HOME/.cache` if the `XDG_CACHE_HOME`
environment variable is unset or empty).
`%E` `@@sysconfdir@@` for the root user, and `$XDG_CONFIG_HOME` for
other users (or `$HOME/.config` if the `XDG_CONFIG_HOME`
environment variable is unset or empty).
`%g` Current group name.
`%G` Current group ID.
`%h` Home directory of the current user.
`%t` `@@runstatedir@@` for the root user, and `$XDG_RUNTIME_DIR` for
other users. Non-root users may only use `%t` when the
`XDG_RUNTIME_DIR` environment variable is set to a non-empty
value.
`%T` `$TMPDIR`, or `/tmp` if the `TMPDIR` environment variable is unset
or empty.
`%u` Current user name.
`%U` Current user ID.
`%%` A literal `%`.
---- ------------------------------------------------------------------
Examples
========
Run `lacme-accountd` in a first terminal:
$ lacme-accountd --privkey=file:/path/to/account.key --socket=$XDG_RUNTIME_DIR/S.lacme
Then, while `lacme-accountd` is running, execute locally [`lacme`(8)] in
another terminal:
$ sudo lacme --socket=$XDG_RUNTIME_DIR/S.lacme newOrder
Alternatively, use [OpenSSH] 6.7 or later to forward the socket and
execute [`lacme`(8)] remotely:
$ ssh -oExitOnForwardFailure=yes -tt -R /path/to/remote.sock:$XDG_RUNTIME_DIR/S.lacme user@example.org \
sudo lacme --socket=/path/to/remote.sock newOrder
Consult the [`lacme`(8) manual][`lacme`(8)] for a solution involving
connecting to `lacme-accountd` on a dedicated remote host. Doing so
enables automatic renewal via [`crontab`(5)] or [`systemd.timer`(5)].
See also
========
[`lacme`(8)], [`ssh`(1)]
[ACME]: https://tools.ietf.org/html/rfc8555
[`lacme`(8)]: lacme.8.html
[`signal`(7)]: https://linux.die.net/man/7/signal
[`gpg`(1)]: https://www.gnupg.org/documentation/manpage.en.html
[OpenSSH]: https://www.openssh.com/
[`ssh`(1)]: https://man.openbsd.org/ssh
[`genpkey`(1ssl)]: https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html
[`crontab`(5)]: https://linux.die.net/man/5/crontab
[`systemd.timer`(5)]: https://www.freedesktop.org/software/systemd/man/systemd.timer.html
lacme-0.8.0/lacme.8.md 0000664 0000000 0000000 00000044570 14014612315 0014360 0 ustar 00root root 0000000 0000000 % lacme(8)
% [Guilhem Moulin](mailto:guilhem@fripost.org)
% December 2015
Name
====
lacme - [ACME] client written with process isolation and minimal
privileges in mind
Synopsis
========
`lacme` [`--config=FILENAME`] [`--socket=PATH`] [*OPTION* …] *COMMAND* [*ARGUMENT* …]
Description
===========
`lacme` is a small [ACME] client written with process isolation and
minimal privileges in mind. It is divided into four components, each
with its own executable:
1. A [`lacme-accountd`(1)] process to manage the account key and issue
SHA-256 signatures needed for each [ACME] command. (This process
binds to a UNIX-domain socket to reply to signature requests from
the [ACME] client.)
One can use the UNIX-domain socket forwarding facility of OpenSSH
6.7 and later to run [`lacme-accountd`(1)] and `lacme` on different
hosts. Alternatively, the [`lacme-accountd`(1)] process can be
spawned by the “master” `lacme` process below; in that case, the
two processes communicate through a socket pair.
2. A “master” `lacme` process, which runs as root and is the only
component with access to the private key material of the server
keys. It is used to fork the [ACME] client (and optionally the
[ACME] webserver) after dropping root privileges.
For certificate issuances (`newOrder` command), it also generates
Certificate Signing Requests, then verifies the validity of the
issued certificate, and optionally reloads or restarts services when
the *notify* setting is set.
3. An actual [ACME] client (specified with the *command* setting of the
[`[client]` section](#client-section) of the configuration file),
which builds [ACME] commands and dialogues with the remote [ACME]
server.
Since [ACME] commands need to be signed with the account key, the
“master” `lacme` process passes the [`lacme-accountd`(1)]
UNIX-domain socket to the [ACME] client: data signatures are
requested by writing the data to be signed to the socket.
4. For certificate issuances (`newOrder` command), an optional
webserver (specified with the *command* setting of the [`[webserver]`
section](#webserver-section) of the configuration file), which is
spawned by the “master” `lacme`. (The only challenge type currently
supported by `lacme` is `http-01`, which requires a webserver to
answer challenges.) That webserver only processes `GET` and `HEAD`
requests under the `/.well-known/acme-challenge/` URI.
Moreover temporary [`iptables`(8)] rules can be automatically
installed to open the HTTP port.
Commands
========
`lacme account` [`--tos-agreed`] [`--register`] [*CONTACT* …]
: Register (if `--registered` is set) a [`lacme-accountd`(1)]-managed
account key. A list of *CONTACT* information (such as `maito:`
URIs) can be specified in order for the [ACME] server to contact the
client for issues related to this registration (such as
notifications about server-initiated revocations). `--tos-agreed`
indicates agreement with the [ACME] server's Terms of Service (and
might be required for registration).
If the account key is already registered, update the contact info
with the given list of *CONTACT* information.
Upon success, `lacme` prints the new or updated Account Object from
the [ACME] server.
`lacme newOrder` [`--config-certs=`*FILE*] [`--min-days=`*INT*|`--force`] [*SECTION* …]
: Read the certificate configuration *FILE* (see the **[certificate
configuration file](#certificate-configuration-file)** section below
for the configuration options), and request new Certificate Issuance
for each of its sections (or the given list of *SECTION*s).
Command alias: `new-order`.
The flag `--force` is an alias for `--min-days=-1`, which forces
renewal regardless of the expiration date of existing certificates.
`lacme` `revokeCert` *FILE* [*FILE* …]
: Request that the given certificate(s) *FILE*(s) be revoked. For
this command, [`lacme-accountd`(1)] can be pointed to either the
account key or the certificate key.
Command alias: `revoke-cert`.
Generic settings
================
`--config=`*filename*
: Use *filename* as configuration file instead of
`%E/lacme/lacme.conf`. The value is subject to [%-specifier
expansion](#percent-specifiers).
See the **[configuration file](#configuration-file)** section below
for the configuration options.
`--socket=`*path*
: Use *path* as the [`lacme-accountd`(1)] UNIX-domain socket to
connect to for signature requests from the [ACME] client. The value
is subject to [%-specifier expansion](#percent-specifiers).
`lacme` aborts if *path* exists or if its parent directory is
writable by other users.
Default: `%t/S.lacme`.
This command-line option overrides the *socket* setting of the
[`[client]` section](#client-section) of the configuration file; it
also causes the [`[accountd]` section](#accountd-section) to be
ignored.
`-h`, `--help`
: Display a brief help and exit.
`-q`, `--quiet`
: Be quiet.
`--debug`
: Turn on debug mode.
Configuration file
==================
Valid settings are:
Default section
---------------
*config-certs*
: For certificate issuances (`newOrder` command), specify the
space-separated list of certificate configuration files or
directories to use (see the **[certificate configuration
file](#certificate-configuration-file)** section below for the
configuration options). Each item in that list is independently
subject to [%-specifier expansion](#percent-specifiers).
Paths not starting with `/` (after %-expansion) are relative to the
parent directory of the **[configuration filename](#configuration-file)**.
The list of files and directories is processed in the specified
order, with the later items taking precedence. Files in a directory
are processed in lexicographic order, only considering the ones with
suffix `.conf`.
Default: `lacme-certs.conf lacme-certs.conf.d/`.
`[client]` section
------------------
This section is used for configuring the [ACME] client (which takes care
of [ACME] commands and dialogues with the remote [ACME] server).
*socket*
: See `--socket=`.
*user*
: The username to drop privileges to (setting both effective and real
uid). Skip privilege drop if the value is empty (not recommended).
Default: `@@lacme_client_user@@`.
*group*
: The groupname to drop privileges to (setting both effective and real
gid, and also setting the list of supplementary gids to that single
group). Skip privilege drop if the value is empty (not
recommended).
Default: `@@lacme_client_group@@`.
*command*
: The [ACME] client command. It is split on whitespace, with the
first item being the command to execute, the second its first
argument etc. (Note that `lacme` might append more arguments when
executing the command internally.)
Default: `@@libexecdir@@/lacme/client`.
*server*
: Root URI of the [ACME] server.
Default: `@@acmeapi_server@@`.
*timeout*
: Timeout in seconds after which the client stops polling the [ACME]
server and considers the request failed.
Default: `30`.
*SSL_verify*
: Whether to verify the server certificate chain.
Default: `Yes`.
*SSL_version*
: Specify the version of the SSL protocol used to transmit data.
*SSL_cipher_list*
: Specify the cipher list for the connection, see [`ciphers`(1ssl)]
for more information.
`[webserver]` section
---------------------
This section is used to configure how [ACME] challenge responses are
served during certificate issuance.
*listen*
: Comma- or space-separated list of addresses to listen on. Valid
addresses are of the form `IPV4:PORT`, `[IPV6]:PORT` (where the
`:PORT` suffix is optional and defaults to the HTTP port 80), or an
absolute path of a UNIX-domain socket (created with mode `0666`).
Default: `@@runstatedir@@/lacme-www.socket`.
**Note**: The default value is only suitable when an external HTTP
daemon is publicly reachable and passes all ACME challenge requests
to the webserver component through the UNIX-domain socket
`@@runstatedir@@/lacme-www.socket` (for instance using the provided
`@@sysconfdir@@/lacme/apache2.conf` or `@@sysconfdir@@/lacme/nginx.conf` configuration
snippets for each virtual host requiring authorization). If there
is no HTTP daemon bound to port 80 one needs to set *listen* to
`[::]` (or `0.0.0.0 [::]` when dual IPv4/IPv6 stack is disabled or
unavailable), and possibly also set *iptables* to `Yes`.
*challenge-directory*
: Directory under which an external HTTP daemon is configured to serve `GET`
requests for challenge files under `/.well-known/acme-challenge/` (for
each virtual host requiring authorization) as static files.
The directory _must_ exist beforehand, _must_ be empty, and the
lacme client user (by default `@@lacme_client_user@@`) needs to be
able to create files under it.
This setting is required when *listen* is empty. Moreover its value
is subject to [%-specifier expansion](#percent-specifiers) _before_
privilege drop.
*user*
: The username to drop privileges to (setting both effective and real
uid). Skip privilege drop if the value is empty (not recommended).
Default: `@@lacme_www_user@@`.
*group*
: The groupname to drop privileges to (setting both effective and real
gid, and also setting the list of supplementary gids to that single
group). Skip privilege drop if the value is empty (not
recommended).
Default: `@@lacme_www_group@@`.
*command*
: The [ACME] webserver command. It is split on whitespace, with the
first item being the command to execute, the second its first
argument etc. (Note that `lacme` might append more arguments when
executing the command internally.)
A separate process is spawned for each address to *listen* on. (In
particular no webserver process is forked when the *listen* setting
is empty.)
Default: `@@libexecdir@@/lacme/webserver`.
*iptables*
: Whether to automatically install temporary [`iptables`(8)] rules to
open the `ADDRESS[:PORT]` specified with *listen*. The rules are
automatically removed once `lacme` exits.
This setting is ignored when *challenge-directory* is set.
Default: `No`.
`[accountd]` section
---------------------
This section is used for configuring the [`lacme-accountd`(1)] child
process. If the section (including its header) is absent or commented
out, or if the CLI option `--socket` is specified, then `lacme` connects
to an existing [`lacme-accountd`(1)] process via the specified
UNIX-domain socket.
*user*
: The username to drop privileges to (setting both effective and real
uid). Skip privilege drop if the value is empty (the default).
*group*
: The groupname to drop privileges to (setting both effective and real
gid, and also setting the list of supplementary gids to that single
group). Skip privilege drop if the value is empty (the default).
*command*
: The [`lacme-accountd`(1)] command. It is split on whitespace, with
the first item being the command to execute, the second its first
argument etc. (Note that `lacme` appends more arguments when
executing the command internally.)
Each item in that list is independently subject to [%-specifier
expansion](#percent-specifiers) _after_ privilege drop.
Default: `@@bindir@@/lacme-accountd`.
Use for instance `` `ssh -T lacme@account.example.net
lacme-accountd` `` in order to spawn a remote [`lacme-accountd`(1)]
server.
*config*
: Path to the [`lacme-accountd`(1)] configuration file. The value is
subject to [%-specifier expansion](#percent-specifiers) _after_
privilege drop.
*quiet*
: Be quiet. Possible values: `Yes`/`No`.
Certificate configuration file
==============================
For certificate issuances (`newOrder` command), a separate file is used
to configure paths to the certificate and key, as well as the subject,
subjectAltName, etc. to generate Certificate Signing Requests.
Each section denotes a separate certificate issuance.
Valid settings are:
*certificate*
: Where to store the issued certificate (in PEM format).
At least one of *certificate* or *certificate-chain* is required.
*certificate-chain*
: Where to store the issued certificate along with its chain of trust
(in PEM format).
At least one of *certificate* or *certificate-chain* is required.
*certificate-key*
: Path to the service's private key. This setting is required. The
[`genpkey`(1ssl)] command can be used to generate a new service RSA
key:
$ install -vm0600 /dev/null /path/to/service.rsa.key
$ openssl genpkey -algorithm RSA -out /path/to/service.rsa.key
Alternatively, for an ECDSA key using the NIST P-256 curve:
$ install -vm0600 /dev/null /path/to/service.ecdsa.key
$ openssl genpkey -algorithm EC -out /path/to/service.ecdsa.key \
-pkeyopt ec_paramgen_curve:P-256 \
-pkeyopt ec_param_enc:named_curve
`lacme` supports any key algorithm than the underlying libssl
(OpenSSL) version is able to manipulate, but the [ACME] server might
reject CSRs associated with private keys of deprecated and/or
“exotic” algorithms.
For a dual cert setup (for instance RSA+ECDSA), duplicate the
certificate section and use a distinct *certificate-key* resp.
*certificate* (or *certificate-chain*) value for each key algorithm.
*min-days*
: For an existing certificate, the minimum number of days before its
expiration date the section is considered for re-issuance.
A negative value forces reissuance, while the number `0` limits
reissuance to expired certificates.
Default: the value of the CLI option `--min-days`, or `21` if there
is no such option.
*subject*
: Subject field of the Certificate Signing Request, in the form
`/type0=value0/type1=value1/type2=…`. This setting is required.
*subjectAltName*
: Comma-separated list of Subject Alternative Names, in the form
`type0:value1,type1:value1,type2:…`
The only `type` currently supported is `DNS`, to specify an
alternative domain name.
*CAfile*
: Path to the bundle of trusted issuer certificates. This is used for
validating each certificate after issuance or renewal. Specifying
an empty value skips certificate validation.
Default: `@@datadir@@/lacme/ca-certificates.crt`.
*hash*
: Message digest to sign the Certificate Signing Request with,
overriding the [`req`(1ssl)] default.
*keyUsage*
: Comma-separated list of Key Usages, for instance `digitalSignature,
keyEncipherment`, to include in the Certificate Signing Request.
See [`x509v3_config`(5ssl)] for a list of possible values. Note
that the ACME server might override the value provided here.
*tlsfeature*
: Comma-separated list of [TLS extension][TLS Feature extension]
identifiers, such as `status_request` for OCSP Must-Staple.
See [`x509v3_config`(5ssl)] for a list of possible values. Note
that the ACME server might override the value provided here.
*chown*
: An optional `username[:groupname]` to chown the issued *certificate*
and *certificate-chain* to.
*chmod*
: An optional octal mode to chmod the issued *certificate* and
*certificate-chain* to.
*notify*
: Command to pass the the system's command shell (`` `/bin/sh -c` ``)
after successful installation of the *certificate* and/or
*certificate-chain*.
%-specifiers {#percent-specifiers}
============
Some CLI options and configuration settings are subject to %-expansion
for the following specifiers. Check the documentation of each setting
to see which ones are affected.
---- ------------------------------------------------------------------
`%C` `@@localstatedir@@/cache` for the root user, and `$XDG_CACHE_HOME`
for other users (or `$HOME/.cache` if the `XDG_CACHE_HOME`
environment variable is unset or empty).
`%E` `@@sysconfdir@@` for the root user, and `$XDG_CONFIG_HOME` for
other users (or `$HOME/.config` if the `XDG_CONFIG_HOME`
environment variable is unset or empty).
`%g` Current group name.
`%G` Current group ID.
`%h` Home directory of the current user.
`%t` `@@runstatedir@@` for the root user, and `$XDG_RUNTIME_DIR` for
other users. Non-root users may only use `%t` when the
`XDG_RUNTIME_DIR` environment variable is set to a non-empty
value.
`%T` `$TMPDIR`, or `/tmp` if the `TMPDIR` environment variable is unset
or empty.
`%u` Current user name.
`%U` Current user ID.
`%%` A literal `%`.
---- ------------------------------------------------------------------
Examples
========
$ sudo lacme account --register --tos-agreed mailto:noreply@example.com
$ sudo lacme newOrder
$ sudo lacme revokeCert /path/to/service.crt
Automatic renewal can be scheduled via [`crontab`(5)] or
[`systemd.timer`(5)]. In order to avoid deploying a single account key
onto multiple nodes and/or dealing with multiple account keys, one can
install a single [`lacme-accountd`(1)] instance on a dedicated host,
generate a single account key there (and keep it well), and set the
following in the [`[accountd]` section](#accountd-section):
command = ssh -T lacme@account.example.net lacme-accountd
If the user running `lacme` can connect to `lacme@account.example.net`
using (passwordless) key authentication, this setting will spawn a
remote [`lacme-accountd`(1)] and use it to sign [ACME] requests.
Further hardening can be achieved by means of [`authorized_keys`(5)]
restrictions:
restrict,from="…",command="/usr/bin/lacme-accountd --quiet --stdio" ssh-rsa …
See also
========
[`lacme-accountd`(1)]
[ACME]: https://tools.ietf.org/html/rfc8555
[TLS Feature extension]: https://tools.ietf.org/html/rfc7633
[`lacme-accountd`(1)]: lacme-accountd.1.html
[`iptables`(8)]: https://linux.die.net/man/8/iptables
[`ciphers`(1ssl)]: https://www.openssl.org/docs/manmaster/man1/openssl-ciphers.html
[`x509v3_config`(5ssl)]: https://www.openssl.org/docs/manmaster/man5/x509v3_config.html
[`genpkey`(1ssl)]: https://www.openssl.org/docs/manmaster/man1/openssl-genpkey.html
[`req`(1ssl)]: https://www.openssl.org/docs/manmaster/man1/openssl-req.html
[`crontab`(5)]: https://linux.die.net/man/5/crontab
[`systemd.timer`(5)]: https://www.freedesktop.org/software/systemd/man/systemd.timer.html
[`authorized_keys`(5)]: https://man.openbsd.org/sshd.8#AUTHORIZED_KEYS_FILE_FORMAT
lacme-0.8.0/pandoc2man.jq 0000775 0000000 0000000 00000001050 14014612315 0015152 0 ustar 00root root 0000000 0000000 #!/usr/bin/jq -f
def fixheaders:
if .t == "Header" then
.c[2][] |= (if .t == "Str" then .c |= ascii_upcase else . end)
else
.
end;
def fixlinks:
if type == "object" then
if .t == "Link" then
if .c[2][0][0:7] == "mailto:" then . else .c[1][] end
else
map_values(fixlinks)
end
else if type == "array" then
map(fixlinks)
else
.
end
end;
{
"pandoc-api-version"
, meta
, blocks: .blocks | map(fixheaders | fixlinks)
}
lacme-0.8.0/snippets/ 0000775 0000000 0000000 00000000000 14014612315 0014442 5 ustar 00root root 0000000 0000000 lacme-0.8.0/snippets/apache2-static.conf 0000664 0000000 0000000 00000001104 14014612315 0020075 0 ustar 00root root 0000000 0000000 # Use Apache2 to serve ACME requests directly.
# This snippet requires setting challenge-directory = /var/www/acme-challenge
# in /etc/lacme/lacme.config, and creating this file with write
# permissions for the lacme client user.
#
# This file needs to be sourced to the server directives (at least the
# non-ssl one) of each virtual host requiring authorization.
Alias /.well-known/acme-challenge/ /var/www/acme-challenge/
Options none
AllowOverride none
Require all granted
lacme-0.8.0/snippets/apache2.conf 0000664 0000000 0000000 00000000745 14014612315 0016622 0 ustar 00root root 0000000 0000000 # Use Apache2 to proxy ACME requests to a locally-bound lacme webserver.
#
# This file needs to be sourced to the server directives (at least the
# non-ssl one) of each virtual host requiring authorization.
# Alternatively, run `a2enconf lacme` and reload apache2.
ProxyPass unix://@@runstatedir@@/lacme-www.socket|http://localhost/.well-known/acme-challenge/
Require all granted
lacme-0.8.0/snippets/nginx-static.conf 0000664 0000000 0000000 00000001044 14014612315 0017720 0 ustar 00root root 0000000 0000000 # Use Nginx to serve ACME requests directly.
# This snippet requires setting challenge-directory = /var/www/acme-challenge
# in /etc/lacme/lacme.config, and creating this file with write
# permissions for the lacme client user.
#
# One of the nginx*.conf file needs to be sourced to the server
# directives (at least the non-ssl one) of each virtual host requiring
# authorization.
location ^~ /.well-known/acme-challenge/ {
alias /var/www/acme-challenge/;
default_type application/jose+json;
disable_symlinks on;
autoindex off;
}
lacme-0.8.0/snippets/nginx.conf 0000664 0000000 0000000 00000000514 14014612315 0016434 0 ustar 00root root 0000000 0000000 # Use Nginx to proxy ACME requests to a locally-bound lacme webserver.
#
# One of the nginx*.conf file needs to be sourced to the server
# directives (at least the non-ssl one) of each virtual host requiring
# authorization.
location ^~ /.well-known/acme-challenge/ {
proxy_pass http://unix:@@runstatedir@@/lacme-www.socket;
}
lacme-0.8.0/test 0000775 0000000 0000000 00000021247 14014612315 0013510 0 ustar 00root root 0000000 0000000 #!/bin/bash
#----------------------------------------------------------------------
# ACME client written with process isolation and minimal privileges in mind
# (test suite)
# Copyright © 2015-2021 Guilhem Moulin
#
# 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 .
#----------------------------------------------------------------------
set -ue
PATH="/usr/bin:/bin"
export PATH
usage() {
local rv="${1-0}"
echo "Usage: $0 [--deb|--dev] [TEST..]" >&2
exit $rv
}
# Setup: for any subdomain under $DOMAINNAME,
# http://$subdomain.$DOMAINNAME/.well-known/acme-challenge/$challenge
# must be routed to this machine.
# This can be done with a wildcard DNS record and opening tcp/80 in firewall.
DOMAINNAME="lacme-test.guilhem.org"
MODE="dev"
DISTRIBUTION="sid"
BUILDDIR="build/test"
while [ $# -gt 0 ]; do
case "$1" in
--deb) MODE="deb"; shift;;
--dev) MODE="dev"; shift;;
--help|-h) usage 0;;
-*) echo "Error: Unknown option $1" >&2; usage 1;;
--) shift; break;;
*) break;
esac
done
cd "$(dirname -- "$0")"
declare -a TESTS=()
if [ $# -eq 0 ]; then
# always start with registration, the account key might be new
TESTS+=( "register" )
for t in tests/*; do
if [ "$t" != "tests/register" ] && [ "${t#tests/account-encrypted-}" = "$t" ] && [ -f "$t" ]; then
# skip registration and non-interactive tests
TESTS+=( "${t#tests/}" )
fi
done
else
for t in "$@"; do
if [ -f "tests/$t" ]; then
TESTS+=( "$t" )
else
echo "Error: '$1': no such test" >&2
exit 1
fi
done
fi
if [ "$MODE" = "deb" ]; then
DISTRIBUTION="$(dpkg-parsechangelog -S Distribution)"
[ "$DISTRIBUTION" != "UNRELEASED" ] || DISTRIBUTION="sid"
PKG_DESTDIR="${XDG_CACHE_HOME:-"$HOME/.cache"}/build-area"
fi
ACCOUNT_KEY="$BUILDDIR/account.key"
mkdir -pv -- "$BUILDDIR"
if [ ! -f "$ACCOUNT_KEY" ]; then
# keep the account key (up to `make clean`) to avoid hitting
# rate-liming -- currently 50 registrations per 3h per IP, see
# https://letsencrypt.org/docs/staging-environment/
echo "Generating account key $ACCOUNT_KEY..." >&2
openssl genpkey -algorithm RSA -out "$ACCOUNT_KEY"
fi
ARCH="$(dpkg-architecture -qDEB_BUILD_ARCH)"
CHROOT=""
cleanup() {
if [ -n "$CHROOT" ]; then
schroot -c "$CHROOT" -e
fi
}
trap cleanup EXIT INT TERM
run() {
local t="tests/$1" rootdir version sub
if [ ! -f "$t" ]; then
echo "Error: '$1': no such test" >&2
exit 1
fi
# Don't need to rebuild for each test, but editing the code at the
# same time might cause `make install` to rebuild a wrong version
make all -- \
BUILDDIR="$BUILDDIR" \
DESTDIR="" \
exec_prefix="/usr" \
datadir="/usr/share" \
runstatedir="/run" \
lacme_www_user=_lacme-www \
lacme_www_group=nogroup \
lacme_client_user=_lacme-client \
lacme_client_group=nogroup \
acmeapi_server="https://acme-staging-v02.api.letsencrypt.org/directory"
CHROOT="$(schroot -c "$DISTRIBUTION-$ARCH-sbuild" -b)"
rootdir="/run/schroot/mount/$CHROOT"
if [ "$MODE" = "deb" ]; then
version="$(dpkg-parsechangelog -S Version)"
echo "Installing lacme $version into $CHROOT..." >&2
install -vt "$rootdir/dev/shm" -m0644 -- \
"$PKG_DESTDIR/lacme_${version}_all.deb" \
"$PKG_DESTDIR/lacme-accountd_${version}_all.deb"
sudo schroot -d"/" -c "$CHROOT" -r -- \
env DEBIAN_FRONTEND="noninteractive" apt install -y \
"/dev/shm/lacme_${version}_all.deb" \
"/dev/shm/lacme-accountd_${version}_all.deb"
elif [ "$MODE" = "dev" ]; then
echo "Installing lacme dev into $CHROOT..." >&2
sudo make install -- \
BUILDDIR="$BUILDDIR" \
DESTDIR="$rootdir" \
exec_prefix="$rootdir/usr" \
datadir="$rootdir/usr/share" \
runstatedir="$rootdir/run"
sudo schroot -d"/" -c "$CHROOT" -r -- \
env DEBIAN_FRONTEND="noninteractive" apt install -y \
adduser \
libconfig-tiny-perl \
libcrypt-openssl-rsa-perl \
libjson-perl \
libnet-ssleay-perl \
libtimedate-perl \
libwww-perl \
openssl
sudo schroot -d"/" -c "$CHROOT" -r -- \
adduser --force-badname --system \
--home /nonexistent --no-create-home \
--gecos "lacme www user" \
--quiet _lacme-www
sudo schroot -d"/" -c "$CHROOT" -r -- \
adduser --force-badname --system \
--home /nonexistent --no-create-home \
--gecos "lacme client user" \
--quiet _lacme-client
fi
# set up staging environment, see https://letsencrypt.org/docs/staging-environment/
sudo install -oroot -groot -m0644 -vt "$rootdir/usr/share/lacme" certs-staging/*.pem
sudo install -oroot -groot -m0644 -vT "$BUILDDIR/certs-staging/ca-certificates.crt" \
"$rootdir/usr/share/lacme/ca-certificates.crt"
sudo schroot -d"/" -c "$CHROOT" -r -- \
sed -ri '0,/^#?server\s*=.*/ {s||server = https://acme-staging-v02.api.letsencrypt.org/directory|}' \
/etc/lacme/lacme.conf
# install account key and configure lacme accordingly
sudo install -oroot -groot -m0600 -vT -- "$BUILDDIR/account.key" \
"$rootdir/etc/lacme/account.key"
sudo schroot -d"/" -c "$CHROOT" -r -- \
sed -ri '0,\|^#?privkey\s*=.*| {s||privkey = file:/etc/lacme/account.key|}' \
/etc/lacme/lacme-accountd.conf
# use lacme's internal webserver bound to INADDR_ANY port 80
sudo schroot -d"/" -c "$CHROOT" -r -- \
sed -ri 's|^#?listen\s*=.*|listen = 0.0.0.0|' /etc/lacme/lacme.conf
# use a sample lacme-certs.conf, with a random subdomain so we can
# verify that challenges are answered correctly
sub="$(head -c10 /dev/urandom | base32 -w0)"
sudo tee "$rootdir/etc/lacme/lacme-certs.conf.d/simpletest-rsa.conf" >/dev/null <<- EOF
[simpletest-rsa]
certificate-key = /etc/lacme/simpletest.rsa.key
certificate-chain = /etc/lacme/simpletest.rsa.crt
subject = /CN=${sub,,[A-Z]}.$DOMAINNAME
EOF
sudo schroot -d"/" -c "$CHROOT" -r -- \
openssl genpkey -algorithm RSA -out /etc/lacme/simpletest.rsa.key
# copy test wrapper and unit file
local testdir="/dev/shm/lacme.test"
sudo install -oroot -groot -m0700 -d -- "$rootdir$testdir"
sudo install -oroot -groot -m0755 -T -- /dev/stdin "$rootdir$testdir/run" <<-EOF
STDERR="$testdir/stderr"
touch "\$STDERR"
fail() {
set +x
local rv=\$? i
if [ \$rv -eq 0 ]; then rv=1; fi
if [ -s "\$STDERR" ]; then
echo "vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv"
cat <"\$STDERR" >&2
echo "^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"
fi
[ \$# -eq 0 ] || echo "Error: \$*" >&2
exit \$rv
}
grepstderr() {
grep "\$@" <"\$STDERR" || fail
}
ngrepstderr() {
! grep "\$@" <"\$STDERR" || fail
}
set -x
EOF
sudo tee -a "$rootdir$testdir/run" >/dev/null <"$t"
sudo schroot -d"/" -c "$CHROOT" -r -- env -i \
USER="root" \
HOME="/root" \
SHELL="/bin/sh" \
LOGNAME="root" \
TERM="$TERM" \
PATH="/usr/sbin:/usr/bin:/sbin:/bin" \
DOMAINNAME="$DOMAINNAME" \
sh -ue "$testdir/run" || return $?
}
RV=0
declare -a PASSED=() FAILED=()
for t in "${TESTS[@]}"; do
run "$t" && rv=0 || rv=$?
if [ -n "$CHROOT" ]; then
# clean up
schroot -c "$CHROOT" -e
CHROOT=""
fi
if [ $rv -eq 0 ]; then
PASSED+=( "$t" )
else
FAILED+=( "$t" )
RV=$rv
break # stop at the first failure
fi
done
echo >&2
echo "================================================================================" >&2
echo "PASSED: ${PASSED[*]:-"(none)"}" >&2
if [ ${#FAILED[@]} -gt 0 ]; then
echo "FAILED: ${FAILED[*]}" >&2
fi
exit $RV
lacme-0.8.0/tests/ 0000775 0000000 0000000 00000000000 14014612315 0013737 5 ustar 00root root 0000000 0000000 lacme-0.8.0/tests/account-encrypted-gpg 0000664 0000000 0000000 00000001071 14014612315 0020063 0 ustar 00root root 0000000 0000000 # GnuPG-encrypted account key (WARN: this test is not interactive)
PASSPHRASE="test"
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends gpg gpg-agent
gpg --batch --passphrase "$PASSPHRASE" --quick-generate-key "nobody "
keyid="$(gpg --list-secret-key --with-colons | grep -m1 ^fpr: | cut -sd: -f10)"
gpg --encrypt -r "$keyid" /etc/lacme/account.key
sed -ri '0,\|^#?privkey\s*=.*| {s||privkey = gpg:/etc/lacme/account.key.gpg|}' /etc/lacme/lacme-accountd.conf
export GPG_TTY="$(tty)"
lacme account
# vim: set filetype=sh :
lacme-0.8.0/tests/account-encrypted-openssl 0000664 0000000 0000000 00000000525 14014612315 0020774 0 ustar 00root root 0000000 0000000 # OpenSSL-encrypted account key (WARN: this test is not interactive)
PASSPHRASE="test"
openssl rsa -aes128 -passout pass:"$PASSPHRASE" /etc/lacme/account.enc.key
sed -ri '0,\|^#?privkey\s*=.*| {s||privkey = file:/etc/lacme/account.enc.key|}' /etc/lacme/lacme-accountd.conf
lacme account
# vim: set filetype=sh :
lacme-0.8.0/tests/accountd 0000664 0000000 0000000 00000007322 14014612315 0015466 0 ustar 00root root 0000000 0000000 # Use a separate accountd server process
adduser --disabled-password \
--home /home/lacme-account \
--gecos "lacme account user" \
--quiet lacme-account
# non-existent parent directory
! lacme --socket="/nonexistent/S.lacme" account 2>"$STDERR" || fail
grepstderr -Fxq "Error: stat(/nonexistent): No such file or directory"
# word-writable parent directory
! lacme --socket="/tmp/S.lacme" account 2>"$STDERR" || fail
grepstderr -Fxq "Error: Insecure permissions on /tmp"
# missing socket
SOCKET=~lacme-account/S.lacme
! lacme --socket="$SOCKET" account 2>"$STDERR" || fail
grepstderr -Fxq "Can't stat $SOCKET: No such file or directory (Is lacme-accountd running?)"
#######################################################################
# missing configuration at default location
! runuser -u lacme-account -- lacme-accountd --debug 2>"$STDERR" || fail
grepstderr -Fxq "Ignoring missing configuration file at default location /home/lacme-account/.config/lacme/lacme-accountd.conf"
grepstderr -Fxq "Error: 'privkey' is not specified"
install -olacme-account -glacme-account -Ddm0700 -- \
~lacme-account/.config/lacme ~lacme-account/.local/share/lacme
mv -t ~lacme-account/.config/lacme /etc/lacme/account.key
chown lacme-account: ~lacme-account/.config/lacme/account.key
cat >~lacme-account/.config/lacme/lacme-accountd.conf <<-EOF
privkey = file:%E/lacme/account.key
logfile = %h/.local/share/lacme/accountd.log
EOF
# non-existent parent directory
! runuser -u lacme-account -- lacme-accountd --socket="/nonexistent/S.lacme" 2>"$STDERR" || fail
grepstderr -Fxq "Error: stat(/nonexistent): No such file or directory"
# word-writable parent directory
! runuser -u lacme-account -- lacme-accountd --socket="%T/S.lacme" account 2>"$STDERR" || fail
grepstderr -Fxq "Error: Insecure permissions on /tmp"
# unset XDG_RUNTIME_DIR
! runuser -u lacme-account -- lacme-accountd 2>"$STDERR" || fail
grepstderr "Error: Undefined expansion %t in \"%t/S.lacme\""
# non-existent $XDG_RUNTIME_DIR
! runuser -u lacme-account -- env XDG_RUNTIME_DIR="/nonexistent" lacme-accountd 2>"$STDERR" || fail
grepstderr -Fxq "Error: stat(/nonexistent): No such file or directory"
# test running accountd
runuser -u lacme-account -- env XDG_RUNTIME_DIR=/home/lacme-account lacme-accountd --debug 2>"$STDERR" & PID=$!
sleep 1
kill $PID || fail
wait || fail
grepstderr -Fxq "Using configuration file: /home/lacme-account/.config/lacme/lacme-accountd.conf"
grepstderr -Fxq "Starting lacme Account Key Manager at /home/lacme-account/S.lacme"
# make sure errors are logged too
grep -F "Error: " ~lacme-account/.local/share/lacme/accountd.log
# rotate the log and start accountd
rm -f ~lacme-account/.local/share/lacme/accountd.log
runuser -u lacme-account -- lacme-accountd --socket="$SOCKET" --quiet & PID=$!
# run lacme(8) multiple times using that single lacme-accountd(1) instance
lacme --socket="$SOCKET" --debug account 2>"$STDERR" || fail
grepstderr -F "Received extra greeting data from accountd:"
lacme --socket="$SOCKET" newOrder 2>"$STDERR" || fail
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
# terminate accountd and check that it removes the socket
kill $PID
wait
! test -e "$SOCKET"
# ensure signature requests are logged
grep -Fq "Starting lacme Account Key Manager at /home/lacme-account/S.lacme" ~lacme-account/.local/share/lacme/accountd.log
grep -Fq "[0] >>> Accepted new connection" ~lacme-account/.local/share/lacme/accountd.log
grep -Fq "[1] >>> Accepted new connection" ~lacme-account/.local/share/lacme/accountd.log
grep -Fq "Shutting down and closing lacme Account Key Manager" ~lacme-account/.local/share/lacme/accountd.log
grep -F ">>> OK signing request:" ~lacme-account/.local/share/lacme/accountd.log
# vim: set filetype=sh :
lacme-0.8.0/tests/accountd-kid 0000664 0000000 0000000 00000004523 14014612315 0016233 0 ustar 00root root 0000000 0000000 # Hide JWK from ACME client and pass KID instead
# get the key ID
lacme account 2>"$STDERR" || fail
keyid="$(sed -n "/^Key ID: / {s///p;q}" <"$STDERR")"
# prepare accountd
adduser --disabled-password \
--home /home/lacme-account \
--gecos "lacme account user" \
--quiet lacme-account
install -olacme-account -glacme-account -Ddm0700 -- \
~lacme-account/.config/lacme ~lacme-account/.local/share/lacme
mv -t ~lacme-account/.config/lacme /etc/lacme/account.key
chown lacme-account: ~lacme-account/.config/lacme/account.key
cat >~lacme-account/.config/lacme/lacme-accountd.conf <<-EOF
privkey = file:%E/lacme/account.key
logfile = %h/.local/share/lacme/accountd.log
keyid = $keyid
EOF
SOCKET=~lacme-account/S.lacme
runuser -u lacme-account -- lacme-accountd --socket="$SOCKET" --quiet & PID=$!
# newAccount resource fails as per RFC 8555 sec. 6.2 it requires a JWK
! lacme --socket="$SOCKET" account 2>"$STDERR" || fail
grepstderr -Fxq "WARNING: lacme-accountd supplied an empty JWK; try removing 'keyid' setting from lacme-accountd.conf if the ACME resource request fails."
grepstderr -Fxq "400 Bad Request (Parse error reading JWS)"
! grep -F ">>> OK signing request: header=" ~lacme-account/.local/share/lacme/accountd.log | \
grep -vF ">>> OK signing request: header=base64url({\"alg\":\"RS256\",\"jwk\":{}," || exit 1
# rotate log and restart accountd
kill $PID
wait
rm ~lacme-account/.local/share/lacme/accountd.log
runuser -u lacme-account -- lacme-accountd --socket="$SOCKET" --quiet & PID=$!
# newOrder works fine without JWK
lacme --socket="$SOCKET" newOrder
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
# and so does revokeCert (for requests authenticated with the account key)
lacme --socket="$SOCKET" revokeCert /etc/lacme/simpletest.rsa.crt
! lacme --socket="$SOCKET" revokeCert /etc/lacme/simpletest.rsa.crt 2>"$STDERR" || fail
grepstderr -Fxq "Revoking /etc/lacme/simpletest.rsa.crt"
grepstderr -Fxq "400 Bad Request (Certificate already revoked)"
grepstderr -Fxq "Warning: Couldn't revoke /etc/lacme/simpletest.rsa.crt"
kill $PID
wait
# make sure all signing requests have a KID
! grep -F ">>> OK signing request: header=" ~lacme-account/.local/share/lacme/accountd.log | \
grep -vF ">>> OK signing request: header=base64url({\"alg\":\"RS256\",\"kid\":\"$keyid\"," || exit 1
# vim: set filetype=sh :
lacme-0.8.0/tests/accountd-remote 0000664 0000000 0000000 00000004305 14014612315 0016755 0 ustar 00root root 0000000 0000000 # Remote accountd server process
adduser --disabled-password --shell /bin/sh \
--home /home/lacme-account \
--gecos "lacme account user" \
--quiet lacme-account
chown lacme-account: /etc/lacme/account.key
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \
openssh-client openssh-server
ssh-keygen -N "" -f ~root/.ssh/id_rsa
install -olacme-account -glacme-account -dm0700 ~lacme-account/.ssh
install -olacme-account -glacme-account -m0644 ~root/.ssh/id_rsa.pub ~lacme-account/.ssh/authorized_keys
{ echo -n "[127.0.0.1]:2222 "; cat /etc/ssh/ssh_host_rsa_key.pub; } >~root/.ssh/known_hosts
cat >/etc/ssh/sshd_config <<-EOF
Port 2222
ListenAddress 127.0.0.1
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM yes
EOF
install -oroot -groot -dm0755 /run/sshd
/usr/sbin/sshd
sed -ri 's|^#?command\s*=.*/lacme-accountd$|command = ssh -Tp2222 -llacme-account 127.0.0.1 lacme-accountd|' /etc/lacme/lacme.conf
sed -ri 's|^#?config\s*=.*|config = /etc/lacme/lacme-accountd.conf|' /etc/lacme/lacme.conf
lacme newOrder --debug 2>"$STDERR" || fail # intentionally use --debug, ssh should tunnel stdin + stdout + stderr
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
# and now with an authorized_keys(5) restriction
sed -ri "s|^[^#]|restrict,from=\"127.0.0.1\",command=\"/usr/bin/lacme-accountd --quiet --stdio\" &|" ~lacme-account/.ssh/authorized_keys
rm -vf /etc/lacme/simpletest.rsa.crt
! lacme newOrder 2>"$STDERR" || fail # --config= (and --debug) should be ignored
grepstderr -Fxq "Error: 'privkey' is not specified"
grepstderr -Fxq "[simpletest-rsa] Error: Couldn't issue X.509 certificate!"
install -olacme-account -glacme-account -Ddm0700 -- \
~lacme-account/.config/lacme ~lacme-account/.local/share/lacme
mv -t ~lacme-account/.config/lacme /etc/lacme/account.key
cat >~lacme-account/.config/lacme/lacme-accountd.conf <<-EOF
privkey = file:%E/lacme/account.key
logfile = %h/.local/share/lacme/accountd.log
EOF
lacme newOrder
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
# ensure signature requests are logged
grep -F ">>> OK signing request:" ~lacme-account/.local/share/lacme/accountd.log
# vim: set filetype=sh :
lacme-0.8.0/tests/apache2-proxy 0000664 0000000 0000000 00000002774 14014612315 0016356 0 ustar 00root root 0000000 0000000 # Use Apache2 as reverse proxy for lacme's internal webserver using the
# provided snippet
# bind the webserver to the default listening address
sed -i 's|^listen\s*=|#&|' /etc/lacme/lacme.conf
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends apache2 curl
a2enmod proxy_http
a2enconf lacme
mkdir /run/apache2
( set +eux && . /etc/apache2/envvars && apache2 )
# ensure that requests to the root URI and challenge URIs yield 502 Bad Gateway before starting the webserver
rv="$(curl -w"%{http_code}" -so/dev/null http://127.0.0.1/.well-known/acme-challenge/)"; [ $rv -eq 503 ]
rv="$(curl -w"%{http_code}" -so/dev/null http://127.0.0.1/.well-known/acme-challenge/foo)"; [ $rv -eq 503 ]
lacme --debug newOrder 2>"$STDERR" || fail
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
grepstderr -Fq "Forking ACME webserver bound to /run/lacme-www.socket, child PID "
grepstderr -Fq "Forking lacme-accountd, child PID "
grepstderr -Fq "Forking /usr/libexec/lacme/client, child PID "
grepstderr -Fq "Shutting down lacme-accountd"
grepstderr -Fq "Shutting down ACME webserver bound to /run/lacme-www.socket"
grepstderr -Eq "Incoming connection: GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+$"
# ensure apache2 was indeed used to serve challenge responses (Let's Encrypt caches validation results)
grep -E "\"GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+\" 200 .* \(([^)]+; )*Let's Encrypt validation server(; [^)]+)*\)\"$" \
/var/log/apache2/access.log
# vim: set filetype=sh :
lacme-0.8.0/tests/apache2-static 0000664 0000000 0000000 00000004275 14014612315 0016462 0 ustar 00root root 0000000 0000000 # Use Nginx to directly serve ACME challenge responses using the
# provided snippet
# bind the webserver to the default listening address
sed -i 's|^listen\s*=|#&|' /etc/lacme/lacme.conf
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends apache2 curl
ln -fs /etc/lacme/apache2-static.conf /etc/apache2/conf-available/lacme.conf
a2enmod proxy_http
a2enconf lacme
mkdir /run/apache2
( set +eux && . /etc/apache2/envvars && apache2 )
# 'challenge-directory' set to a non-existent directory
sed -ri 's|^#?challenge-directory\s*=.*|challenge-directory = /var/www/acme-challenge|' /etc/lacme/lacme.conf
! lacme newOrder 2>"$STDERR" || fail
grepstderr -Fqx "opendir(/var/www/acme-challenge): No such file or directory"
# ensure that requests to the root URI and challenge URIs respectively yield 403 Forbidden (no index) and 404 Not Found
install -o_lacme-client -gwww-data -m0750 -d /var/www/acme-challenge
rv="$(curl -w"%{http_code}" -so/dev/null http://127.0.0.1/.well-known/acme-challenge/)"; [ $rv -eq 403 ]
rv="$(curl -w"%{http_code}" -so/dev/null http://127.0.0.1/.well-known/acme-challenge/foo)"; [ $rv -eq 404 ]
# 'challenge-directory' set to a non-empty directory
touch /var/www/acme-challenge/.stamp
! lacme newOrder 2>"$STDERR" || fail
grepstderr -Fqx "Error: Refusing to use non-empty challenge directory /var/www/acme-challenge"
rm -f /var/www/acme-challenge/.stamp
lacme --debug newOrder 2>"$STDERR" || fail
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
ngrepstderr -Fq "Forking ACME webserver"
grepstderr -Fq "Using existing webserver on /var/www/acme-challenge"
grepstderr -Fq "Forking lacme-accountd, child PID "
grepstderr -Fq "Forking /usr/libexec/lacme/client, child PID "
grepstderr -Fq "Shutting down lacme-accountd"
ngrepstderr -Fq "Shutting down ACME webserver"
ngrepstderr -Eq "Incoming connection( from \S+)?: GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+$"
# ensure apache2 was indeed used to serve challenge responses (Let's Encrypt caches validation results)
grep -E "\"GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+\" 200 .* \(([^)]+; )*Let's Encrypt validation server(; [^)]+)*\)\"$" \
/var/log/apache2/access.log
# vim: set filetype=sh :
lacme-0.8.0/tests/cert-extensions 0000664 0000000 0000000 00000006045 14014612315 0017021 0 ustar 00root root 0000000 0000000 # X509v3 certificate extension, cf. x509v3_config(5ssl)
x509_check() {
local cert="$1" ext out
out="$(mktemp --tmpdir)"
ext="basicConstraints,subjectAltName,keyUsage,extendedKeyUsage,tlsfeature"
openssl x509 -noout -subject -ext "$ext" -nameopt compat <"$cert" >"$out"
diff --unified --color=auto -b --label="a/${cert#/}" --label="b/${cert#/}" -- - "$out"
}
# default settings (the ACME server adds a subjectAltName with the Common Name)
openssl genpkey -algorithm RSA -out /etc/lacme/test1.key
commonName="$(head -c10 /dev/urandom | base32 -w0 | tr "[A-Z]" "[a-z]").$DOMAINNAME"
cat >"/etc/lacme/lacme-certs.conf.d/test1.conf" <<- EOF
[test1]
certificate-key = /etc/lacme/test1.key
certificate-chain = /etc/lacme/test1.crt
subject = /CN=$commonName
EOF
lacme newOrder test1
test /etc/lacme/test1.crt -nt /etc/lacme/test1.key
x509_check /etc/lacme/test1.crt <<-EOF
subject=/CN=$commonName
X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Alternative Name:
DNS:$commonName
EOF
# subjectAltName
openssl genpkey -algorithm RSA -out /etc/lacme/test2.key
commonName="$(head -c10 /dev/urandom | base32 -w0 | tr "[A-Z]" "[a-z]").$DOMAINNAME"
subjectAltName=""
for i in $(seq 1 8); do
subjectAltName="${subjectAltName:+"$subjectAltName "}$(head -c10 /dev/urandom | base32 -w0 | tr "[A-Z]" "[a-z]").$DOMAINNAME"
done
cat >"/etc/lacme/lacme-certs.conf.d/test2.conf" <<- EOF
[test2]
certificate-key = /etc/lacme/test2.key
certificate-chain = /etc/lacme/test2.crt
subject = /CN=$commonName
subjectAltName = DNS:$(echo "$subjectAltName" | sed -r "s/ /, DNS:/g")
EOF
lacme newOrder test2
test /etc/lacme/test2.crt -nt /etc/lacme/test2.key
x509_check /etc/lacme/test2.crt <<-EOF
subject=/CN=$commonName
X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Alternative Name:
DNS:$(echo "$commonName" "$subjectAltName" | tr " " "\\n" | sort -u | paste -sd" " | sed -r "s/ /, DNS:/g")
EOF
# tlsfeature
openssl genpkey -algorithm RSA -out /etc/lacme/test3.key
commonName="$(head -c10 /dev/urandom | base32 -w0 | tr "[A-Z]" "[a-z]").$DOMAINNAME"
cat >"/etc/lacme/lacme-certs.conf.d/test3.conf" <<- EOF
[test3]
certificate-key = /etc/lacme/test3.key
certificate-chain = /etc/lacme/test3.crt
subject = /CN=$commonName
tlsfeature = status_request
EOF
lacme newOrder test3
test /etc/lacme/test3.crt -nt /etc/lacme/test3.key
x509_check /etc/lacme/test3.crt <<-EOF
subject=/CN=$commonName
X509v3 Key Usage: critical
Digital Signature, Key Encipherment
X509v3 Extended Key Usage:
TLS Web Server Authentication, TLS Web Client Authentication
X509v3 Basic Constraints: critical
CA:FALSE
X509v3 Subject Alternative Name:
DNS:$commonName
TLS Feature:
status_request
EOF
# vim: set filetype=sh :
lacme-0.8.0/tests/cert-install 0000664 0000000 0000000 00000013253 14014612315 0016267 0 ustar 00root root 0000000 0000000 # Certificate installation and post-issuance notification
# at least one of 'certificate' or 'certificate-chain' is required
cat >"/etc/lacme/lacme-certs.conf.d/bad1.conf" <<- EOF
[bad1]
certificate-key = /etc/lacme/bad1.key
subject = /CN=bad1.$DOMAINNAME
EOF
! lacme newOrder bad1 2>"$STDERR" || fail newOrder bad1
grepstderr -Fxq "[bad1] Warning: Missing 'certificate' and 'certificate-chain', skipping"
# 'subject' is required
cat >"/etc/lacme/lacme-certs.conf.d/bad2.conf" <<- EOF
[bad2]
certificate-key = /etc/lacme/bad2.key
certificate = /etc/lacme/bad2.crt
EOF
! lacme newOrder bad2 2>"$STDERR" || fail newOrder bad2
grepstderr -Fxq "[bad2] Warning: Couldn't generate CSR, skipping"
# 'certificate-key' is required
cat >"/etc/lacme/lacme-certs.conf.d/bad3.conf" <<- EOF
[bad3]
certificate = /etc/lacme/bad3.crt
subject = /CN=bad3.$DOMAINNAME
EOF
! lacme newOrder bad3 2>"$STDERR" || fail newOrder bad3
grepstderr -Fxq "[bad3] Warning: Couldn't generate CSR, skipping"
# 'certificate' installs only the leaf certificate
openssl genpkey -algorithm RSA -out /etc/lacme/test1.key
subject="/CN=$(head -c10 /dev/urandom | base32 -w0).$DOMAINNAME"
cat >"/etc/lacme/lacme-certs.conf.d/test1.conf" <<- EOF
[test1]
certificate-key = /etc/lacme/test1.key
certificate = /etc/lacme/test1.crt
subject = $subject
EOF
lacme newOrder test1 2>"$STDERR" || fail newOrder test1
test /etc/lacme/test1.crt -nt /etc/lacme/test1.key
sed -n "0,/^-----END CERTIFICATE-----$/ p" /etc/lacme/test1.crt >/etc/lacme/test1.pem
diff --unified /etc/lacme/test1.crt /etc/lacme/test1.pem
check_hash() {
local p1="$1" p2 s1 s2
s1="$(openssl x509 -noout -hash <"$p1")"
for p2 in /usr/share/lacme/ca-certificates.pem.*; do
s2="$(openssl x509 -noout -hash <"$p2")"
if [ "$s1" = "$s2" ]; then
return 0
fi
done
return 1
}
csplit -f /usr/share/lacme/ca-certificates.pem. /usr/share/lacme/ca-certificates.crt \
"/-----BEGIN CERTIFICATE-----/" "{*}"
rm -f /usr/share/lacme/ca-certificates.pem.00
# 'certificate-chain' appends the chain of trust
openssl genpkey -algorithm RSA -out /etc/lacme/test2.key
cat >"/etc/lacme/lacme-certs.conf.d/test2.conf" <<- EOF
[test2]
certificate-key = /etc/lacme/test2.key
certificate-chain = /etc/lacme/test2.crt
subject = $subject
EOF
lacme newOrder test2 2>"$STDERR" || fail newOrder test2
test /etc/lacme/test2.crt -nt /etc/lacme/test2.key
csplit -f /etc/lacme/test2.chain.pem /etc/lacme/test2.crt \
"/-----BEGIN CERTIFICATE-----/" "{*}"
test -s /etc/lacme/test2.chain.pem01 # leaf cert (00 is empty)
rm -f /etc/lacme/test2.chain.pem0[01]
test -s /etc/lacme/test2.chain.pem02 # depth 1
# all certificates at depth >=1 must be in our CA bundle
for p in /etc/lacme/test2.chain.pem*; do
check_hash "$p"
done
# 'certificate' + 'certificate-chain'
openssl genpkey -algorithm RSA -out /etc/lacme/test3.key
cat >"/etc/lacme/lacme-certs.conf.d/test3.conf" <<- EOF
[test3]
certificate-key = /etc/lacme/test3.key
certificate = /etc/lacme/test3.pem
certificate-chain = /etc/lacme/test3.crt
subject = $subject
EOF
lacme newOrder test3 2>"$STDERR" || fail newOrder test3
test /etc/lacme/test3.pem -nt /etc/lacme/test3.key
test /etc/lacme/test3.crt -nt /etc/lacme/test3.key
csplit -f /etc/lacme/test3.chain.pem /etc/lacme/test3.crt \
"/-----BEGIN CERTIFICATE-----/" "{*}"
sed -i "/^$/d" /etc/lacme/test3.chain.pem*
diff -q /etc/lacme/test3.chain.pem01 /etc/lacme/test3.pem
st="$(stat -c "%U:%G %#a" /etc/lacme/test3.pem)"
[ "$st" = "root:root 0644" ]
st="$(stat -c "%U:%G %#a" /etc/lacme/test3.crt)"
[ "$st" = "root:root 0644" ]
# chmod user
openssl genpkey -algorithm RSA -out /etc/lacme/test4.key
cat >"/etc/lacme/lacme-certs.conf.d/test4.conf" <<- EOF
[test4]
certificate-key = /etc/lacme/test4.key
certificate = /etc/lacme/test4.pem
certificate-chain = /etc/lacme/test4.crt
chown = nobody
subject = $subject
EOF
lacme newOrder test4 2>"$STDERR" || fail newOrder test4
st="$(stat -c "%U:%G %#a" /etc/lacme/test4.pem)"
[ "$st" = "nobody:root 0644" ]
st="$(stat -c "%U:%G %#a" /etc/lacme/test4.crt)"
[ "$st" = "nobody:root 0644" ]
# chmod user:group
openssl genpkey -algorithm RSA -out /etc/lacme/test5.key
cat >"/etc/lacme/lacme-certs.conf.d/test5.conf" <<- EOF
[test5]
certificate-key = /etc/lacme/test5.key
certificate = /etc/lacme/test5.pem
certificate-chain = /etc/lacme/test5.crt
chown = nobody:nogroup
subject = $subject
EOF
lacme newOrder test5 2>"$STDERR" || fail newOrder test5
st="$(stat -c "%U:%G %#a" /etc/lacme/test5.pem)"
[ "$st" = "nobody:nogroup 0644" ]
st="$(stat -c "%U:%G %#a" /etc/lacme/test5.crt)"
[ "$st" = "nobody:nogroup 0644" ]
# chown
openssl genpkey -algorithm RSA -out /etc/lacme/test6.key
cat >"/etc/lacme/lacme-certs.conf.d/test6.conf" <<- EOF
[test6]
certificate-key = /etc/lacme/test6.key
certificate = /etc/lacme/test6.pem
certificate-chain = /etc/lacme/test6.crt
chmod = 0400
subject = $subject
EOF
lacme newOrder test6 2>"$STDERR" || fail newOrder test6
st="$(stat -c "%U:%G %#a" /etc/lacme/test6.pem)"
[ "$st" = "root:root 0400" ]
st="$(stat -c "%U:%G %#a" /etc/lacme/test6.crt)"
[ "$st" = "root:root 0400" ]
# post-issuance notification
openssl genpkey -algorithm RSA -out /etc/lacme/test7.key
cat >"/etc/lacme/lacme-certs.conf.d/test7.conf" <<- EOF
[test7]
certificate-key = /etc/lacme/test7.key
certificate-chain = /etc/lacme/test7.crt
subject = $subject
notify = touch /tmp/test7.notify
EOF
lacme newOrder test7 2>"$STDERR" || fail newOrder test7
grepstderr -Fxq "Running notification command \`touch /tmp/test7.notify\`"
test -e /tmp/test7.notify
rm -f /tmp/test7.notify
lacme newOrder test7 2>"$STDERR" || fail newOrder test7
ngrepstderr -Fq "Running notification command"
! test -e /tmp/test7.notify
# vim: set filetype=sh :
lacme-0.8.0/tests/cert-renew 0000664 0000000 0000000 00000001572 14014612315 0015742 0 ustar 00root root 0000000 0000000 # Skip renewal for recent enough certificates
lacme newOrder 2>"$STDERR" || fail
grepstderr -Exq "Installing X.509 certificate chain /etc/lacme/simpletest.rsa.crt"
ino1="$(stat -c%i /etc/lacme/simpletest.rsa.crt)"
lacme newOrder 2>"$STDERR" || fail
grepstderr -Ex "^\[simpletest-rsa\] Valid until .*, skipping"
lacme newOrder --force 2>"$STDERR" || fail
grepstderr -Exq "Installing X.509 certificate chain /etc/lacme/simpletest.rsa.crt"
ino2="$(stat -c%i /etc/lacme/simpletest.rsa.crt)"
test "$ino1" != "$ino2" # we never truncate existing certificates
sed -ri 's|^#?min-days\s*=.*|min-days = 90|' /etc/lacme/lacme-certs.conf
lacme newOrder 2>"$STDERR" || fail
grepstderr -Exq "Installing X.509 certificate chain /etc/lacme/simpletest.rsa.crt"
ino3="$(stat -c%i /etc/lacme/simpletest.rsa.crt)"
test "$ino2" != "$ino3" # we never truncate existing certificates
# vim: set filetype=sh :
lacme-0.8.0/tests/cert-revoke 0000664 0000000 0000000 00000002661 14014612315 0016115 0 ustar 00root root 0000000 0000000 # Certification revocation, using either the account key or the
# certificate key
# also check issuance for ECDSA keys
openssl genpkey -algorithm EC -out /etc/lacme/simpletest.ecdsa.key \
-pkeyopt ec_paramgen_curve:P-256 \
-pkeyopt ec_param_enc:named_curve
sed "s/rsa/ecdsa/" /etc/lacme/lacme-certs.conf.d/simpletest-rsa.conf > \
/etc/lacme/lacme-certs.conf.d/simpletest-ecdsa.conf
# issue both RSA and ECDSA certificates
lacme newOrder 2>"$STDERR" || fail newOrder
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
test /etc/lacme/simpletest.ecdsa.crt -nt /etc/lacme/simpletest.ecdsa.key
# revoke the ECDSA certificate using the account key
lacme revokeCert /etc/lacme/simpletest.ecdsa.crt
! lacme revokeCert /etc/lacme/simpletest.ecdsa.crt 2>"$STDERR" || fail
grepstderr -Fxq "Revoking /etc/lacme/simpletest.ecdsa.crt"
grepstderr -Fxq "400 Bad Request (Certificate already revoked)"
grepstderr -Fxq "Warning: Couldn't revoke /etc/lacme/simpletest.ecdsa.crt"
# and the RSA certificate using the service key
mv -vfT /etc/lacme/simpletest.rsa.key /etc/lacme/account.key
lacme revokeCert /etc/lacme/simpletest.rsa.crt
! lacme revokeCert /etc/lacme/simpletest.rsa.crt 2>"$STDERR" || fail
grepstderr -Fxq "Revoking /etc/lacme/simpletest.rsa.crt"
grepstderr -Fxq "400 Bad Request (Certificate already revoked)"
grepstderr -Fxq "Warning: Couldn't revoke /etc/lacme/simpletest.rsa.crt"
# vim: set filetype=sh :
lacme-0.8.0/tests/cert-verify 0000664 0000000 0000000 00000004504 14014612315 0016124 0 ustar 00root root 0000000 0000000 # Certificate verification
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends ssl-cert
# add staging root certificates to the trust store to emulate the production environment
for ca in /usr/share/lacme/letsencrypt-stg-root-*.pem; do
ln -sT "$ca" "/usr/local/share/ca-certificates/$(basename -s.pem "$ca").crt"
done
update-ca-certificates
# test (modified) trust store for intermediate certificates
openssl verify -no-CAfile -CApath /etc/ssl/certs -show_chain /usr/share/lacme/letsencrypt-stg-int-*.pem
openssl verify -no-CApath -CAfile /etc/ssl/certs/ca-certificates.crt -show_chain /usr/share/lacme/letsencrypt-stg-int-*.pem
mv /usr/share/lacme/ca-certificates.crt /usr/share/lacme/ca-certificates.crt.back
! lacme newOrder 2>"$STDERR" || fail
grepstderr -Fxq "Can't open /usr/share/lacme/ca-certificates.crt for reading, No such file or directory"
grepstderr -Fxq "[simpletest-rsa] Error: Received invalid X.509 certificate from ACME server!"
# verification error for unrelated CA bundle
cat /etc/ssl/certs/ssl-cert-snakeoil.pem >/usr/share/lacme/ca-certificates.crt
! lacme newOrder 2>"$STDERR" || fail
grepstderr -Fxq "error 20 at 0 depth lookup: unable to get local issuer certificate"
grepstderr -Fxq "[simpletest-rsa] Error: Received invalid X.509 certificate from ACME server!"
# verification error when the CA bundle contains only the root certificates
cat /usr/share/lacme/letsencrypt-stg-root-*.pem >/usr/share/lacme/ca-certificates.crt
! lacme newOrder 2>"$STDERR" || fail
grepstderr -Fxq "error 20 at 0 depth lookup: unable to get local issuer certificate"
grepstderr -Fxq "[simpletest-rsa] Error: Received invalid X.509 certificate from ACME server!"
# verification error when the CA bundle contains only the intermediate certificates
cat /usr/share/lacme/letsencrypt-stg-int-*.pem >/usr/share/lacme/ca-certificates.crt
! lacme newOrder 2>"$STDERR" || fail
grepstderr -Fxq "error 2 at 1 depth lookup: unable to get issuer certificate"
grepstderr -Fxq "[simpletest-rsa] Error: Received invalid X.509 certificate from ACME server!"
# use saved bundle as custom CAfile
sed -ri 's|^#?CAfile\s*=.*|CAfile = /usr/share/lacme/ca-certificates.crt.back|' /etc/lacme/lacme-certs.conf
lacme newOrder 2>"$STDERR" || fail
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
# vim: set filetype=sh :
lacme-0.8.0/tests/drop-privileges 0000664 0000000 0000000 00000014257 14014612315 0017006 0 ustar 00root root 0000000 0000000 # Check privilige drop: UID/GID changes, chdir, environment, and file
# descriptors
# create wrapper to inspect processes
STATUSDIR="/dev/shm/lacme-wrap"
install -oroot -groot -m0755 /dev/stdin /run/lacme-wrap <<-EOF
#!/bin/sh
set -ue
PATH="/usr/bin:/bin"
export PATH
prefix="$STATUSDIR/\${1##*[/-]}"
cat "\$prefix/status"
pwd >"\$prefix/cwd"
stat -c "%U:%G %#a" . >"\$prefix/cwd-mod"
sort -z "\$prefix/environ"
( find -P /proc/\$\$/fd -mindepth 1 \! -lname "\$0" -printf "%P %#m %U:%G %l\\n" >"\$prefix/fd" )
exec "\$@"
EOF
# also check privilege drop for the spawned accountd
adduser --system --group \
--home /nonexistent --no-create-home \
--gecos "lacme account user" \
--quiet lacme-account
sed -ri 's|^#user\s*=\s*$|user = lacme-account|' /etc/lacme/lacme.conf
sed -ri 's|^#group\s*=\s*$|group = lacme-account|' /etc/lacme/lacme.conf
chown lacme-account: /etc/lacme/account.key
install -oroot -groot -dm0755 -- "$STATUSDIR"
install -olacme-account -groot -dm0700 -- "$STATUSDIR/accountd"
install -o_lacme-client -groot -dm0700 -- "$STATUSDIR/client"
install -o_lacme-www -groot -dm0700 -- "$STATUSDIR/webserver"
# test with a group that's not the primary group (nogroup) of _lacme-www etc
addgroup --system nogroup2
sed -ri 's|^#?group\s*=\s*nogroup$|group = nogroup2|' /etc/lacme/lacme.conf
sed -ri 's|^#?command\s*=.*/lacme-accountd$|command = /run/lacme-wrap /usr/bin/lacme-accountd|' /etc/lacme/lacme.conf
sed -ri 's|^#?command\s*=.*/lacme/client$|command = /run/lacme-wrap /usr/libexec/lacme/client|' /etc/lacme/lacme.conf
sed -ri 's|^#?command\s*=.*/lacme/webserver$|command = /run/lacme-wrap /usr/libexec/lacme/webserver|' /etc/lacme/lacme.conf
sed -ri 's|^#?config\s*=\s*$|config = /etc/lacme/lacme-accountd.conf|' /etc/lacme/lacme.conf
check_status() {
local path="$STATUSDIR/$1/status" user="$2" group="$3"
UID="$(getent passwd "$user" | cut -sd: -f3)"
GID="$(getent group "$group" | cut -sd: -f3)"
[ -n "$UID" -a -n "$GID" ] || return 1
grep -Ex "Uid:\\s+$UID\\s+$UID\\s+$UID\\s+$UID" "$path" || return 1
grep -Ex "Gid:\\s+$GID\\s+$GID\\s+$GID\\s+$GID" "$path" || return 1
grep -Ex "Groups:\s+$GID\s*" "$path" || return 1
}
check_cwd() {
local path="$STATUSDIR/$1/cwd" dir="$2" cwd
cwd="$(cat <"$path")" || return 1
[ "$cwd" = "$dir" ] || return 1
}
check_accountd() {
local socket_ino stderr prefix="$STATUSDIR/accountd"
check_status accountd lacme-account lacme-account || return 1
check_cwd accountd / || return 1
diff --label="a/accountd/environ" --label="b/accountd/environ" \
--color=auto --unified "$prefix/environ" - <<-EOF
HOME=/nonexistent
LOGNAME=lacme-account
PATH=/usr/bin:/bin
SHELL=/usr/sbin/nologin
TERM=$TERM
USER=lacme-account
EOF
stderr="$(readlink -e "/proc/$$/fd/2")"
socket_ino="$(sed -rn '/^0 .* socket:\[([0-9]+)\]$/ {s//\1/p;q}' "$prefix/fd")"
[ -n "$socket_ino" ] || return 1
grep -Fxq "0 0700 $UID:$GID socket:[$socket_ino]" "$prefix/fd" || return 1
grep -Fxq "1 0700 $UID:$GID socket:[$socket_ino]" "$prefix/fd" || return 1
grep -Fxq "2 0700 $UID:$GID $stderr" "$prefix/fd" || return 1
sed -ri '\#^[012] #d' "$prefix/fd"
! test -s "$prefix/fd" || return 1
}
check_client() {
local command="$1" cwd="$2" UID GID stdout stderr prefix="$STATUSDIR/client"
check_status client _lacme-client nogroup2
check_cwd client "$cwd"
diff --label="a/client/environ" --label="b/client/environ" \
--color=auto --unified "$prefix/environ" - <<-EOF
DEBUG=0
HOME=/nonexistent
LOGNAME=_lacme-client
PATH=/usr/bin:/bin
SHELL=/usr/sbin/nologin
TERM=$TERM
USER=_lacme-client
EOF
stdout="$(readlink -e "/proc/$$/fd/1")"
stderr="$(readlink -e "/proc/$$/fd/2")"
if [ "$command" = "account" ]; then # no pipe
grep -Fxq "0 0500 $UID:$GID /dev/null" "$prefix/fd" || return 1
grep -Fxq "1 0700 $UID:$GID $stdout" "$prefix/fd" || return 1
elif [ "$command" = "order" ]; then
grep -Exq "0 0500 $UID:$GID pipe:\[[0-9]+\]" "$prefix/fd" || return 1
grep -Exq "1 0300 $UID:$GID pipe:\[[0-9]+\]" "$prefix/fd" || return 1
else
exit 1
fi
grep -Fxq "2 0700 $UID:$GID $stderr" "$prefix/fd" || return 1
sed -ri '\#^[012] #d' "$prefix/fd"
grep -Exq "[0-9]+ 0700 $UID:$GID socket:\[[0-9]+\]" "$prefix/fd" || return 1
sed -ri '0,\#^[0-9]+ .* socket:\[[0-9]+\]$# {//d}' "$prefix/fd"
grep -Exq "[0-9]+ 0500 $UID:$GID /etc/lacme/lacme\.conf" "$prefix/fd" || return 1
sed -ri '0,\#^[0-9]+ .* /etc/lacme/lacme\.conf$# {//d}' "$prefix/fd"
! test -s "$prefix/fd" || return 1
}
check_webserver() {
local cwd="$1" UID GID stdout stderr prefix="$STATUSDIR/webserver"
check_status webserver _lacme-www nogroup2
check_cwd webserver "$cwd"
diff --label="a/webserver/environ" --label="b/webserver/environ" \
--color=auto --unified "$prefix/environ" - <<-EOF
DEBUG=0
HOME=/nonexistent
LOGNAME=_lacme-www
PATH=/usr/bin:/bin
SHELL=/usr/sbin/nologin
TERM=$TERM
USER=_lacme-www
EOF
stdout="$(readlink -e "/proc/$$/fd/1")"
stderr="$(readlink -e "/proc/$$/fd/2")"
grep -Fxq "0 0500 $UID:$GID /dev/null" "$prefix/fd" || return 1
grep -Fxq "1 0700 $UID:$GID $stdout" "$prefix/fd" || return 1
grep -Fxq "2 0700 $UID:$GID $stderr" "$prefix/fd" || return 1
sed -ri '\#^[012] #d' "$prefix/fd"
grep -Exq "[0-9]+ 0700 $UID:$GID socket:\[[0-9]+\]" "$prefix/fd" || return 1
sed -ri '0,\#^[0-9]+ .* socket:\[[0-9]+\]$# {//d}' "$prefix/fd"
! test -s "$prefix/fd" || return 1
}
lacme account
check_accountd
check_client account /
! test -e "$STATUSDIR/webserver/status" # account 'command' doesn't start the webserver
lacme newOrder
check_accountd
challenge_dir="$(cat "$STATUSDIR/webserver/cwd")"
[ "${challenge_dir#"/tmp/acme-challenge."}" != "$challenge_dir" ] || exit 1
check_client order "$challenge_dir"
check_webserver "$challenge_dir"
# the temporary challenge directory is created with permissive mode
diff --label="a/webserver/cwd" --label="b/webserver/cwd" \
--color=auto --unified "$STATUSDIR/webserver/cwd-mod" - <<-EOF
_lacme-client:root 0755
EOF
# vim: set filetype=sh :
lacme-0.8.0/tests/nginx-proxy 0000664 0000000 0000000 00000003054 14014612315 0016166 0 ustar 00root root 0000000 0000000 # Use Nginx as reverse proxy for lacme's internal webserver using the
# provided snippet
# bind the webserver to the default listening address
sed -i 's|^listen\s*=|#&|' /etc/lacme/lacme.conf
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends nginx-light curl
cat >/etc/nginx/sites-enabled/default <<-EOF
server {
listen 80 default_server;
server_name _;
include /etc/lacme/nginx.conf;
}
EOF
nginx
# ensure that requests to the root URI and challenge URIs yield 502 Bad Gateway before starting the webserver
rv="$(curl -w"%{http_code}" -so/dev/null http://127.0.0.1/.well-known/acme-challenge/)"; [ $rv -eq 502 ]
rv="$(curl -w"%{http_code}" -so/dev/null http://127.0.0.1/.well-known/acme-challenge/foo)"; [ $rv -eq 502 ]
lacme --debug newOrder 2>"$STDERR" || fail
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
grepstderr -Fq "Forking ACME webserver bound to /run/lacme-www.socket, child PID "
grepstderr -Fq "Forking lacme-accountd, child PID "
grepstderr -Fq "Forking /usr/libexec/lacme/client, child PID "
grepstderr -Fq "Shutting down lacme-accountd"
grepstderr -Fq "Shutting down ACME webserver bound to /run/lacme-www.socket"
grepstderr -Eq "Incoming connection: GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+$"
# ensure nginx was indeed used to serve challenge responses (Let's Encrypt caches validation results)
grep -E "\"GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+\" 200 .* \(([^)]+; )*Let's Encrypt validation server(; [^)]+)*\)\"$" \
/var/log/nginx/access.log
# vim: set filetype=sh :
lacme-0.8.0/tests/nginx-static 0000664 0000000 0000000 00000004251 14014612315 0016274 0 ustar 00root root 0000000 0000000 # Use Nginx to directly serve ACME challenge responses using the
# provided snippet
# bind the webserver to the default listening address
sed -i 's|^listen\s*=|#&|' /etc/lacme/lacme.conf
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends nginx-light curl
cat >/etc/nginx/sites-enabled/default <<-EOF
server {
listen 80 default_server;
server_name _;
include /etc/lacme/nginx-static.conf;
}
EOF
nginx
# 'challenge-directory' set to a non-existent directory
sed -ri 's|^#?challenge-directory\s*=.*|challenge-directory = /var/www/acme-challenge|' /etc/lacme/lacme.conf
! lacme newOrder 2>"$STDERR" || fail
grepstderr -Fqx "opendir(/var/www/acme-challenge): No such file or directory"
# ensure that requests to the root URI and challenge URIs respectively yield 403 Forbidden (no index) and 404 Not Found
install -o_lacme-client -gwww-data -m0750 -d /var/www/acme-challenge
rv="$(curl -w"%{http_code}" -so/dev/null http://127.0.0.1/.well-known/acme-challenge/)"; [ $rv -eq 403 ]
rv="$(curl -w"%{http_code}" -so/dev/null http://127.0.0.1/.well-known/acme-challenge/foo)"; [ $rv -eq 404 ]
# 'challenge-directory' set to a non-empty directory
touch /var/www/acme-challenge/.stamp
! lacme newOrder 2>"$STDERR" || fail
grepstderr -Fqx "Error: Refusing to use non-empty challenge directory /var/www/acme-challenge"
rm -f /var/www/acme-challenge/.stamp
lacme --debug newOrder 2>"$STDERR" || fail
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
ngrepstderr -Fq "Forking ACME webserver"
grepstderr -Fq "Using existing webserver on /var/www/acme-challenge"
grepstderr -Fq "Forking lacme-accountd, child PID "
grepstderr -Fq "Forking /usr/libexec/lacme/client, child PID "
grepstderr -Fq "Shutting down lacme-accountd"
ngrepstderr -Fq "Shutting down ACME webserver"
ngrepstderr -Eq "Incoming connection( from \S+)?: GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+$"
# ensure nginx was indeed used to serve challenge responses (Let's Encrypt caches validation results)
grep -E "\"GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+\" 200 .* \(([^)]+; )*Let's Encrypt validation server(; [^)]+)*\)\"$" \
/var/log/nginx/access.log
# vim: set filetype=sh :
lacme-0.8.0/tests/old-accountd 0000664 0000000 0000000 00000001745 14014612315 0016245 0 ustar 00root root 0000000 0000000 # IPC test between lacme(8) and ancient lacme-accountd(1) 0.2 from Debian jessie
adduser --disabled-password \
--home /home/lacme-account \
--gecos "lacme account user" \
--quiet lacme-account
install -olacme-account -glacme-account -Ddm0700 -- ~lacme-account/.config/lacme
chown lacme-account: /etc/lacme/account.key
cat >~lacme-account/.config/lacme/lacme-accountd.conf <<-EOF
privkey = file:/etc/lacme/account.key
EOF
echo "deb http://deb.debian.org/debian stretch main" >>/etc/apt/sources.list
DEBIAN_FRONTEND="noninteractive" apt update
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \
--reinstall --allow-downgrades \
-oDPkg::Options::="--force-confdef" -oDPkg::Options::="--force-overwrite" \
lacme-accountd/stretch
SOCKET=~lacme-account/S.lacme
runuser -u lacme-account -- lacme-accountd --socket="$SOCKET" & PID=$!
lacme --socket="$SOCKET" account
lacme --socket="$SOCKET" newOrder
kill $PID
wait
# vim: set filetype=sh :
lacme-0.8.0/tests/old-lacme 0000664 0000000 0000000 00000002507 14014612315 0015523 0 ustar 00root root 0000000 0000000 # IPC test between recent lacme-accountd(1) and ancient lacme(8) 0.5 from Debian buster
# (we don't try earlier versions as we need v2 support of the ACME API)
adduser --disabled-password \
--home /home/lacme-account \
--gecos "lacme account user" \
--quiet lacme-account
install -olacme-account -glacme-account -Ddm0700 -- ~lacme-account/.config/lacme
chown lacme-account: /etc/lacme/account.key
mv -f /usr/share/lacme/ca-certificates.crt /usr/share/lacme/ca-certificates.crt.back
cat >~lacme-account/.config/lacme/lacme-accountd.conf <<-EOF
privkey = file:/etc/lacme/account.key
EOF
echo "deb http://deb.debian.org/debian buster main" >>/etc/apt/sources.list
DEBIAN_FRONTEND="noninteractive" apt update
DEBIAN_FRONTEND="noninteractive" apt install -y --no-install-recommends \
--reinstall --allow-downgrades \
-oDPkg::Options::="--force-confdef" -oDPkg::Options::="--force-overwrite" \
lacme/buster
# restore staging environment
mv -f /usr/share/lacme/ca-certificates.crt.back /usr/share/lacme/ca-certificates.crt
SOCKET=~lacme-account/S.lacme
runuser -u lacme-account -- lacme-accountd --socket="$SOCKET" & PID=$!
sed -ri "s/^\[accountd]$/#&/" /etc/lacme/lacme.conf # https://bugs.debian.org/955767
lacme --socket="$SOCKET" account
lacme --socket="$SOCKET" newOrder
kill $PID
wait
# vim: set filetype=sh :
lacme-0.8.0/tests/register 0000664 0000000 0000000 00000000330 14014612315 0015502 0 ustar 00root root 0000000 0000000 # Register new account key (or update the contact/ToS URI)
lacme account --tos-agreed --register "mailto:noreply+lacme=$$@guilhem.org"
# should return info about the account
lacme account
# vim: set filetype=sh :
lacme-0.8.0/tests/spec-expansion 0000664 0000000 0000000 00000016636 14014612315 0016632 0 ustar 00root root 0000000 0000000 # %-specifiers expansion
# lacme --config=, all specifiers, root privileges
! lacme --config="%C %E %t %h %T %g %G %u %U %%.conf" account 2>"$STDERR" || fail
grepstderr -Fxq "Can't open /var/cache /etc /run /root /tmp root 0 root 0 %.conf: No such file or directory"
# lacme --config=, all specifiers, root privileges, defined XDG_*
! env XDG_CACHE_HOME=/foo/cache XDG_CONFIG_HOME=/foo/config XDG_RUNTIME_DIR=/foo/run HOME=/foo/home USER=myuser TMPDIR=/foo/tmp \
lacme --config="%C %E %t %h %T %g %G %u %U %%.conf" account 2>"$STDERR" || fail
grepstderr -Fxq "Can't open /var/cache /etc /run /root /foo/tmp root 0 root 0 %.conf: No such file or directory"
# lacme --config=, all specifiers, non-root, unset XDG_RUNTIME_DIR
! runuser -u nobody -- lacme --config="%C %E %t %h %T %g %G %u %U %%.conf" account 2>"$STDERR" || fail
grepstderr -Fxq "Error: Undefined expansion %t in \"%C %E %t %h %T %g %G %u %U %%.conf\""
# lacme --config=, all specifiers, non-root, defined XDG_RUNTIME_DIR, no other XDG_*
! runuser -u nobody -g www-data -- env XDG_RUNTIME_DIR=/foo/run \
lacme --config="%C %E %t %h %T %g %G %u %U %%.conf" account 2>"$STDERR" || fail
grepstderr -Fxq "Can't open /nonexistent/.cache /nonexistent/.config /foo/run /nonexistent /tmp www-data 33 nobody 65534 %.conf: No such file or directory"
# lacme --config=, all specifiers, non-root, defined XDG_*
! runuser -u nobody -- env XDG_CACHE_HOME=/foo/cache XDG_CONFIG_HOME=/foo/config XDG_RUNTIME_DIR=/foo/run HOME=/foo/home USER=myuser TMPDIR=/foo/tmp \
lacme --config="%C %E %t %h %T %g %G %u %U %%.conf" account 2>"$STDERR" || fail
grepstderr -Fxq "Can't open /foo/cache /foo/config /foo/run /nonexistent /foo/tmp nogroup 65534 nobody 65534 %.conf: No such file or directory"
# lacme --socket=
! lacme --config="%E/lacme/lacme.conf" --socket="%t/S.lacme2" account --debug 2>"$STDERR" || fail
grepstderr -Fxq "Using configuration file: /etc/lacme/lacme.conf"
grepstderr -Fxq "Can't stat /run/S.lacme2: No such file or directory (Is lacme-accountd running?)"
# 'challenge-directory' setting (expands before privilege drop)
sed -ri 's|^#?challenge-directory\s*=.*|challenge-directory = /nonexistent/%u:%g|' /etc/lacme/lacme.conf
! lacme newOrder --debug 2>"$STDERR" || fail
grepstderr -Fq "Using existing webserver on /nonexistent/root:root"
# lacme --config-certs= and 'config-certs' settings (expands before privilege drop)
! lacme newOrder --debug nonexistent 2>"$STDERR" || fail
grepstderr -Fxq "Reading /etc/lacme/lacme-certs.conf"
sed -ri 's|^#?config-certs\s*=.*|config-certs = /nonexistent/%u:%g.conf|' /etc/lacme/lacme.conf
! lacme newOrder --debug nonexistent 2>"$STDERR" || fail
grepstderr -Fxq "Reading /nonexistent/root:root.conf"
! lacme newOrder --config-certs="%E/lacme/certs.conf.d" --debug nonexistent 2>"$STDERR" || fail
grepstderr -vFxq "Reading /etc/lacme/lacme-certs.conf"
grepstderr -Fxq "Reading /etc/lacme/certs.conf.d"
# 'config' setting in [accountd] section (expands after privilege drop)
sed -ri 's|^#?config\s*=\s*$|config = /nonexistent/%u:%g.conf|' /etc/lacme/lacme.conf
! lacme account 2>"$STDERR" || fail
grepstderr -Fxq "Error: Failed to open file '/nonexistent/root:root.conf' for reading: No such file or directory"
sed -ri 's|^#?user\s*=\s*$|user = nobody|' /etc/lacme/lacme.conf
! lacme account 2>"$STDERR" || fail
grepstderr -Fxq "Error: Failed to open file '/nonexistent/nobody:root.conf' for reading: No such file or directory"
# 'command' setting in [accountd] section (expands after privilege drop)
sed -ri 's|^#?command\s*=.*/lacme-accountd$|command = /usr/bin/lacme-accountd --%u|' /etc/lacme/lacme.conf
! lacme account 2>"$STDERR" || fail
grepstderr -Fxq "Unknown option: nobody"
sed -ri 's|^#?command\s*=.*/lacme-accountd .*|command = /nonexistent/%u/%g %u %g|' /etc/lacme/lacme.conf
! lacme account 2>"$STDERR" || fail
grepstderr -Eq "^Can't exec \"/nonexistent/nobody/root\": No such file or directory"
#######################################################################
# lacme-accountd --config=, all specifiers, root privileges
! lacme-accountd --config="%C %E %t %h %T %g %G %u %U %%.conf" 2>"$STDERR" || fail
grepstderr -Fxq "Error: Failed to open file '/var/cache /etc /run /root /tmp root 0 root 0 %.conf' for reading: No such file or directory"
# lacme-accountd --config=, all specifiers, root privileges, defined XDG_*
! env XDG_CACHE_HOME=/foo/cache XDG_CONFIG_HOME=/foo/config XDG_RUNTIME_DIR=/foo/run HOME=/foo/home USER=myuser TMPDIR=/foo/tmp \
lacme-accountd --config="%C %E %t %h %T %g %G %u %U %%.conf" 2>"$STDERR" || fail
grepstderr -Fxq "Error: Failed to open file '/var/cache /etc /run /root /foo/tmp root 0 root 0 %.conf' for reading: No such file or directory"
# lacme-accountd --config=, all specifiers, non-root, unset XDG_RUNTIME_DIR
! runuser -u nobody -- lacme-accountd --config="%C %E %t %h %T %g %G %u %U %%.conf" account 2>"$STDERR" || fail
grepstderr -Fxq "Error: Undefined expansion %t in \"%C %E %t %h %T %g %G %u %U %%.conf\""
# lacme-accountd --config=, all specifiers, non-root, defined XDG_RUNTIME_DIR, no other XDG_*
! runuser -u nobody -g www-data -- env XDG_RUNTIME_DIR=/foo/run \
lacme-accountd --config="%C %E %t %h %T %g %G %u %U %%.conf" 2>"$STDERR" || fail
grepstderr -Fxq "Error: Failed to open file '/nonexistent/.cache /nonexistent/.config /foo/run /nonexistent /tmp www-data 33 nobody 65534 %.conf' for reading: No such file or directory"
# lacme-accountd --config=, all specifiers, non-root, defined XDG_*
! runuser -u nobody -- env XDG_CACHE_HOME=/foo/cache XDG_CONFIG_HOME=/foo/config XDG_RUNTIME_DIR=/foo/run HOME=/foo/home USER=myuser TMPDIR=/foo/tmp \
lacme-accountd --config="%C %E %t %h %T %g %G %u %U %%.conf" 2>"$STDERR" || fail
grepstderr -Fxq "Error: Failed to open file '/foo/cache /foo/config /foo/run /nonexistent /foo/tmp nogroup 65534 nobody 65534 %.conf' for reading: No such file or directory"
# lacme-accountd --privkey=
! lacme-accountd --privkey="file:%h/lacme-accountd.key" --debug 2>"$STDERR" || fail
grepstderr -Fxq "Error: Can't open /root/lacme-accountd.key: No such file or directory"
# lacme-accountd, default socket location
lacme-accountd --debug 2>"$STDERR" & PID=$!
sleep 1
kill $PID || fail
wait || fail
grepstderr -Fxq "Using configuration file: /etc/lacme/lacme-accountd.conf"
grepstderr -Fxq "Starting lacme Account Key Manager at /run/S.lacme"
grepstderr -Fxq "Unlinking /run/S.lacme"
# lacme-accountd --config= --socket= --privkey=
ln -s lacme-accountd.conf /etc/lacme/accountd.conf
lacme-accountd --config="%E/lacme/accountd.conf" --socket="%t/S.lacme2" --privkey="file:%E/lacme/account.key" --debug 2>"$STDERR" & PID=$!
sleep 1
kill $PID || fail
wait || fail
grepstderr -Fxq "Using configuration file: /etc/lacme/accountd.conf"
grepstderr -Fxq "Starting lacme Account Key Manager at /run/S.lacme2"
grepstderr -Fxq "Unlinking /run/S.lacme2"
# lacme-accountd, custom 'socket' setting
sed -ri 's|^#?socket\s*=.*|socket = %t/S.lacme3|' /etc/lacme/lacme-accountd.conf
lacme-accountd --debug 2>"$STDERR" & PID=$!
sleep 1
kill $PID || fail
wait || fail
grepstderr -Fxq "Using configuration file: /etc/lacme/lacme-accountd.conf"
grepstderr -Fxq "Starting lacme Account Key Manager at /run/S.lacme3"
grepstderr -Fxq "Unlinking /run/S.lacme3"
# lacme-accountd, custom 'privkey' setting
sed -ri 's|^privkey\s*=.*|privkey = file:%h/lacme-accountd.key|' /etc/lacme/lacme-accountd.conf
! lacme-accountd --debug 2>"$STDERR" || fail
grepstderr -Fxq "Error: Can't open /root/lacme-accountd.key: No such file or directory"
# vim: set filetype=sh :
lacme-0.8.0/tests/webservers 0000664 0000000 0000000 00000001500 14014612315 0016045 0 ustar 00root root 0000000 0000000 # Multiple webservers (each binding to a different address)
sed -ri 's|^#?listen\s*=.*|listen = [::]:80 127.0.0.1:8080|' /etc/lacme/lacme.conf
lacme --debug newOrder 2>"$STDERR" || fail newOrder
test /etc/lacme/simpletest.rsa.crt -nt /etc/lacme/simpletest.rsa.key
grepstderr -Fq "Forking ACME webserver bound to [::]:80, child PID "
grepstderr -Fq "Forking ACME webserver bound to 127.0.0.1:8080, child PID "
grepstderr -Fq "Forking lacme-accountd, child PID "
grepstderr -Fq "Forking /usr/libexec/lacme/client, child PID "
grepstderr -Fq "Shutting down lacme-accountd"
grepstderr -Fq "Shutting down ACME webserver bound to [::]:80"
grepstderr -Fq "Shutting down ACME webserver bound to 127.0.0.1:8080"
grepstderr -Eq "Incoming connection( from \S+)?: GET /\.well-known/acme-challenge/\S+ HTTP/[0-9.]+$"
# vim: set filetype=sh :
lacme-0.8.0/webserver 0000775 0000000 0000000 00000011043 14014612315 0014526 0 ustar 00root root 0000000 0000000 #!/usr/bin/perl -T
#----------------------------------------------------------------------
# ACME client written with process isolation and minimal privileges in mind
# (webserver component)
# Copyright © 2015-2021 Guilhem Moulin
#
# 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 .
#----------------------------------------------------------------------
use v5.14.2;
use strict;
use warnings;
# Usage: webserver FD
#
# fdopen(3) the file descriptor FD (corresponding to a listening
# socket), then keep accept(2)'ing connections and consider each
# connection as the verification of an ACME challenge, i.e., serve the
# requested challenge token.
#
# NOTE: one needs to chdir(2) to an appropriate ACME challenge directory
# before running this program, since challenge tokens are (on purpose)
# only looked for in the current directory.
#
# NOTE: one should run this program as an unprivileged user:group such
# as "www-data:www-data"; bind(2)'ing to a privileged port such as 80 is
# not a problem since FD can be bound as root prior to the execve(2).
use Errno qw/EINTR ENOENT/;
use Fcntl qw/O_NOFOLLOW O_RDONLY/;
use Socket qw/AF_UNIX AF_INET AF_INET6/;
# Untaint and fdopen(3) the listening socket
(shift @ARGV // die) =~ /\A(\d+)\z/ or die;
open (my $S, '+<&=', $1+0) or die "fdopen $1: $!";
my $ROOT = '/.well-known/acme-challenge';
close STDIN or die "close: $!";
close STDOUT or die "close: $!";
sub info($$$) {
my ($sockaddr, $msg, $req) = @_;
$req =~ s/\r\n\z// if defined $req;
# get a string representation of the peer's address
my $fam = Socket::sockaddr_family($sockaddr);
my $peer;
if ($fam == AF_UNIX) {
$peer = Socket::unpack_sockaddr_un($sockaddr);
} else {
my (undef, $ip) =
$fam == AF_INET ? Socket::unpack_sockaddr_in($sockaddr) :
$fam == AF_INET6 ? Socket::unpack_sockaddr_in6($sockaddr) :
die;
$peer = Socket::inet_ntop($fam, $ip);
}
$msg .= " from [$peer]" if defined $peer and $peer ne '';
$msg .= ": $req" if defined $req;
print STDERR $msg, "\n";
}
while (1) {
my $sockaddr = accept(my $conn, $S) or do {
next if $! == EINTR; # try again if accept(2) was interrupted by a signal
die "accept: $!";
};
my $req = $conn->getline();
info($sockaddr, "[$$] Incoming connection", $req) if $ENV{DEBUG};
next unless defined $req;
if ($req !~ s/\A(GET|HEAD) (.*) HTTP\/(1\.[01])\r\n\z/$2/) {
info($sockaddr, "Error: Bad request", $req);
next;
}
my ($method, $proto) = ($1, $3);
# Consume (and ignore) the headers
while (defined (my $h = $conn->getline())) { last if $h eq "\r\n" };
my ($status_line, $content_type, $content);
if ($req =~ /\A\Q$ROOT\E\/([A-Za-z0-9_\-]+)\z/) {
# only serve base64-encoded filenames (tokens) in the cwd
# XXX stat(2) followed by open(2) is racy; open(2) would hang if
# an attacker manages to replace a regular file with a FIFO
# between the syscalls, leading to denial of service; however
# there shouldn't be any risk of information disclosure as we're
# not following symlinks (and the cwd is not owned by us)
if (-f $1 and sysopen(my $fh, $1, O_NOFOLLOW|O_RDONLY)) {
($status_line, $content_type) = ('200 OK', 'application/jose+json');
$content = do { local $/ = undef; $fh->getline() };
$fh->close() or die "close: $!";
} elsif ($! == ENOENT) { # errno from either stat(2) or open(2)
$status_line = '404 Not Found';
}
}
$conn->print( "HTTP/$proto ", ($status_line // '403 Forbidden'), "\r\n" );
$conn->print( "Content-Type: $content_type\r\n" ) if defined $content_type;
$conn->print( "Content-Length: ".length($content)."\r\n" ) if defined $content;
$conn->print( "Connection: close\r\n" );
$conn->print( "\r\n" );
$conn->print( $content ) if defined $content and $method eq 'GET';
$conn->close() or die "close: $!";
}