From abb432dd31198b7e053ada776e9c94737f945c1a Mon Sep 17 00:00:00 2001 From: MageDelfador <9780339+MageDelfador@users.noreply.github.com> Date: Wed, 15 Oct 2025 23:44:38 +0800 Subject: [PATCH 01/14] Update sdkconfig.defaults --- sdkconfig.defaults | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdkconfig.defaults b/sdkconfig.defaults index d5613aa..1b4f4e4 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -10,6 +10,8 @@ CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="pico-keys-sdk/config/esp32/partitions.csv" CONFIG_PARTITION_TABLE_FILENAME="pico-keys-sdk/config/esp32/partitions.csv" CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_WL_SECTOR_SIZE_512=y CONFIG_WL_SECTOR_MODE_PERF=y COMPILER_OPTIMIZATION="Performance" -- 2.34.1 From 331f4f1c4e1abfe328c907d5e186261336709de4 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 26 Oct 2025 20:24:47 +0100 Subject: [PATCH 02/14] Relicense project under the GNU Affero General Public License v3 (AGPLv3) and add the Enterprise / Commercial licensing option. Main changes: - Replace GPLv3 headers with AGPLv3 headers in source files. - Update LICENSE file to the full AGPLv3 text. - Add ENTERPRISE.md describing the dual-licensing model: * Community Edition: AGPLv3 (strong copyleft, including network use). * Enterprise / Commercial Edition: proprietary license for production / multi-user / OEM use without the obligation to disclose derivative code. - Update README with a new "License and Commercial Use" section pointing to ENTERPRISE.md and clarifying how companies can obtain a commercial license. Why this change: - AGPLv3 ensures that modified versions offered as a service or deployed in production environments must provide corresponding source code. - The Enterprise / Commercial edition provides organizations with an alternative proprietary license that allows internal, large-scale, or OEM use (bulk provisioning, policy enforcement, inventory / revocation, custom attestation, signed builds) without AGPL disclosure obligations. This commit formally marks the first release that is dual-licensed: AGPLv3 for the Community Edition and a proprietary commercial license for Enterprise customers. Signed-off-by: Pol Henarejos --- LICENSE | 143 +++++++++++++++----------------- README.md | 27 ++++++ pico-keys-sdk | 2 +- src/openpgp/cmd_activate_file.c | 8 +- src/openpgp/cmd_challenge.c | 8 +- src/openpgp/cmd_change_pin.c | 8 +- src/openpgp/cmd_get_data.c | 8 +- src/openpgp/cmd_import_data.c | 8 +- src/openpgp/cmd_internal_aut.c | 8 +- src/openpgp/cmd_keypair_gen.c | 8 +- src/openpgp/cmd_mse.c | 8 +- src/openpgp/cmd_pso.c | 8 +- src/openpgp/cmd_put_data.c | 8 +- src/openpgp/cmd_reset_retry.c | 8 +- src/openpgp/cmd_select.c | 8 +- src/openpgp/cmd_select_data.c | 8 +- src/openpgp/cmd_terminate_df.c | 8 +- src/openpgp/cmd_verify.c | 8 +- src/openpgp/cmd_version.c | 8 +- src/openpgp/defs.c | 8 +- src/openpgp/do.c | 8 +- src/openpgp/do.h | 8 +- src/openpgp/files.c | 8 +- src/openpgp/files.h | 8 +- src/openpgp/management.c | 8 +- src/openpgp/management.h | 8 +- src/openpgp/openpgp.c | 8 +- src/openpgp/openpgp.h | 8 +- src/openpgp/piv.c | 8 +- src/openpgp/version.h | 8 +- 30 files changed, 201 insertions(+), 187 deletions(-) diff --git a/LICENSE b/LICENSE index f288702..bae94e1 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies @@ -7,17 +7,15 @@ Preamble - The GNU General Public License is a free, copyleft license for -software and other kinds of works. + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. 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 +our General Public Licenses are 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. +software for all its users. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you @@ -26,44 +24,34 @@ 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. + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. - 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. + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. - 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. + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. - 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. + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. The precise terms and conditions for copying, distribution and modification follow. @@ -72,7 +60,7 @@ modification follow. 0. Definitions. - "This License" refers to version 3 of the GNU General Public License. + "This License" refers to version 3 of the GNU Affero General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. @@ -549,35 +537,45 @@ 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. + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. 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 +under version 3 of the GNU 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. +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. 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 +the GNU Affero 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 +Program specifies that a certain numbered version of the GNU Affero 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 +GNU Affero 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 +versions of the GNU Affero 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. @@ -635,40 +633,29 @@ 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 + it under the terms of the GNU Affero 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. + GNU Affero General Public License for more details. - You should have received a copy of the GNU General Public License + You should have received a copy of the GNU Affero 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". + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. 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 -. +For more information on this, and how to apply and follow the GNU AGPL, see +. \ No newline at end of file diff --git a/README.md b/README.md index 93ba842..cb50877 100644 --- a/README.md +++ b/README.md @@ -172,6 +172,33 @@ OpenSC relies on PCSC driver, which reads a list (`Info.plist`) that contains a - Use the pure-browser online [Pico Commissioner](https://www.picokeys.com/pico-commissioner/ "Pico Commissioner") that commissions the Pico Key on-the-fly without external tools. - Build and configure the project with the proper VID/PID with `USB_VID` and `USB_PID` parameters in `CMake` (see [Build section](#build "Build section")). Note that you cannot distribute the patched/compiled binary if you do not own the VID/PID or have an explicit authorization. +## License and Commercial Use + +This project is available under two editions: + +**Community Edition (FOSS)** +- Released under the GNU Affero General Public License v3 (AGPLv3). +- You are free to study, modify, and run the code, including for internal evaluation. +- If you distribute modified binaries/firmware, OR if you run a modified version of this project as a network-accessible service, you must provide the corresponding source code to the users of that binary or service, as required by AGPLv3. +- No warranty. No SLA. No guaranteed support. + +**Enterprise / Commercial Edition** +- Proprietary license for organizations that want to: + - run this in production with multiple users/devices, + - integrate it into their own product/appliance, + - enforce corporate policies (PIN policy, admin/user roles, revocation), + - and *not* be required to publish derivative source code. +- Includes access to enterprise-only features (bulk provisioning, multi-user policy controls, device inventory & revocation, custom attestation/identity), official signed builds, and an onboarding call. + +Typical licensing models: +- Internal use (within one legal entity). +- Redistribution / OEM (shipping this as part of your product). + +For commercial licensing and enterprise features, email pol@henarejos.me +Subject: `ENTERPRISE LICENSE ` + +See `ENTERPRISE.md` for details. + ## Credits Pico OpenPGP uses the following libraries or portion of code: - MbedTLS for cryptographic operations. diff --git a/pico-keys-sdk b/pico-keys-sdk index 9b294b9..8f907b2 160000 --- a/pico-keys-sdk +++ b/pico-keys-sdk @@ -1 +1 @@ -Subproject commit 9b294b96856ad20f735fe45a777d74486906a10c +Subproject commit 8f907b25ba28cea4f8312e627862352fc012a8a2 diff --git a/src/openpgp/cmd_activate_file.c b/src/openpgp/cmd_activate_file.c index 77a2c23..964c862 100644 --- a/src/openpgp/cmd_activate_file.c +++ b/src/openpgp/cmd_activate_file.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_challenge.c b/src/openpgp/cmd_challenge.c index 8e9db61..6cf8df8 100644 --- a/src/openpgp/cmd_challenge.c +++ b/src/openpgp/cmd_challenge.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_change_pin.c b/src/openpgp/cmd_change_pin.c index e85a9f1..56a0736 100644 --- a/src/openpgp/cmd_change_pin.c +++ b/src/openpgp/cmd_change_pin.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_get_data.c b/src/openpgp/cmd_get_data.c index 20e034f..363456e 100644 --- a/src/openpgp/cmd_get_data.c +++ b/src/openpgp/cmd_get_data.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_import_data.c b/src/openpgp/cmd_import_data.c index 109d159..2be1363 100644 --- a/src/openpgp/cmd_import_data.c +++ b/src/openpgp/cmd_import_data.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #ifdef ESP_PLATFORM diff --git a/src/openpgp/cmd_internal_aut.c b/src/openpgp/cmd_internal_aut.c index 1c2203b..3fcaf56 100644 --- a/src/openpgp/cmd_internal_aut.c +++ b/src/openpgp/cmd_internal_aut.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_keypair_gen.c b/src/openpgp/cmd_keypair_gen.c index 3cc3fea..c41e66d 100644 --- a/src/openpgp/cmd_keypair_gen.c +++ b/src/openpgp/cmd_keypair_gen.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_mse.c b/src/openpgp/cmd_mse.c index 4be170d..50e7ace 100644 --- a/src/openpgp/cmd_mse.c +++ b/src/openpgp/cmd_mse.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_pso.c b/src/openpgp/cmd_pso.c index 2da2194..3c93db2 100644 --- a/src/openpgp/cmd_pso.c +++ b/src/openpgp/cmd_pso.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #ifdef ESP_PLATFORM diff --git a/src/openpgp/cmd_put_data.c b/src/openpgp/cmd_put_data.c index 1e39ca6..0636f30 100644 --- a/src/openpgp/cmd_put_data.c +++ b/src/openpgp/cmd_put_data.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_reset_retry.c b/src/openpgp/cmd_reset_retry.c index 1a84a2f..5525363 100644 --- a/src/openpgp/cmd_reset_retry.c +++ b/src/openpgp/cmd_reset_retry.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_select.c b/src/openpgp/cmd_select.c index 95f94cf..d97f9b6 100644 --- a/src/openpgp/cmd_select.c +++ b/src/openpgp/cmd_select.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_select_data.c b/src/openpgp/cmd_select_data.c index c99d3b2..b529e04 100644 --- a/src/openpgp/cmd_select_data.c +++ b/src/openpgp/cmd_select_data.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_terminate_df.c b/src/openpgp/cmd_terminate_df.c index a1eee5e..dfc1e77 100644 --- a/src/openpgp/cmd_terminate_df.c +++ b/src/openpgp/cmd_terminate_df.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_verify.c b/src/openpgp/cmd_verify.c index da12e51..6cd12d4 100644 --- a/src/openpgp/cmd_verify.c +++ b/src/openpgp/cmd_verify.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/cmd_version.c b/src/openpgp/cmd_version.c index 2d66ffe..f1cd8a2 100644 --- a/src/openpgp/cmd_version.c +++ b/src/openpgp/cmd_version.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/defs.c b/src/openpgp/defs.c index 415b58a..4b7e67d 100644 --- a/src/openpgp/defs.c +++ b/src/openpgp/defs.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/do.c b/src/openpgp/do.c index c90761a..fba8580 100644 --- a/src/openpgp/do.c +++ b/src/openpgp/do.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "openpgp.h" diff --git a/src/openpgp/do.h b/src/openpgp/do.h index 3e2a494..3ed727d 100644 --- a/src/openpgp/do.h +++ b/src/openpgp/do.h @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ extern const uint8_t algorithm_attr_p256k1[]; diff --git a/src/openpgp/files.c b/src/openpgp/files.c index 1d185b6..51ed59c 100644 --- a/src/openpgp/files.c +++ b/src/openpgp/files.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "files.h" diff --git a/src/openpgp/files.h b/src/openpgp/files.h index e6fd717..2246481 100644 --- a/src/openpgp/files.h +++ b/src/openpgp/files.h @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ diff --git a/src/openpgp/management.c b/src/openpgp/management.c index 166fd9c..35b3ea3 100644 --- a/src/openpgp/management.c +++ b/src/openpgp/management.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #include "pico_keys.h" diff --git a/src/openpgp/management.h b/src/openpgp/management.h index 369adc2..7ff5bd4 100644 --- a/src/openpgp/management.h +++ b/src/openpgp/management.h @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #ifndef _MANAGEMENT_H_ diff --git a/src/openpgp/openpgp.c b/src/openpgp/openpgp.c index 3bc50ba..e4bc2f9 100644 --- a/src/openpgp/openpgp.c +++ b/src/openpgp/openpgp.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #ifdef ESP_PLATFORM diff --git a/src/openpgp/openpgp.h b/src/openpgp/openpgp.h index a04ba0d..9ff9dd9 100644 --- a/src/openpgp/openpgp.h +++ b/src/openpgp/openpgp.h @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #ifndef __OPENPGP_H_ diff --git a/src/openpgp/piv.c b/src/openpgp/piv.c index 6ffbe11..73fc0d6 100644 --- a/src/openpgp/piv.c +++ b/src/openpgp/piv.c @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #ifdef ESP_PLATFORM diff --git a/src/openpgp/version.h b/src/openpgp/version.h index e67b872..ad47a61 100644 --- a/src/openpgp/version.h +++ b/src/openpgp/version.h @@ -3,16 +3,16 @@ * Copyright (c) 2022 Pol Henarejos. * * 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 + * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, version 3. * * 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. + * Affero 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 . + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . */ #ifndef __VERSION_H_ -- 2.34.1 From b606b75a125b2291df180652e825eddd83abb907 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 26 Oct 2025 20:40:01 +0100 Subject: [PATCH 03/14] Update license model and add ENTERPRISE.md Signed-off-by: Pol Henarejos --- ENTERPRISE.md | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 26 +++++++++-- 2 files changed, 139 insertions(+), 3 deletions(-) create mode 100644 ENTERPRISE.md diff --git a/ENTERPRISE.md b/ENTERPRISE.md new file mode 100644 index 0000000..71cdcf5 --- /dev/null +++ b/ENTERPRISE.md @@ -0,0 +1,116 @@ +# Enterprise / Commercial Edition + +This project is offered under two editions: + +## 1. Community Edition (FOSS) + +The Community Edition is released under the GNU Affero General Public License v3 (AGPLv3). + +Intended for: +- individual users and researchers +- evaluation / prototyping +- internal lab / security testing + +You are allowed to: +- read and study the source code +- modify it +- run it internally + +Obligations under AGPLv3: +- If you distribute modified firmware/binaries/libraries to third parties, you must provide the corresponding source code of your modifications. +- If you run a modified version of this project as a network-accessible service (internal or external), you must offer the source code of those modifications to the users of that service. +- No warranty, no support, no SLA. +- Enterprise features (bulk provisioning, multi-user policy enforcement, device inventory / revocation, corporate PIN rules, custom attestation/identity, etc.) are NOT included. + +The Community Edition will continue to exist. + +## 2. Enterprise / Commercial Edition + +The Enterprise / Commercial Edition is a proprietary license for organizations that need to: + +- deploy this in production at scale (multiple devices / multiple users / multiple teams) +- integrate it into their own physical product or appliance +- run it as an internal service (VM / container / private cloud "HSM / auth backend") for multiple internal teams or tenants +- enforce internal security policy (admin vs user roles, mandatory PIN rules, secure offboarding / revocation) +- avoid any AGPLv3 disclosure obligations for their own modifications and integration code + +### What the Enterprise Edition provides + +**Base license package (always included):** +- **Commercial license (proprietary).** + You may run and integrate the software/firmware in production — including virtualized / internal-cloud style deployments — without being required to disclose derivative source code under AGPLv3. +- **Official signed builds.** + You receive signed builds from the original developer so you can prove integrity and provenance. +- **Onboarding call (up to 1 hour).** + A live remote session to get you from "we have it" to "it’s actually running in our environment" with minimal guesswork. + +**Optional enterprise components (available on demand, scoped and priced per customer):** +- **Production / multi-user readiness.** + Permission to operate the system with multiple users, multiple devices and multiple teams in real environments. +- **Bulk / fleet provisioning.** + Automated enrollment for many tokens/devices/users at once (CSV / directory import), scripted onboarding of new users, initial PIN assignment / reset workflows, and role-based access (admin vs user). +- **Policy & lifecycle tooling.** + Corporate PIN policy enforcement, per-user / per-team access control, device inventory / traceability, and secure revocation / retirement when someone leaves. +- **Custom attestation / per-organization identity.** + Per-company certificate chains and attestation keys so devices can prove "this token/HSM is officially ours," including anti-cloning / unique device identity for OEM and fleet use. +- **Virtualization / internal cloud deployment support.** + Guidance and components to run this as an internal service (VM, container, private-cloud HSM/auth backend) serving multiple internal teams or tenants under your brand. +- **Post-quantum (PQC) key material handling.** + Integration/roadmap support for PQC algorithms (auth / signing) and secure PQC key storage inside the device or service. +- **Hierarchical deterministic key derivation (HD).** + Wallet-style hierarchical key trees (BIP32-like concepts adapted to this platform) for issuing per-user / per-tenant / per-purpose subkeys without exporting the root secret — e.g. embedded wallet logic, tenant isolation, firmware signing trees, large fleets. +- **Cryptographically signed audit trail / tamper-evident event logging.** + High-assurance logging of sensitive actions (key use, provisioning, PIN resets, revocations) with integrity protection for forensic / compliance needs. +- **Dual-control / two-person approval ("four-eyes").** + Require multi-party authorization for high-risk actions such as firmware signing, key export, or critical configuration changes — standard in high-assurance / regulated environments. +- **Secure key escrow / disaster recovery design.** + Split-secret or escrowed backup strategies so you don’t lose critical signing keys if a single admin disappears or hardware is lost. +- **Release-signing / supply-chain hardening pipeline.** + Reference tooling and process so every production firmware/binary is signed with hardware-backed keys, proving origin and preventing tampering in transit or at manufacturing. +- **Policy-locked hardened mode ("FIPS-style profile").** + Restricted algorithms, debug disabled, no raw key export, tamper-evident configuration for regulated / high-assurance deployments. +- **Priority support / security response SLA.** + A direct line and guaranteed response window for production-impacting security issues. +- **White-label demo / pre-sales bundle.** + Branded demo firmware + safe onboarding script so you can show "your product" to your own customers without exposing real production secrets. + +These components are NOT automatically bundled. They are available case-by-case depending on your use case and are priced separately. + +### Licensing models + +- **Internal Use License** + Internal production use within one legal entity (your company), including internal private cloud / virtualized deployments for multiple internal teams. + Optional enterprise components can be added as needed. + +- **OEM / Redistribution / Service License** + Integration into a product/appliance you ship to customers, OR operating this as a managed service / hosted feature for external clients or third parties. + Optional enterprise components (attestation branding, PQC support, HD key derivation, multi-tenant service hardening, audit trail, etc.) can be added as required. + +Pricing depends on scope, fleet size, number of users/tenants, regulatory requirements, and which optional components you select. + +### Request a quote + +Email: +Subject: `ENTERPRISE LICENSE ` + +Please include: +- Company name and country +- Intended use: + - Internal private deployment + - OEM / external service to third parties +- Approximate scale (number of devices/tokens, number of users/tenants) +- Which optional components you are interested in (bulk provisioning, policy & lifecycle tooling, attestation branding / anti-cloning, virtualization/cloud, PQC, HD key derivation, audit trail, dual-control, key escrow, supply-chain signing, hardened mode, SLA, white-label demo) + +You will receive: +1. A short commercial license agreement naming your company. +2. Access to the base package (and any optional components agreed). +3. Scheduling of the onboarding call. + +## Why Enterprise exists + +- Companies often need hardware-backed security (HSM, FIDO2, OpenPGP, etc.) under their own control, but cannot or will not open-source their internal security workflows. +- They also need multi-user / fleet-management features that hobby users do not. +- The commercial license funds continued development, maintenance and new hardware support. + +The Community Edition remains AGPLv3. +The Enterprise Edition is for production, scale, and legal clarity. diff --git a/README.md b/README.md index cb50877..ec4d547 100644 --- a/README.md +++ b/README.md @@ -187,12 +187,32 @@ This project is available under two editions: - run this in production with multiple users/devices, - integrate it into their own product/appliance, - enforce corporate policies (PIN policy, admin/user roles, revocation), + - deploy it as an internal virtualized / cloud-style service, - and *not* be required to publish derivative source code. -- Includes access to enterprise-only features (bulk provisioning, multi-user policy controls, device inventory & revocation, custom attestation/identity), official signed builds, and an onboarding call. +- Base package includes: + - commercial license (no AGPLv3 disclosure obligation for your modifications / integration) + - onboarding call + - access to officially signed builds +- Optional / on-demand enterprise components that can be added case-by-case: + - ability to operate in multi-user / multi-device environments + - device inventory, traceability and secure revocation/offboarding + - custom attestation, per-organization device identity / anti-cloning + - virtualization / internal "HSM or auth backend" service for multiple teams or tenants + - post-quantum (PQC) key material handling and secure PQC credential storage + - hierarchical deterministic key derivation (HD wallet–style key trees for per-user / per-tenant keys, firmware signing trees, etc.) + - cryptographically signed audit trail / tamper-evident logging + - dual-control / two-person approval for high-risk operations + - secure key escrow / disaster recovery strategy + - release-signing / supply-chain hardening toolchain + - policy-locked hardened mode ("FIPS-style profile") + - priority security-response SLA + - white-label demo / pre-sales bundle Typical licensing models: -- Internal use (within one legal entity). -- Redistribution / OEM (shipping this as part of your product). +- Internal use (single legal entity, including internal private cloud / virtualized deployments). +- OEM / Redistribution / Service (ship in your product OR offer it as a service to third parties). + +These options are scoped and priced individually depending on which components you actually need. For commercial licensing and enterprise features, email pol@henarejos.me Subject: `ENTERPRISE LICENSE ` -- 2.34.1 From 296fbd142fb8a9d0336fc31b793d81475712154b Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 27 Oct 2025 08:54:16 +0100 Subject: [PATCH 04/14] Add CONTRIBUTING Signed-off-by: Pol Henarejos --- CONTRIBUTING.md | 105 ++++++++++++++++++++++++++++++++++++++++++++++++ ENTERPRISE.md | 2 +- 2 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ac193da --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,105 @@ +# Contributing + +Thank you for your interest in contributing to this project. + +This repository is published in two forms: +- a Community Edition released under AGPLv3, and +- a proprietary / commercial / Enterprise Edition offered to organizations. + +To keep that model legally clean, we need to be explicit about how contributions can be used. + +By opening a pull request, you agree to all of the following: + +1. **You have the right to contribute this code.** + You are either the original author of the contribution, or you have obtained the necessary rights/permissions to contribute it under these terms. + +2. **Dual licensing permission.** + You agree that your contribution may be: + - merged into this repository, and + - used, copied, modified, sublicensed, and redistributed + - under the AGPLv3 Community Edition, and + - under any proprietary / commercial / Enterprise editions of this project, + now or in the future. + + In other words: you are granting the project maintainer(s) the right to include + your contribution in both the open-source (AGPLv3) codebase and in closed-source / + commercially licensed builds, without any additional approval or payment. + +3. **Attribution.** + The maintainers may keep or add attribution lines such as + `Copyright (c) ` or an AUTHORS / CONTRIBUTORS list. + The maintainers may also make changes for clarity, style, security, refactoring, + or integration reasons. + +4. **No automatic SLA.** + Submitting a pull request does *not* create any support obligation, + service-level agreement, warranty, or guarantee that the contribution + will be reviewed, merged, or maintained. + +5. **Potential rejection for business reasons.** + Features that fall under "Enterprise / Commercial" functionality + (e.g. multi-tenant provisioning at scale, centralized audit trails, + corporate policy enforcement, attestation/branding flows, key escrow / dual-control, + etc.) may be declined for the public AGPLv3 tree even if technically valid. + That is normal: some functionality is intentionally offered only + under commercial terms. + +If you are not comfortable with these terms, **do not open a pull request yet.** +Instead, please open an Issue to start a discussion. + +## How to contribute (technical side) + +### 1. Bug reports / issues +- Please include: + - hardware / board revision + - firmware / commit hash + - exact steps to reproduce + - expected vs actual behavior + - logs / traces if available (strip secrets) + +Security-sensitive findings: do **not** post publicly. +Send a short report by email instead so it can be triaged responsibly. + +### 2. Small fixes / minor improvements +- You can open a PR directly for: + - bug fixes + - portability fixes / new board definitions + - clarifications in code comments + - build / tooling cleanup + - documentation of existing behavior + +Please keep PRs focused (one logical change per PR if possible). + +### 3. Larger features / behavior changes +- Please open an Issue first and describe: + - what problem you're solving (not just "add feature X") + - impact on existing flows / security model + - any new dependencies + +This helps avoid doing a bunch of work on something that won't be accepted +in the Community Edition. + +### 4. Coding style / security posture +- Aim for clarity and small, auditable changes. This code runs in places + where secrets live. +- No debug backdoors, no "just for testing" shortcuts left enabled. +- Keep external dependencies minimal and license-compatible + (MIT / Apache 2.0 / similarly permissive is usually fine). + +### 5. Commit / PR format +- Use descriptive commit messages ("Fix PIN retry counter wrap" is better than "fix stuff"). +- In the PR description, please include a short summary of what was changed and why. +- At the bottom of the PR description, **copy/paste and confirm the licensing line below**: + + > I confirm that I have read `CONTRIBUTING.md` and I agree that this contribution may be used under both the AGPLv3 Community Edition and any proprietary / commercial / Enterprise editions of this project, now or in the future. + +A PR without that confirmation may be delayed or closed without merge. + +## Thank you + +This project exists because people build on it, break it, fix it, +and push it into places it wasn't originally designed to go. + +Whether you are here for research, hacking on hardware, +rolling out secure keys for a team, or building a commercial product: +thank you for helping improve it. diff --git a/ENTERPRISE.md b/ENTERPRISE.md index 71cdcf5..f550fed 100644 --- a/ENTERPRISE.md +++ b/ENTERPRISE.md @@ -90,7 +90,7 @@ Pricing depends on scope, fleet size, number of users/tenants, regulatory requir ### Request a quote -Email: +Email: pol@henarejos.me Subject: `ENTERPRISE LICENSE ` Please include: -- 2.34.1 From 321d02eb0d0e2806cfd020815573d24348f681b7 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 27 Oct 2025 08:58:23 +0100 Subject: [PATCH 05/14] Add template for pull requests. Signed-off-by: Pol Henarejos --- .github/PULL_REQUEST_TEMPLATE.md | 50 ++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..07a08ad --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,50 @@ +## Summary + +Describe in plain language what this PR does and why. + +- What problem does it solve? +- Is it a bug fix, a new feature, a cleanup/refactor…? + + +## Details / Impact + +Please include any relevant details: + +- Hardware / board(s) tested: +- Firmware / commit/base version: +- Security impact (if any): + - e.g. changes PIN handling, touches key storage, affects attestation, etc. +- Behavior changes: + - e.g. new command, new API surface, different defaults, etc. + + +## Testing + +How did you test this change? + +- Steps to reproduce / validate: +- Expected vs actual results: +- Any logs / traces (please remove secrets): + + +## Licensing confirmation (required) + +By checking the box below, you confirm ALL of the following: + +- You are the author of this contribution, or you have the right to contribute it. +- You have read `CONTRIBUTING.md`. +- You agree that this contribution may be merged, used, modified, and redistributed: + - under the AGPLv3 Community Edition, **and** + - under any proprietary / commercial / Enterprise editions of this project, + now or in the future. +- You understand that submitting this PR does not create any support obligation, + SLA, or guarantee of merge. + +**I confirm the above licensing terms:** + +- [ ] Yes, I agree + + +## Anything else? + +Optional: mention known limitations, follow-ups, or if this is related to an existing Issue. -- 2.34.1 From b80a4693c69ed8f81570a562dcdb09d0eaad927d Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 30 Nov 2025 18:31:54 +0100 Subject: [PATCH 06/14] Use max freq in esp32 Signed-off-by: Pol Henarejos --- sdkconfig.defaults | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdkconfig.defaults b/sdkconfig.defaults index d5613aa..1b4f4e4 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -10,6 +10,8 @@ CONFIG_PARTITION_TABLE_CUSTOM=y CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="pico-keys-sdk/config/esp32/partitions.csv" CONFIG_PARTITION_TABLE_FILENAME="pico-keys-sdk/config/esp32/partitions.csv" CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y +CONFIG_ESPTOOLPY_FLASHMODE_QIO=y +CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240=y CONFIG_WL_SECTOR_SIZE_512=y CONFIG_WL_SECTOR_MODE_PERF=y COMPILER_OPTIMIZATION="Performance" -- 2.34.1 From d938720ab5265fb1fc7f0579aac773ae20ccfcc2 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 30 Nov 2025 18:32:12 +0100 Subject: [PATCH 07/14] Upgrade Pico Keys SDK to v8.0 Signed-off-by: Pol Henarejos --- pico-keys-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pico-keys-sdk b/pico-keys-sdk index 8f907b2..711a4df 160000 --- a/pico-keys-sdk +++ b/pico-keys-sdk @@ -1 +1 @@ -Subproject commit 8f907b25ba28cea4f8312e627862352fc012a8a2 +Subproject commit 711a4df490db2be0870a1e541dfcdcae4506784d -- 2.34.1 From 9742991debd213c218cd94450c622b32e2f8653e Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 30 Nov 2025 18:39:10 +0100 Subject: [PATCH 08/14] Add version definitions. Signed-off-by: Pol Henarejos --- src/openpgp/defs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openpgp/defs.c b/src/openpgp/defs.c index 4b7e67d..256d622 100644 --- a/src/openpgp/defs.c +++ b/src/openpgp/defs.c @@ -16,5 +16,8 @@ */ #include "openpgp.h" +#include "version.h" uint8_t PICO_PRODUCT = 3; +uint8_t PICO_VERSION_MAJOR = PIPGP_VERSION_MAJOR; +uint8_t PICO_VERSION_MINOR = PIPGP_VERSION_MINOR; -- 2.34.1 From 42a13b2777a1d641df76a46b47fa6ddfd2531d9e Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Sun, 30 Nov 2025 19:11:53 +0100 Subject: [PATCH 09/14] Fix start-up test script Signed-off-by: Pol Henarejos --- tests/start-up-and-test.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/start-up-and-test.sh b/tests/start-up-and-test.sh index c17c958..12744f4 100755 --- a/tests/start-up-and-test.sh +++ b/tests/start-up-and-test.sh @@ -18,6 +18,7 @@ sleep 1 rm -f memory.flash echo -n "Start Pico OpenPGP..." ./build_in_docker/pico_openpgp > /dev/null 2>&1 & +PID=$! test $? -eq 0 && echo -n "." || fail sleep 1 ATR="3b:da:18:ff:81:b1:fe:75:1f:03:00:31:f5:73:c0:01:60:00:90:00:1c" @@ -27,4 +28,19 @@ test $? -eq 0 && echo -e "${OK}" || fail pytest tests -W ignore::DeprecationWarning +echo -n "Stopping Pico OpenPGP..." +kill "$PID" 2>/dev/null || true +kill -9 "$PID" 2>/dev/null || true +test $? -eq 0 && echo -e "${OK}" || fail +sleep 1 +rm -f memory.flash +echo -n "Start Pico OpenPGP..." +./build_in_docker/pico_openpgp > /dev/null 2>&1 & +PID=$! +test $? -eq 0 && echo -n "." || fail +sleep 1 +e=$(opensc-tool -an 2>&1) +grep -q "${ATR}" <<< $e && echo -n "." || fail +test $? -eq 0 && echo -e "${OK}" || fail + ./tests/scripts/cli-test.sh -- 2.34.1 From 81b012c0dde324b82e5cb0f8f70675c885eca05e Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 1 Dec 2025 01:45:26 +0100 Subject: [PATCH 10/14] Fix on AID selection. It should support shorter AID if matches. Signed-off-by: Pol Henarejos --- pico-keys-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pico-keys-sdk b/pico-keys-sdk index 711a4df..2d72a15 160000 --- a/pico-keys-sdk +++ b/pico-keys-sdk @@ -1 +1 @@ -Subproject commit 711a4df490db2be0870a1e541dfcdcae4506784d +Subproject commit 2d72a157d50253de23f2e94cce7b7585a4d711d4 -- 2.34.1 From 9606e346303d0e4e0b36e7f7c4bfc789cbabd154 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 1 Dec 2025 13:21:38 +0100 Subject: [PATCH 11/14] Upgrade mbedTLS only when necessary Signed-off-by: Pol Henarejos --- pico-keys-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pico-keys-sdk b/pico-keys-sdk index 2d72a15..00cc5be 160000 --- a/pico-keys-sdk +++ b/pico-keys-sdk @@ -1 +1 @@ -Subproject commit 2d72a157d50253de23f2e94cce7b7585a4d711d4 +Subproject commit 00cc5bebfec8c711943d32afdee1e4724e16f2fb -- 2.34.1 From 7936e20b9ad698126e14ca9efd38b4ceaab4b264 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 1 Dec 2025 15:31:35 +0100 Subject: [PATCH 12/14] Add missing definitions for EdDSA Signed-off-by: Pol Henarejos --- pico-keys-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pico-keys-sdk b/pico-keys-sdk index 00cc5be..00c08af 160000 --- a/pico-keys-sdk +++ b/pico-keys-sdk @@ -1 +1 @@ -Subproject commit 00cc5bebfec8c711943d32afdee1e4724e16f2fb +Subproject commit 00c08afc58ce95af799bea17a838be5ab8e1539f -- 2.34.1 From 73053bdc6da09a7fe7927381440ddbfda27cbb91 Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 1 Dec 2025 17:03:34 +0100 Subject: [PATCH 13/14] Upodate mbedtls only when necessary. Signed-off-by: Pol Henarejos --- pico-keys-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pico-keys-sdk b/pico-keys-sdk index 00c08af..c1cc33f 160000 --- a/pico-keys-sdk +++ b/pico-keys-sdk @@ -1 +1 @@ -Subproject commit 00c08afc58ce95af799bea17a838be5ab8e1539f +Subproject commit c1cc33fd9d6b4c2c8fb18f0254130e37f978724b -- 2.34.1 From 45d174b8bf874aff4fe346e48b8d4fa2286f42fc Mon Sep 17 00:00:00 2001 From: Pol Henarejos Date: Mon, 1 Dec 2025 17:03:43 +0100 Subject: [PATCH 14/14] Upgrade to v4.0 Signed-off-by: Pol Henarejos --- build_pico_openpgp.sh | 4 ++-- src/openpgp/version.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/build_pico_openpgp.sh b/build_pico_openpgp.sh index 46ea1b6..d930980 100755 --- a/build_pico_openpgp.sh +++ b/build_pico_openpgp.sh @@ -1,7 +1,7 @@ #!/bin/bash -VERSION_MAJOR="3" -VERSION_MINOR="6" +VERSION_MAJOR="4" +VERSION_MINOR="0" NO_EDDSA=0 SUFFIX="${VERSION_MAJOR}.${VERSION_MINOR}" #if ! [[ -z "${GITHUB_SHA}" ]]; then diff --git a/src/openpgp/version.h b/src/openpgp/version.h index ad47a61..dfbdd33 100644 --- a/src/openpgp/version.h +++ b/src/openpgp/version.h @@ -29,7 +29,7 @@ #define PIV_VERSION_MINOR (PIV_VERSION & 0xff) -#define PIPGP_VERSION 0x0306 +#define PIPGP_VERSION 0x0400 #define PIPGP_VERSION_MAJOR ((PIPGP_VERSION >> 8) & 0xff) #define PIPGP_VERSION_MINOR (PIPGP_VERSION & 0xff) -- 2.34.1