From 4f366c12a31e3a6aba8e35f61bc42acca4380077 Mon Sep 17 00:00:00 2001 From: Hatter Jiang Date: Fri, 25 Jul 2025 23:24:13 +0800 Subject: [PATCH] feat: clone from https://github.com/reitowo/hw-sign --- .gitmodules | 3 + LICENSE | 674 ++++ README.md | 191 +- hw-sign-android/.gitignore | 3 + hw-sign-android/app/.gitignore | 1 + hw-sign-android/app/build.gradle.kts | 61 + hw-sign-android/app/proguard-rules.pro | 21 + .../fan/ovo/hwsign/ExampleInstrumentedTest.kt | 24 + .../app/src/main/AndroidManifest.xml | 31 + .../main/java/fan/ovo/hwsign/AuthService.kt | 212 ++ .../main/java/fan/ovo/hwsign/KeyManager.kt | 214 ++ .../main/java/fan/ovo/hwsign/MainActivity.kt | 115 + .../java/fan/ovo/hwsign/ui/theme/Color.kt | 11 + .../java/fan/ovo/hwsign/ui/theme/Theme.kt | 58 + .../main/java/fan/ovo/hwsign/ui/theme/Type.kt | 25 + .../res/drawable/ic_launcher_background.xml | 170 + .../res/drawable/ic_launcher_foreground.xml | 30 + .../res/mipmap-anydpi-v26/ic_launcher.xml | 6 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 6 + .../src/main/res/mipmap-hdpi/ic_launcher.webp | Bin 0 -> 1404 bytes .../res/mipmap-hdpi/ic_launcher_round.webp | Bin 0 -> 2898 bytes .../src/main/res/mipmap-mdpi/ic_launcher.webp | Bin 0 -> 982 bytes .../res/mipmap-mdpi/ic_launcher_round.webp | Bin 0 -> 1772 bytes .../main/res/mipmap-xhdpi/ic_launcher.webp | Bin 0 -> 1900 bytes .../res/mipmap-xhdpi/ic_launcher_round.webp | Bin 0 -> 3918 bytes .../main/res/mipmap-xxhdpi/ic_launcher.webp | Bin 0 -> 2884 bytes .../res/mipmap-xxhdpi/ic_launcher_round.webp | Bin 0 -> 5914 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.webp | Bin 0 -> 3844 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.webp | Bin 0 -> 7778 bytes .../app/src/main/res/values/colors.xml | 10 + .../app/src/main/res/values/strings.xml | 3 + .../app/src/main/res/values/themes.xml | 5 + .../app/src/main/res/xml/backup_rules.xml | 13 + .../main/res/xml/data_extraction_rules.xml | 19 + .../java/fan/ovo/hwsign/ExampleUnitTest.kt | 17 + hw-sign-android/build.gradle.kts | 6 + .../reports/problems/problems-report.html | 663 ++++ hw-sign-android/gradle.properties | 23 + hw-sign-android/gradle/libs.versions.toml | 39 + .../gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59203 bytes .../gradle/wrapper/gradle-wrapper.properties | 6 + hw-sign-android/gradlew | 185 ++ hw-sign-android/gradlew.bat | 89 + hw-sign-android/settings.gradle.kts | 24 + .../hw-sign-apple.xcodeproj/project.pbxproj | 356 ++ .../contents.xcworkspacedata | 7 + hw-sign-apple/hw-sign-apple/App.swift | 60 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 85 + .../Assets.xcassets/Contents.json | 6 + hw-sign-apple/hw-sign-apple/ContentView.swift | 200 ++ .../Preview Assets.xcassets/Contents.json | 6 + .../hw-sign-apple/Services/AuthService.swift | 283 ++ .../hw-sign-apple/Services/KeyManager.swift | 149 + .../hw-sign-apple/hw_sign_apple.entitlements | 18 + hw-sign-browser/.gitignore | 30 + hw-sign-browser/README.md | 33 + hw-sign-browser/env.d.ts | 1 + hw-sign-browser/index.html | 13 + hw-sign-browser/package.json | 31 + hw-sign-browser/pnpm-lock.yaml | 2886 +++++++++++++++++ hw-sign-browser/postcss.config.js | 6 + hw-sign-browser/public/favicon.ico | Bin 0 -> 4286 bytes hw-sign-browser/src/App.vue | 260 ++ hw-sign-browser/src/assets/base.css | 90 + hw-sign-browser/src/assets/logo.svg | 1 + hw-sign-browser/src/assets/main.css | 20 + hw-sign-browser/src/main.ts | 5 + hw-sign-browser/src/services/authService.ts | 701 ++++ hw-sign-browser/tailwind.config.js | 9 + hw-sign-browser/tsconfig.app.json | 12 + hw-sign-browser/tsconfig.json | 11 + hw-sign-browser/tsconfig.node.json | 19 + hw-sign-browser/vite.config.ts | 18 + hw-sign-go/go.mod | 7 + hw-sign-go/go.sum | 6 + hw-sign-go/main.go | 1819 +++++++++++ hw-sign-go/main_test.go | 470 +++ hw-sign-test/hw_sign_mock.py | 543 ++++ hw-sign-win/.gitignore | 1 + hw-sign-win/CMakeLists.txt | 43 + hw-sign-win/main.cpp | 1426 ++++++++ hw-sign-win/preload.cmake | 1 + hw-sign-win/vcpkg.json | 9 + 84 files changed, 12608 insertions(+), 2 deletions(-) create mode 100644 .gitmodules create mode 100644 LICENSE create mode 100644 hw-sign-android/.gitignore create mode 100644 hw-sign-android/app/.gitignore create mode 100644 hw-sign-android/app/build.gradle.kts create mode 100644 hw-sign-android/app/proguard-rules.pro create mode 100644 hw-sign-android/app/src/androidTest/java/fan/ovo/hwsign/ExampleInstrumentedTest.kt create mode 100644 hw-sign-android/app/src/main/AndroidManifest.xml create mode 100644 hw-sign-android/app/src/main/java/fan/ovo/hwsign/AuthService.kt create mode 100644 hw-sign-android/app/src/main/java/fan/ovo/hwsign/KeyManager.kt create mode 100644 hw-sign-android/app/src/main/java/fan/ovo/hwsign/MainActivity.kt create mode 100644 hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Color.kt create mode 100644 hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Theme.kt create mode 100644 hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Type.kt create mode 100644 hw-sign-android/app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 hw-sign-android/app/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 hw-sign-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 hw-sign-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 hw-sign-android/app/src/main/res/mipmap-hdpi/ic_launcher.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-mdpi/ic_launcher.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-xhdpi/ic_launcher.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp create mode 100644 hw-sign-android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp create mode 100644 hw-sign-android/app/src/main/res/values/colors.xml create mode 100644 hw-sign-android/app/src/main/res/values/strings.xml create mode 100644 hw-sign-android/app/src/main/res/values/themes.xml create mode 100644 hw-sign-android/app/src/main/res/xml/backup_rules.xml create mode 100644 hw-sign-android/app/src/main/res/xml/data_extraction_rules.xml create mode 100644 hw-sign-android/app/src/test/java/fan/ovo/hwsign/ExampleUnitTest.kt create mode 100644 hw-sign-android/build.gradle.kts create mode 100644 hw-sign-android/build/reports/problems/problems-report.html create mode 100644 hw-sign-android/gradle.properties create mode 100644 hw-sign-android/gradle/libs.versions.toml create mode 100644 hw-sign-android/gradle/wrapper/gradle-wrapper.jar create mode 100644 hw-sign-android/gradle/wrapper/gradle-wrapper.properties create mode 100644 hw-sign-android/gradlew create mode 100644 hw-sign-android/gradlew.bat create mode 100644 hw-sign-android/settings.gradle.kts create mode 100644 hw-sign-apple/hw-sign-apple.xcodeproj/project.pbxproj create mode 100644 hw-sign-apple/hw-sign-apple.xcodeproj/project.xcworkspace/contents.xcworkspacedata create mode 100644 hw-sign-apple/hw-sign-apple/App.swift create mode 100644 hw-sign-apple/hw-sign-apple/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 hw-sign-apple/hw-sign-apple/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 hw-sign-apple/hw-sign-apple/Assets.xcassets/Contents.json create mode 100644 hw-sign-apple/hw-sign-apple/ContentView.swift create mode 100644 hw-sign-apple/hw-sign-apple/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 hw-sign-apple/hw-sign-apple/Services/AuthService.swift create mode 100644 hw-sign-apple/hw-sign-apple/Services/KeyManager.swift create mode 100644 hw-sign-apple/hw-sign-apple/hw_sign_apple.entitlements create mode 100644 hw-sign-browser/.gitignore create mode 100644 hw-sign-browser/README.md create mode 100644 hw-sign-browser/env.d.ts create mode 100644 hw-sign-browser/index.html create mode 100644 hw-sign-browser/package.json create mode 100644 hw-sign-browser/pnpm-lock.yaml create mode 100644 hw-sign-browser/postcss.config.js create mode 100644 hw-sign-browser/public/favicon.ico create mode 100644 hw-sign-browser/src/App.vue create mode 100644 hw-sign-browser/src/assets/base.css create mode 100644 hw-sign-browser/src/assets/logo.svg create mode 100644 hw-sign-browser/src/assets/main.css create mode 100644 hw-sign-browser/src/main.ts create mode 100644 hw-sign-browser/src/services/authService.ts create mode 100644 hw-sign-browser/tailwind.config.js create mode 100644 hw-sign-browser/tsconfig.app.json create mode 100644 hw-sign-browser/tsconfig.json create mode 100644 hw-sign-browser/tsconfig.node.json create mode 100644 hw-sign-browser/vite.config.ts create mode 100644 hw-sign-go/go.mod create mode 100644 hw-sign-go/go.sum create mode 100644 hw-sign-go/main.go create mode 100644 hw-sign-go/main_test.go create mode 100644 hw-sign-test/hw_sign_mock.py create mode 100644 hw-sign-win/.gitignore create mode 100644 hw-sign-win/CMakeLists.txt create mode 100644 hw-sign-win/main.cpp create mode 100644 hw-sign-win/preload.cmake create mode 100644 hw-sign-win/vcpkg.json diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e75a603 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "hw-sign-win/TSS.MSR"] + path = hw-sign-win/TSS.MSR + url = https://github.com/reitowo/TSS.MSR.git \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + 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 +. diff --git a/README.md b/README.md index 57c94c1..5ce7123 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,190 @@ -# hw-sign +# Hardware-Bound Authentication System -Colon from: https://github.com/reitowo/hw-sign \ No newline at end of file +Minimum Prototype Verification + +## Overview + +Binding login sessions to a pair of asymmetric keys in the device's hardware security module that cannot be exported, fundamentally preventing token theft or unauthorized use on other devices. + +## Design + +### Hardware Key Binding +- Hardware security module directly generates key pairs, private key cannot be exported +- Each request is verified through signatures + +### Fallback Mechanism +Hardware binding is preferred, but when hardware security is unavailable, the system will degrade: +- Windows: System version too old, TPM doesn't exist or is disabled in BIOS +- Android: System version too old, neither TEE nor StrongBox exists + +In these cases, login state is not protected by hardware keys, but normal usage is not affected + +### Decoupled Process +- Agnostic to login state implementation, such as Cookies or various application Token systems +- Separated from login flow, which can use more secure authentication like WebAuthn + +## Technical Implementation + +### Key Architecture + +#### Hardware Keys (Device Binding) +- Non-extractable cryptographic key pairs stored in hardware +- New key generated for each login session +- Dedicated to signing temporary keys +- Associated with login state, not user accounts + +#### Temporary Keys (Memory-Only) +- Cryptographic key pairs stored only in memory to improve performance +- Signed by hardware keys to verify authenticity +- Used for regular API request signatures or ECDH key negotiation +- Supports rotation and regeneration (app restart/session expiry) + +### Algorithm Priority and Format Requirements + +#### Hardware Key Type Priority +1. ED25519 +2. ECDSA (P-256) (secp256r1) - identified as `ecdsa-p256` +3. RSA-PSS (2048) - identified as `rsa-2048` + +#### Temporary Key Type Priority +1. ECDH (P-256) - identified as `ecdh-p256` (for key negotiation) +2. ECDSA (P-256) - identified as `ecdsa-p256` +3. RSA-PSS (2048) - identified as `rsa-2048` + +### Platform-Specific Implementation + +#### Browser (Web Crypto API) +- Uses SubtleCrypto API +- IndexedDB-based key reference storage (non-exportable) + +Example implementation: `hw-sign-browser/src/services/authService.ts` + +#### Windows (CNG/NCrypt) +- Uses Windows CryptoNG (NCrypt) API +- TPM-based key storage + +Example implementation: `hw-sign-win/main.cpp` + +#### Apple (Secure Enclave) +- Uses SecKey API +- Secure Enclave-based key storage + +Example implementation: `hw-sign-apple/hw-sign-apple/Services/AuthService.swift` + +#### Android (Keystore) +- Uses Android Keystore API +- TEE / StrongBox-based key storage + +Example implementation: `hw-sign-android/app/src/main/java/fan/ovo/hwsign/AuthService.kt` + +### Example API Protocol Specification + +#### Authentication Flow + +1. Registration (POST /register) + - Standard user registration, without hardware binding + ```json + { + "username": "string", + "password": "string" + } + ``` + +2. Hardware-Bound Login (POST /login) + - Request Headers: + - `x-rpc-sec-bound-token-hw-pub`: Hardware public key (base64 encoded) + - `x-rpc-sec-bound-token-hw-pub-type`: Key algorithm ("ecdsa-p256", "rsa-2048") + - Request Body: + ```json + { + "username": "string", + "password": "string" + } + ``` + - Response: + ```json + { + "token": "string" + } + ``` + +3. Authenticated API Request (GET /authenticated) + Common Request Headers: + - `Authorization: Bearer ` + - `x-rpc-sec-bound-token-data`: Timestamp+RandomHex string + - `x-rpc-sec-bound-token-data-sig`: Request signature + + For New Temporary Keys: + - `x-rpc-sec-bound-token-accel-pub`: Temporary public key + - `x-rpc-sec-bound-token-accel-pub-type`: Key algorithm type + - `x-rpc-sec-bound-token-accel-pub-sig`: Hardware-signed temporary key + + New Temporary Key Response Headers: + - `x-rpc-sec-bound-token-accel-pub-id`: Temporary key ID + - `x-rpc-sec-bound-token-accel-pub-expire`: Expiration as Unix timestamp in seconds + + For Existing Keys: + - `x-rpc-sec-bound-token-accel-pub-id`: Temporary key ID + +### Request Signatures + +Format for `x-rpc-sec-bound-token-data` is `{Timestamp}-{32BytesRandomHex}`, ordered by security from high to low: + +1. Random String with Redis + - Signs random nonce + - Stored in Redis to prevent replay attacks + - Best security, requires Redis + - Server uses each value only once, repeated use considered invalid + - Server rejects requests where Timestamp < Now - TExpire + +2. Request Body Hash + - Signs SHA256 hash of request body + - No additional storage needed + - Requires access to original request body (may not apply to gRPC interfaces) + +3. Timestamp + - Signs current timestamp + - Sets short expiration window + - Simplest, slightly lower security + +### Performance Optimization - ECDH Key Negotiation + +For performance-sensitive scenarios, ECDH-negotiated shared keys with HMAC-SHA256 for high-performance signatures: + +1. Initialization Process: + - SDK generates temporary key pair (CliTmpPub/CliTmpPriv) during initialization + - Hardware private key signs CliTmpPub (only once) + - No need for hardware signing again during this program execution + +2. Request Signature Process: + - On first request, server generates temporary key pair (SrvTmpPub/SrvTmpPriv) + - Server uses CliTmpPub+SrvTmpPriv to generate shared key HmacSecret via ECDH + - Client uses SrvTmpPub+CliTmpPriv to generate the same HmacSecret via ECDH + - Subsequent requests use HmacSecret to calculate HMAC-SHA256 signatures for better performance + +#### Reference Parameters + +When generating new temporary negotiation key pairs: +- `x-rpc-sec-bound-token-accel-pub`: Client temporary negotiation public key +- `x-rpc-sec-bound-token-accel-pub-type`: Client temporary negotiation public key type: `ecdh-p256` +- `x-rpc-sec-bound-token-accel-pub-sig`: Signature of client temporary negotiation public key generated with hardware key + +When server returns new temporary negotiation public key: +- `x-rpc-sec-bound-token-accel-pub`: Server temporary negotiation public key +- `x-rpc-sec-bound-token-accel-pub-id`: Temporary negotiation public key ID, pointing to the negotiated symmetric key +- `x-rpc-sec-bound-token-accel-pub-expire`: Expiration Unix timestamp in seconds + +Signature parameters in requests: +- `x-rpc-sec-bound-token-data`: Format is `{Timestamp}-{32BytesRandomHex}` +- `x-rpc-sec-bound-token-data-sig`: HMAC calculated with negotiated symmetric key on the above data +- `x-rpc-sec-bound-token-accel-pub-id`: Temporary public key ID + +## Examples + +All subfolders correspond to example implementations for each platform and can be directly opened as projects for compilation + +## Compare to DBSC (Device Bound Session Credentials) + +DBSC is also a cool solution with similar ideas. However, it is designed for Web Platform, and this repo use native abilities for all platforms. DBSC also doesn't sign all requests with hardware crypto keypairs, while this one will sign all requests. + +> Note: Over 90% of the code was generated with AI assistance, but human verification ensures correctness diff --git a/hw-sign-android/.gitignore b/hw-sign-android/.gitignore new file mode 100644 index 0000000..48c55ae --- /dev/null +++ b/hw-sign-android/.gitignore @@ -0,0 +1,3 @@ +.gradle/ +.kotlin/ +local.properties diff --git a/hw-sign-android/app/.gitignore b/hw-sign-android/app/.gitignore new file mode 100644 index 0000000..42afabf --- /dev/null +++ b/hw-sign-android/app/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/hw-sign-android/app/build.gradle.kts b/hw-sign-android/app/build.gradle.kts new file mode 100644 index 0000000..5b76054 --- /dev/null +++ b/hw-sign-android/app/build.gradle.kts @@ -0,0 +1,61 @@ +plugins { + alias(libs.plugins.android.application) + alias(libs.plugins.kotlin.android) + alias(libs.plugins.kotlin.compose) +} + +android { + namespace = "fan.ovo.hwsign" + compileSdk = 35 + + defaultConfig { + applicationId = "fan.ovo.hwsign" + minSdk = 29 + targetSdk = 35 + versionCode = 1 + versionName = "1.0" + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 + } + kotlinOptions { + jvmTarget = "11" + } + buildFeatures { + compose = true + } +} + +dependencies { + implementation(libs.androidx.core.ktx) + implementation(libs.androidx.lifecycle.runtime.ktx) + implementation(libs.androidx.activity.compose) + implementation(platform(libs.androidx.compose.bom)) + implementation(libs.androidx.ui) + implementation(libs.androidx.ui.graphics) + implementation(libs.androidx.ui.tooling.preview) + implementation(libs.androidx.material3) + implementation("androidx.security:security-crypto:1.1.0-alpha06") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4") + implementation("com.squareup.okhttp3:okhttp:4.12.0") + testImplementation(libs.junit) + androidTestImplementation(libs.androidx.junit) + androidTestImplementation(libs.androidx.espresso.core) + androidTestImplementation(platform(libs.androidx.compose.bom)) + androidTestImplementation(libs.androidx.ui.test.junit4) + debugImplementation(libs.androidx.ui.tooling) + debugImplementation(libs.androidx.ui.test.manifest) +} \ No newline at end of file diff --git a/hw-sign-android/app/proguard-rules.pro b/hw-sign-android/app/proguard-rules.pro new file mode 100644 index 0000000..481bb43 --- /dev/null +++ b/hw-sign-android/app/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/hw-sign-android/app/src/androidTest/java/fan/ovo/hwsign/ExampleInstrumentedTest.kt b/hw-sign-android/app/src/androidTest/java/fan/ovo/hwsign/ExampleInstrumentedTest.kt new file mode 100644 index 0000000..0f6ddd0 --- /dev/null +++ b/hw-sign-android/app/src/androidTest/java/fan/ovo/hwsign/ExampleInstrumentedTest.kt @@ -0,0 +1,24 @@ +package fan.ovo.hwsign + +import androidx.test.platform.app.InstrumentationRegistry +import androidx.test.ext.junit.runners.AndroidJUnit4 + +import org.junit.Test +import org.junit.runner.RunWith + +import org.junit.Assert.* + +/** + * Instrumented test, which will execute on an Android device. + * + * See [testing documentation](http://d.android.com/tools/testing). + */ +@RunWith(AndroidJUnit4::class) +class ExampleInstrumentedTest { + @Test + fun useAppContext() { + // Context of the app under test. + val appContext = InstrumentationRegistry.getInstrumentation().targetContext + assertEquals("fan.ovo.hwsign", appContext.packageName) + } +} \ No newline at end of file diff --git a/hw-sign-android/app/src/main/AndroidManifest.xml b/hw-sign-android/app/src/main/AndroidManifest.xml new file mode 100644 index 0000000..ff5c7d6 --- /dev/null +++ b/hw-sign-android/app/src/main/AndroidManifest.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hw-sign-android/app/src/main/java/fan/ovo/hwsign/AuthService.kt b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/AuthService.kt new file mode 100644 index 0000000..8df285b --- /dev/null +++ b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/AuthService.kt @@ -0,0 +1,212 @@ +package fan.ovo.hwsign + +import android.content.Context +import androidx.core.content.edit +import androidx.security.crypto.EncryptedSharedPreferences +import androidx.security.crypto.MasterKey +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import okhttp3.* +import okhttp3.MediaType.Companion.toMediaType +import okhttp3.RequestBody.Companion.toRequestBody +import org.json.JSONObject +import java.io.IOException +import java.util.Base64 +import java.util.concurrent.TimeUnit +import kotlin.coroutines.resume +import kotlin.coroutines.resumeWithException +import kotlin.coroutines.suspendCoroutine + +class AuthService(private val context: Context) { + // Constants + private val baseUrl = "https://dbcs-api.ovo.fan" + private val jsonContentType = "application/json; charset=utf-8".toMediaType() + private val keyAuthToken = "auth_token" + + // Key management + public val keyManager = KeyManager(context) + + // Lazy initialization for network client + private val client by lazy { + OkHttpClient.Builder() + .connectTimeout(30, TimeUnit.SECONDS) + .readTimeout(30, TimeUnit.SECONDS) + .build() + } + + private val sharedPreferences by lazy { + EncryptedSharedPreferences.create( + context, + "auth_prefs", + MasterKey.Builder(context) + .setKeyScheme(MasterKey.KeyScheme.AES256_GCM) + .build(), + EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, + EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM + ) + } + + /** + * Store and retrieve auth token from encrypted preferences + */ + private fun storeAuthToken(token: String) = + sharedPreferences.edit { putString(keyAuthToken, token) } + + private fun getAuthToken(): String? = + sharedPreferences.getString(keyAuthToken, null) + + /** + * Register a new user + */ + suspend fun register(username: String, password: String): Boolean = + withContext(Dispatchers.IO) { + try { + val json = JSONObject().apply { + put("username", username) + put("password", password) + } + + val requestBody = json.toString().toRequestBody(jsonContentType) + val request = Request.Builder() + .url("$baseUrl/register") + .post(requestBody) + .build() + + val response = client.newCall(request).await() + + if (response.isSuccessful) { + response.body?.string()?.let { body -> + val jsonResponse = JSONObject(body) + return@withContext jsonResponse.optString("message", "").isNotEmpty() + } + } + false + } catch (e: Exception) { + e.printStackTrace() + false + } + } + + /** + * Login using username/password and register hardware key + */ + suspend fun login(username: String, password: String): Boolean = + withContext(Dispatchers.IO) { + try { + // Generate new hardware key + val keyPair = keyManager.generateHardwareKey() + val publicKey = Base64.getEncoder().encodeToString(keyPair.public.encoded) + + val json = JSONObject().apply { + put("username", username) + put("password", password) + } + + val requestBody = json.toString().toRequestBody(jsonContentType) + val request = Request.Builder() + .url("$baseUrl/login") + .header("x-rpc-sec-bound-token-hw-pub", publicKey) + .header("x-rpc-sec-bound-token-hw-pub-type", "ecdsa") + .post(requestBody) + .build() + + val response = client.newCall(request).await() + + if (response.isSuccessful) { + response.body?.string()?.let { body -> + val jsonResponse = JSONObject(body) + val token = jsonResponse.optString("token", "") + if (token.isNotEmpty()) { + storeAuthToken(token) + // Clear any existing acceleration resources + keyManager.clearAccelKeyId() + return@withContext true + } + } + } + false + } catch (e: Exception) { + e.printStackTrace() + false + } + } + + /** + * Check authentication status and manage acceleration keys + */ + suspend fun checkAuthentication(): Boolean = withContext(Dispatchers.IO) { + val token = getAuthToken() ?: return@withContext false + val timestamp = System.currentTimeMillis().toString() + + try { + val accelKeyId = keyManager.getAccelKeyId() + val requestBuilder = Request.Builder() + .url("$baseUrl/authenticated") + .header("Authorization", "Bearer $token") + .header("x-rpc-sec-bound-token-data", timestamp) + + if (accelKeyId != null) { + // Use existing acceleration key + val keyPair = keyManager.getOrCreateAccelerationKey() + val signature = keyManager.signWithKey(keyPair, timestamp) + + requestBuilder + .header("x-rpc-sec-bound-token-data-sig", signature) + .header("x-rpc-sec-bound-token-accel-pub-id", accelKeyId) + } else { + // Generate a new acceleration key + val keyPair = keyManager.generateAccelerationKey() + + val accelPubKey = Base64.getEncoder().encodeToString(keyPair.public.encoded) + val accelPubKeySig = keyManager.signWithHardwareKey(accelPubKey) + val signature = keyManager.signWithKey(keyPair, timestamp) + + requestBuilder + .header("x-rpc-sec-bound-token-accel-pub", accelPubKey) + .header("x-rpc-sec-bound-token-accel-pub-type", "ecdsa") + .header("x-rpc-sec-bound-token-accel-pub-sig", accelPubKeySig) + .header("x-rpc-sec-bound-token-data-sig", signature) + } + + val request = requestBuilder.get().build() + val response = client.newCall(request).await() + + if (response.isSuccessful) { + // Save acceleration key ID if this was a new key registration + response.header("x-rpc-sec-bound-token-accel-pub-id")?.let { newId -> + keyManager.storeAccelKeyId(newId) + } + return@withContext true + } + false + } catch (e: Exception) { + e.printStackTrace() + false + } + } + + /** + * Clear all stored credentials and keys + */ + fun logout() { + sharedPreferences.edit { + remove(keyAuthToken) + } + keyManager.clearKeys() + } + + /** + * Extension function to simplify OkHttp async calls + */ + private suspend fun Call.await(): Response = suspendCoroutine { continuation -> + this.enqueue(object : Callback { + override fun onResponse(call: Call, response: Response) { + continuation.resume(response) + } + + override fun onFailure(call: Call, e: IOException) { + continuation.resumeWithException(e) + } + }) + } +} diff --git a/hw-sign-android/app/src/main/java/fan/ovo/hwsign/KeyManager.kt b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/KeyManager.kt new file mode 100644 index 0000000..5bb0e82 --- /dev/null +++ b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/KeyManager.kt @@ -0,0 +1,214 @@ +package fan.ovo.hwsign + +import android.annotation.SuppressLint +import android.content.Context +import android.os.Build +import android.security.keystore.KeyGenParameterSpec +import android.security.keystore.KeyProperties +import android.security.keystore.KeyInfo +import android.util.Log +import androidx.core.content.edit +import androidx.security.crypto.EncryptedSharedPreferences +import androidx.security.crypto.MasterKey +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext +import java.security.KeyFactory +import java.security.KeyPair +import java.security.KeyPairGenerator +import java.security.KeyStore +import java.security.PrivateKey +import java.security.Signature +import java.security.spec.ECGenParameterSpec +import java.util.Base64 + +/** + * Manages cryptographic keys for hardware-backed authentication + */ +class KeyManager(private val context: Context) { + + // Constants + private val keyAlias = "hw_sign_hardware_key" + private val keyAccelId = "accel_key_id" + + // Cache for acceleration keys + private var accelerationKeyPair: KeyPair? = null + + private val keystore by lazy { + KeyStore.getInstance("AndroidKeyStore").apply { load(null) } + } + + private val sharedPreferences by lazy { + EncryptedSharedPreferences.create( + context, + "auth_prefs", + MasterKey.Builder(context) + .setKeyScheme(MasterKey.KeyScheme.AES256_GCM) + .build(), + EncryptedSharedPreferences.PrefKeyEncryptionScheme.AES256_SIV, + EncryptedSharedPreferences.PrefValueEncryptionScheme.AES256_GCM + ) + } + + /** + * Check the security level of the hardware key + */ + @SuppressLint("SwitchIntDef") + fun getKeySecurityLevel(): String { + return try { + val privateKey = keystore.getKey(keyAlias, null) as PrivateKey + val keyFactory = KeyFactory.getInstance(privateKey.algorithm, "AndroidKeyStore") + val keyInfo = keyFactory.getKeySpec(privateKey, KeyInfo::class.java) as KeyInfo + + // Acceptable value: StrongBox, TEE, SecureHardware. + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) { + when (keyInfo.securityLevel) { + KeyProperties.SECURITY_LEVEL_STRONGBOX -> "StrongBox" + KeyProperties.SECURITY_LEVEL_TRUSTED_ENVIRONMENT -> "TEE" + KeyProperties.SECURITY_LEVEL_UNKNOWN_SECURE -> "UnknownSecure" + KeyProperties.SECURITY_LEVEL_SOFTWARE -> "Software" + KeyProperties.SECURITY_LEVEL_UNKNOWN -> "Unknown" + else -> "Unknown" + } + } else { + if (keyInfo.isInsideSecureHardware) { + "SecureHardware" + } else { + "Insecure" + } + } + } catch (e: Exception) { + e.printStackTrace() + "Unknown" + } + } + + /** + * Generate a hardware-backed key pair using AndroidKeyStore + * Attempts to use StrongBox if available, falls back to TEE + */ + suspend fun generateHardwareKey(): KeyPair = withContext(Dispatchers.IO) { + // Delete any existing key + if (keystore.containsAlias(keyAlias)) { + keystore.deleteEntry(keyAlias) + } + + val keyPairGenerator = KeyPairGenerator.getInstance( + KeyProperties.KEY_ALGORITHM_EC, "AndroidKeyStore" + ) + + val builder = KeyGenParameterSpec.Builder( + keyAlias, KeyProperties.PURPOSE_SIGN or KeyProperties.PURPOSE_VERIFY + ).apply { + setDigests(KeyProperties.DIGEST_SHA256) + setUserAuthenticationRequired(false) + setUnlockedDeviceRequired(true) + } + + var keyPair: KeyPair + // First try StrongBox if available (API 28+) + try { + builder.setIsStrongBoxBacked(true) + keyPairGenerator.initialize(builder.build()) + keyPair = keyPairGenerator.generateKeyPair() + } catch (e: Exception) { + // Initialize with TEE fallback + builder.setIsStrongBoxBacked(false) + keyPairGenerator.initialize(builder.build()) + keyPair = keyPairGenerator.generateKeyPair() + } + + val keyLevel = getKeySecurityLevel() + Log.i(null, "successfully generated key pair in $keyLevel") + keyPair + } + + /** + * Retrieve the existing hardware key pair from the Android KeyStore + */ + private fun getHardwareKeyPair(): KeyPair? = try { + if (keystore.containsAlias(keyAlias)) { + val privateKey = keystore.getKey(keyAlias, null) as PrivateKey + val publicKey = keystore.getCertificate(keyAlias).publicKey + KeyPair(publicKey, privateKey) + } else { + null + } + } catch (e: Exception) { + e.printStackTrace() + null + } + + /** + * Store and retrieve acceleration key ID + */ + fun storeAccelKeyId(keyId: String) { + sharedPreferences.edit { putString(keyAccelId, keyId) } + } + + fun getAccelKeyId(): String? = + sharedPreferences.getString(keyAccelId, null) + + fun clearAccelKeyId() { + sharedPreferences.edit { remove(keyAccelId) } + } + + /** + * Sign data using the hardware key + */ + suspend fun signWithHardwareKey(data: String): String = withContext(Dispatchers.IO) { + val keyPair = getHardwareKeyPair() ?: throw SecurityException("Hardware key not found") + + val signature = Signature.getInstance("SHA256withECDSA").apply { + initSign(keyPair.private) + update(data.toByteArray()) + } + + Base64.getEncoder().encodeToString(signature.sign()) + } + + /** + * Generate an acceleration key pair in memory + */ + fun generateAccelerationKey(): KeyPair { + val keyPair = KeyPairGenerator.getInstance("EC").apply { + initialize(ECGenParameterSpec("secp256r1")) + }.generateKeyPair() + + accelerationKeyPair = keyPair + return keyPair + } + + /** + * Get the cached acceleration key pair or generate a new one + */ + fun getOrCreateAccelerationKey(): KeyPair { + return accelerationKeyPair ?: generateAccelerationKey() + } + + /** + * Sign data with a specific key pair + */ + fun signWithKey(keyPair: KeyPair, data: String): String { + val signature = Signature.getInstance("SHA256withECDSA").apply { + initSign(keyPair.private) + update(data.toByteArray()) + } + return Base64.getEncoder().encodeToString(signature.sign()) + } + + /** + * Clear stored keys and identifiers + */ + fun clearKeys() { + accelerationKeyPair = null + clearAccelKeyId() + + try { + if (keystore.containsAlias(keyAlias)) { + keystore.deleteEntry(keyAlias) + } + } catch (e: Exception) { + e.printStackTrace() + } + } +} diff --git a/hw-sign-android/app/src/main/java/fan/ovo/hwsign/MainActivity.kt b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/MainActivity.kt new file mode 100644 index 0000000..252acb2 --- /dev/null +++ b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/MainActivity.kt @@ -0,0 +1,115 @@ +package fan.ovo.hwsign + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.material3.Button +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.OutlinedTextField +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.runtime.* +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.tooling.preview.Preview +import androidx.compose.ui.unit.dp +import androidx.lifecycle.lifecycleScope +import kotlinx.coroutines.launch +import fan.ovo.hwsign.ui.theme.DbcsTheme + +class MainActivity : ComponentActivity() { + private lateinit var authService: AuthService + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + authService = AuthService(this) + + setContent { + DbcsTheme { + Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding -> + var username by remember { mutableStateOf("") } + var password by remember { mutableStateOf("") } + var message by remember { mutableStateOf("") } + var securityLevel by remember { mutableStateOf("Unknown") } + + Column( + modifier = Modifier + .padding(innerPadding) + .fillMaxSize() + .padding(16.dp), + verticalArrangement = Arrangement.Center, + horizontalAlignment = Alignment.CenterHorizontally + ) { + OutlinedTextField( + value = username, + onValueChange = { username = it }, + label = { Text("Username") }, + modifier = Modifier.fillMaxWidth() + ) + Spacer(modifier = Modifier.height(8.dp)) + OutlinedTextField( + value = password, + onValueChange = { password = it }, + label = { Text("Password") }, + modifier = Modifier.fillMaxWidth() + ) + Spacer(modifier = Modifier.height(16.dp)) + Button(onClick = { + lifecycleScope.launch { + val success = authService.login(username, password) + message = if (success) "Login successful!" else "Login failed." + securityLevel = authService.keyManager.getKeySecurityLevel() + } + }) { + Text("Login") + } + Spacer(modifier = Modifier.height(8.dp)) + Button(onClick = { + lifecycleScope.launch { + val success = authService.register(username, password) + message = if (success) "Registration successful!" else "Registration failed." + } + }) { + Text("Register") + } + Spacer(modifier = Modifier.height(8.dp)) + Button(onClick = { + lifecycleScope.launch { + val isAuthenticated = authService.checkAuthentication() + message = if (isAuthenticated) "Authenticated!" else "Not authenticated." + } + }) { + Text("Check Auth") + } + Spacer(modifier = Modifier.height(16.dp)) + Text("Security Level: $securityLevel", style = MaterialTheme.typography.bodyLarge) + Spacer(modifier = Modifier.height(16.dp)) + Text(message) + } + } + } + } + } +} + +@Composable +fun Greeting(name: String, modifier: Modifier = Modifier) { + Text( + text = "Hello $name!", + style = MaterialTheme.typography.titleLarge, + modifier = modifier + ) +} + +@Preview(showBackground = true) +@Composable +fun GreetingPreview() { + DbcsTheme { + Greeting("DBCS") + } +} \ No newline at end of file diff --git a/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Color.kt b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Color.kt new file mode 100644 index 0000000..2694984 --- /dev/null +++ b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Color.kt @@ -0,0 +1,11 @@ +package fan.ovo.hwsign.ui.theme + +import androidx.compose.ui.graphics.Color + +val Purple80 = Color(0xFFD0BCFF) +val PurpleGrey80 = Color(0xFFCCC2DC) +val Pink80 = Color(0xFFEFB8C8) + +val Purple40 = Color(0xFF6650a4) +val PurpleGrey40 = Color(0xFF625b71) +val Pink40 = Color(0xFF7D5260) \ No newline at end of file diff --git a/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Theme.kt b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Theme.kt new file mode 100644 index 0000000..de52e6e --- /dev/null +++ b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Theme.kt @@ -0,0 +1,58 @@ +package fan.ovo.hwsign.ui.theme + +import android.app.Activity +import android.os.Build +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.dynamicDarkColorScheme +import androidx.compose.material3.dynamicLightColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.ui.platform.LocalContext + +private val DarkColorScheme = darkColorScheme( + primary = Purple80, + secondary = PurpleGrey80, + tertiary = Pink80 +) + +private val LightColorScheme = lightColorScheme( + primary = Purple40, + secondary = PurpleGrey40, + tertiary = Pink40 + + /* Other default colors to override + background = Color(0xFFFFFBFE), + surface = Color(0xFFFFFBFE), + onPrimary = Color.White, + onSecondary = Color.White, + onTertiary = Color.White, + onBackground = Color(0xFF1C1B1F), + onSurface = Color(0xFF1C1B1F), + */ +) + +@Composable +fun DbcsTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = true, + content: @Composable () -> Unit +) { + val colorScheme = when { + dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { + val context = LocalContext.current + if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) + } + + darkTheme -> DarkColorScheme + else -> LightColorScheme + } + + MaterialTheme( + colorScheme = colorScheme, + typography = Typography, + content = content + ) +} \ No newline at end of file diff --git a/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Type.kt b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Type.kt new file mode 100644 index 0000000..4dcc570 --- /dev/null +++ b/hw-sign-android/app/src/main/java/fan/ovo/hwsign/ui/theme/Type.kt @@ -0,0 +1,25 @@ +package fan.ovo.hwsign.ui.theme + +import androidx.compose.material3.Typography +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +// Set of Material typography styles to start with +val Typography = Typography( + bodyLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Normal, + fontSize = 16.sp, + lineHeight = 24.sp, + letterSpacing = 0.5.sp + ), + titleLarge = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Bold, + fontSize = 22.sp, + lineHeight = 28.sp, + letterSpacing = 0.sp + ) +) \ No newline at end of file diff --git a/hw-sign-android/app/src/main/res/drawable/ic_launcher_background.xml b/hw-sign-android/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..07d5da9 --- /dev/null +++ b/hw-sign-android/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hw-sign-android/app/src/main/res/drawable/ic_launcher_foreground.xml b/hw-sign-android/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..2b068d1 --- /dev/null +++ b/hw-sign-android/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/hw-sign-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/hw-sign-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/hw-sign-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/hw-sign-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/hw-sign-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6f3b755 --- /dev/null +++ b/hw-sign-android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/hw-sign-android/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/hw-sign-android/app/src/main/res/mipmap-hdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..c209e78ecd372343283f4157dcfd918ec5165bb3 GIT binary patch literal 1404 zcmV-?1%vuhNk&F=1pok7MM6+kP&il$0000G0000-002h-06|PpNX!5L00Dqw+t%{r zzW2vH!KF=w&cMnnN@{whkTw+#mAh0SV?YL=)3MimFYCWp#fpdtz~8$hD5VPuQgtcN zXl<@<#Cme5f5yr2h%@8TWh?)bSK`O z^Z@d={gn7J{iyxL_y_%J|L>ep{dUxUP8a{byupH&!UNR*OutO~0{*T4q5R6@ApLF! z5{w?Z150gC7#>(VHFJZ-^6O@PYp{t!jH(_Z*nzTK4 zkc{fLE4Q3|mA2`CWQ3{8;gxGizgM!zccbdQoOLZc8hThi-IhN90RFT|zlxh3Ty&VG z?Fe{#9RrRnxzsu|Lg2ddugg7k%>0JeD+{XZ7>Z~{=|M+sh1MF7~ zz>To~`~LVQe1nNoR-gEzkpe{Ak^7{{ZBk2i_<+`Bq<^GB!RYG+z)h;Y3+<{zlMUYd zrd*W4w&jZ0%kBuDZ1EW&KLpyR7r2=}fF2%0VwHM4pUs}ZI2egi#DRMYZPek*^H9YK zay4Iy3WXFG(F14xYsoDA|KXgGc5%2DhmQ1gFCkrgHBm!lXG8I5h*uf{rn48Z!_@ z4Bk6TJAB2CKYqPjiX&mWoW>OPFGd$wqroa($ne7EUK;#3VYkXaew%Kh^3OrMhtjYN?XEoY`tRPQsAkH-DSL^QqyN0>^ zmC>{#F14jz4GeW{pJoRpLFa_*GI{?T93^rX7SPQgT@LbLqpNA}<@2wH;q493)G=1Y z#-sCiRNX~qf3KgiFzB3I>4Z%AfS(3$`-aMIBU+6?gbgDb!)L~A)je+;fR0jWLL-Fu z4)P{c7{B4Hp91&%??2$v9iRSFnuckHUm}or9seH6 z>%NbT+5*@L5(I9j@06@(!{ZI?U0=pKn8uwIg&L{JV14+8s2hnvbRrU|hZCd}IJu7*;;ECgO%8_*W Kmw_-CKmY()leWbG literal 0 HcmV?d00001 diff --git a/hw-sign-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/hw-sign-android/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..b2dfe3d1ba5cf3ee31b3ecc1ced89044a1f3b7a9 GIT binary patch literal 2898 zcmV-Y3$650Nk&FW3jhFDMM6+kP&il$0000G0000-002h-06|PpNWB9900E$G+qN-D z+81ABX7q?;bwx%xBg?kcwr$(C-Tex-ZCkHU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207%xU0ssI2 literal 0 HcmV?d00001 diff --git a/hw-sign-android/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/hw-sign-android/app/src/main/res/mipmap-mdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..4f0f1d64e58ba64d180ce43ee13bf9a17835fbca GIT binary patch literal 982 zcmV;{11bDcNk&G_0{{S5MM6+kP&il$0000G0000l001ul06|PpNU8t;00Dqo+t#w^ z^1csucXz7-Qrhzl9HuHB%l>&>1tG2^vb*E&k^T3$FG1eQZ51g$uv4V+kI`0<^1Z@N zk?Jjh$olyC%l>)Xq;7!>{iBj&BjJ`P&$fsCfpve_epJOBkTF?nu-B7D!hO=2ZR}

C%4 zc_9eOXvPbC4kzU8YowIA8cW~Uv|eB&yYwAObSwL2vY~UYI7NXPvf3b+c^?wcs~_t{ ze_m66-0)^{JdOMKPwjpQ@Sna!*?$wTZ~su*tNv7o!gXT!GRgivP}ec?5>l1!7<(rT zds|8x(qGc673zrvYIz;J23FG{9nHMnAuP}NpAED^laz3mAN1sy+NXK)!6v1FxQ;lh zOBLA>$~P3r4b*NcqR;y6pwyhZ3_PiDb|%n1gGjl3ZU}ujInlP{eks-#oA6>rh&g+!f`hv#_%JrgYPu z(U^&XLW^QX7F9Z*SRPpQl{B%x)_AMp^}_v~?j7 zapvHMKxSf*Mtyx8I}-<*UGn3)oHd(nn=)BZ`d$lDBwq_GL($_TPaS{UeevT(AJ`p0 z9%+hQb6z)U9qjbuXjg|dExCLjpS8$VKQ55VsIC%@{N5t{NsW)=hNGI`J=x97_kbz@ E0Of=7!TQj4N+cqN`nQhxvX7dAV-`K|Ub$-q+H-5I?Tx0g9jWxd@A|?POE8`3b8fO$T))xP* z(X?&brZw({`)WU&rdAs1iTa0x6F@PIxJ&&L|dpySV!ID|iUhjCcKz(@mE z!x@~W#3H<)4Ae(4eQJRk`Iz3<1)6^m)0b_4_TRZ+cz#eD3f8V;2r-1fE!F}W zEi0MEkTTx}8i1{`l_6vo0(Vu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mipmap-xhdpi/ic_launcher.webp new file mode 100644 index 0000000000000000000000000000000000000000..948a3070fe34c611c42c0d3ad3013a0dce358be0 GIT binary patch literal 1900 zcmV-y2b1_xNk&Fw2LJ$9MM6+kP&il$0000G0001A003VA06|PpNH75a00DqwTbm-~ zullQTcXxO9ki!OCRx^i?oR|n!<8G0=kI^!JSjFi-LL*`V;ET0H2IXfU0*i>o6o6Gy zRq6Ap5(_{XLdXcL-MzlN`ugSdZY_`jXhcENAu)N_0?GhF))9R;E`!bo9p?g?SRgw_ zEXHhFG$0{qYOqhdX<(wE4N@es3VIo$%il%6xP9gjiBri+2pI6aY4 zJbgh-Ud|V%3O!IcHKQx1FQH(_*TK;1>FQWbt^$K1zNn^cczkBs=QHCYZ8b&l!UV{K z{L0$KCf_&KR^}&2Fe|L&?1I7~pBENnCtCuH3sjcx6$c zwqkNkru);ie``q+_QI;IYLD9OV0ZxkuyBz|5<$1BH|vtey$> z5oto4=l-R-Aaq`Dk0}o9N0VrkqW_#;!u{!bJLDq%0092{Ghe=F;(kn} z+sQ@1=UlX30+2nWjkL$B^b!H2^QYO@iFc0{(-~yXj2TWz?VG{v`Jg zg}WyYnwGgn>{HFaG7E~pt=)sOO}*yd(UU-D(E&x{xKEl6OcU?pl)K%#U$dn1mDF19 zSw@l8G!GNFB3c3VVK0?uyqN&utT-D5%NM4g-3@Sii9tSXKtwce~uF zS&Jn746EW^wV~8zdQ1XC28~kXu8+Yo9p!<8h&(Q({J*4DBglPdpe4M_mD8AguZFn~ ztiuO~{6Bx?SfO~_ZV(GIboeR9~hAym{{fV|VM=77MxDrbW6`ujX z<3HF(>Zr;#*uCvC*bpoSr~C$h?_%nXps@A)=l_;({Fo#6Y1+Zv`!T5HB+)#^-Ud_; zBwftPN=d8Vx)*O1Mj+0oO=mZ+NVH*ptNDC-&zZ7Hwho6UQ#l-yNvc0Cm+2$$6YUk2D2t#vdZX-u3>-Be1u9gtTBiMB^xwWQ_rgvGpZ6(C@e23c!^K=>ai-Rqu zhqT`ZQof;9Bu!AD(i^PCbYV%yha9zuoKMp`U^z;3!+&d@Hud&_iy!O-$b9ZLcSRh? z)R|826w}TU!J#X6P%@Zh=La$I6zXa#h!B;{qfug}O%z@K{EZECu6zl)7CiNi%xti0 zB{OKfAj83~iJvmpTU|&q1^?^cIMn2RQ?jeSB95l}{DrEPTW{_gmU_pqTc)h@4T>~& zluq3)GM=xa(#^VU5}@FNqpc$?#SbVsX!~RH*5p0p@w z;~v{QMX0^bFT1!cXGM8K9FP+=9~-d~#TK#ZE{4umGT=;dfvWi?rYj;^l_Zxywze`W z^Cr{55U@*BalS}K%Czii_80e0#0#Zkhlij4-~I@}`-JFJ7$5{>LnoJSs??J8kWVl6|8A}RCGAu9^rAsfCE=2}tHwl93t0C?#+jMpvr7O3`2=tr{Hg$=HlnjVG^ewm|Js0J*kfPa6*GhtB>`fN!m#9J(sU!?(OSfzY*zS(FJ<-Vb zfAIg+`U)YaXv#sY(c--|X zEB+TVyZ%Ie4L$gi#Fc++`h6%vzsS$pjz9aLt+ZL(g;n$Dzy5=m=_TV(3H8^C{r0xd zp#a%}ht55dOq?yhwYPrtp-m1xXp;4X;)NhxxUpgP%XTLmO zcjaFva^}dP3$&sfFTIR_jC=2pHh9kpI@2(6V*GQo7Ws)`j)hd+tr@P~gR*2gO@+1? zG<`_tB+LJuF|SZ9tIec;h%}}6WClT`L>HSW?E{Hp1h^+mlbf_$9zA>!ug>NALJsO{ mU%z=YwVD?}XMya)Bp;vlyE5&E_6!fzx9pwrdz474!~g(M6R?N? literal 0 HcmV?d00001 diff --git a/hw-sign-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/hw-sign-android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp new file mode 100644 index 0000000000000000000000000000000000000000..1b9a6956b3acdc11f40ce2bb3f6efbd845cc243f GIT binary patch literal 3918 zcmV-U53%r4Nk&FS4*&pHMM6+kP&il$0000G0001A003VA06|PpNSy@$00HoY|G(*G z+qV7x14$d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|1+8hn8c2?P(l@;Rb&CsZeYoCI3?2!LqjbwPXW3z4G$Qfj=cT5Yb%vY0(AX oeb?AaKtwrnc|$|zzw9vfvn^aJJ!zd)XFXqqy0000001=f@-~a#s literal 0 HcmV?d00001 diff --git a/hw-sign-android/app/src/main/res/values/colors.xml b/hw-sign-android/app/src/main/res/values/colors.xml new file mode 100644 index 0000000..f8c6127 --- /dev/null +++ b/hw-sign-android/app/src/main/res/values/colors.xml @@ -0,0 +1,10 @@ + + + #FFBB86FC + #FF6200EE + #FF3700B3 + #FF03DAC5 + #FF018786 + #FF000000 + #FFFFFFFF + \ No newline at end of file diff --git a/hw-sign-android/app/src/main/res/values/strings.xml b/hw-sign-android/app/src/main/res/values/strings.xml new file mode 100644 index 0000000..5bb86af --- /dev/null +++ b/hw-sign-android/app/src/main/res/values/strings.xml @@ -0,0 +1,3 @@ + + dbcs + \ No newline at end of file diff --git a/hw-sign-android/app/src/main/res/values/themes.xml b/hw-sign-android/app/src/main/res/values/themes.xml new file mode 100644 index 0000000..4b074f9 --- /dev/null +++ b/hw-sign-android/app/src/main/res/values/themes.xml @@ -0,0 +1,5 @@ + + + + + + + + Gradle Configuration Cache + + + +

+ +
+ Loading... +
+ + + + + + diff --git a/hw-sign-android/gradle.properties b/hw-sign-android/gradle.properties new file mode 100644 index 0000000..20e2a01 --- /dev/null +++ b/hw-sign-android/gradle.properties @@ -0,0 +1,23 @@ +# Project-wide Gradle settings. +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. For more details, visit +# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects +# org.gradle.parallel=true +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Kotlin code style for this project: "official" or "obsolete": +kotlin.code.style=official +# Enables namespacing of each library's R class so that its R class includes only the +# resources declared in the library itself and none from the library's dependencies, +# thereby reducing the size of the R class for that library +android.nonTransitiveRClass=true \ No newline at end of file diff --git a/hw-sign-android/gradle/libs.versions.toml b/hw-sign-android/gradle/libs.versions.toml new file mode 100644 index 0000000..c5aa591 --- /dev/null +++ b/hw-sign-android/gradle/libs.versions.toml @@ -0,0 +1,39 @@ +[versions] +agp = "8.9.1" +json = "20210307" +kotlin = "2.0.21" +coreKtx = "1.10.1" +junit = "4.13.2" +junitVersion = "1.2.1" +espressoCore = "3.6.1" +lifecycleRuntimeKtx = "2.6.1" +activityCompose = "1.8.0" +composeBom = "2024.09.00" +okhttp = "4.9.3" +securityCryptoKtx = "1.0.0" + +[libraries] +androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" } +androidx-security-crypto = { module = "androidx.security:security-crypto" } +json = { module = "org.json:json", version.ref = "json" } +junit = { group = "junit", name = "junit", version.ref = "junit" } +androidx-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } +androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } +androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycleRuntimeKtx" } +androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } +androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" } +androidx-ui = { group = "androidx.compose.ui", name = "ui" } +androidx-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" } +androidx-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" } +androidx-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" } +androidx-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" } +androidx-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" } +androidx-material3 = { group = "androidx.compose.material3", name = "material3" } +androidx-security-crypto-ktx = { group = "androidx.security", name = "security-crypto-ktx", version.ref = "securityCryptoKtx" } +okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } + +[plugins] +android-application = { id = "com.android.application", version.ref = "agp" } +kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } +kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" } + diff --git a/hw-sign-android/gradle/wrapper/gradle-wrapper.jar b/hw-sign-android/gradle/wrapper/gradle-wrapper.jar new file mode 100644 index 0000000000000000000000000000000000000000..e708b1c023ec8b20f512888fe07c5bd3ff77bb8f GIT binary patch literal 59203 zcma&O1CT9Y(k9%tZQHhO+qUh#ZQHhO+qmuS+qP|E@9xZO?0h@l{(r>DQ>P;GjjD{w zH}lENr;dU&FbEU?00aa80D$0M0RRB{U*7-#kbjS|qAG&4l5%47zyJ#WrfA#1$1Ctx zf&Z_d{GW=lf^w2#qRJ|CvSJUi(^E3iv~=^Z(zH}F)3Z%V3`@+rNB7gTVU{Bb~90p|f+0(v;nz01EG7yDMX9@S~__vVgv%rS$+?IH+oZ03D5zYrv|^ zC1J)SruYHmCki$jLBlTaE5&dFG9-kq3!^i>^UQL`%gn6)jz54$WDmeYdsBE9;PqZ_ zoGd=P4+|(-u4U1dbAVQrFWoNgNd;0nrghPFbQrJctO>nwDdI`Q^i0XJDUYm|T|RWc zZ3^Qgo_Qk$%Fvjj-G}1NB#ZJqIkh;kX%V{THPqOyiq)d)0+(r9o(qKlSp*hmK#iIY zA^)Vr$-Hz<#SF=0@tL@;dCQsm`V9s1vYNq}K1B)!XSK?=I1)tX+bUV52$YQu*0%fnWEukW>mxkz+%3-S!oguE8u#MGzST8_Dy^#U?fA@S#K$S@9msUiX!gd_ow>08w5)nX{-KxqMOo7d?k2&?Vf z&diGDtZr(0c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<1D35C222I33?Njaz`On7 zi<+VWFP6D{e-{yiN#M|Jgk<44u1TiMI78S5W`Sdb5f+{zu34s{CfWN7a3Cf^@L%!& zN$?|!!9j2c)j$~+R6n#891w-z8(!oBpL2K=+%a$r2|~8-(vQj5_XT`<0Ksf;oP+tz z9CObS!0m)Tgg`K#xBM8B(|Z)Wb&DYL{WTYv`;A=q6~Nnx2+!lTIXtj8J7dZE!P_{z z#f8w6F}^!?^KE#+ZDv+xd5O&3EmomZzsv?>E-~ygGum45fk!SBN&|eo1rKw^?aZJ4 E2O(~oYXATM literal 0 HcmV?d00001 diff --git a/hw-sign-android/gradle/wrapper/gradle-wrapper.properties b/hw-sign-android/gradle/wrapper/gradle-wrapper.properties new file mode 100644 index 0000000..27bac8d --- /dev/null +++ b/hw-sign-android/gradle/wrapper/gradle-wrapper.properties @@ -0,0 +1,6 @@ +#Mon Mar 31 19:52:01 CST 2025 +distributionBase=GRADLE_USER_HOME +distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +zipStoreBase=GRADLE_USER_HOME +zipStorePath=wrapper/dists diff --git a/hw-sign-android/gradlew b/hw-sign-android/gradlew new file mode 100644 index 0000000..4f906e0 --- /dev/null +++ b/hw-sign-android/gradlew @@ -0,0 +1,185 @@ +#!/usr/bin/env sh + +# +# Copyright 2015 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +############################################################################## +## +## Gradle start up script for UN*X +## +############################################################################## + +# Attempt to set APP_HOME +# Resolve links: $0 may be a link +PRG="$0" +# Need this for relative symlinks. +while [ -h "$PRG" ] ; do + ls=`ls -ld "$PRG"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + PRG="$link" + else + PRG=`dirname "$PRG"`"/$link" + fi +done +SAVED="`pwd`" +cd "`dirname \"$PRG\"`/" >/dev/null +APP_HOME="`pwd -P`" +cd "$SAVED" >/dev/null + +APP_NAME="Gradle" +APP_BASE_NAME=`basename "$0"` + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' + +# Use the maximum available, or set MAX_FD != -1 to use that value. +MAX_FD="maximum" + +warn () { + echo "$*" +} + +die () { + echo + echo "$*" + echo + exit 1 +} + +# OS specific support (must be 'true' or 'false'). +cygwin=false +msys=false +darwin=false +nonstop=false +case "`uname`" in + CYGWIN* ) + cygwin=true + ;; + Darwin* ) + darwin=true + ;; + MINGW* ) + msys=true + ;; + NONSTOP* ) + nonstop=true + ;; +esac + +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + + +# Determine the Java command to use to start the JVM. +if [ -n "$JAVA_HOME" ] ; then + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then + # IBM's JDK on AIX uses strange locations for the executables + JAVACMD="$JAVA_HOME/jre/sh/java" + else + JAVACMD="$JAVA_HOME/bin/java" + fi + if [ ! -x "$JAVACMD" ] ; then + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." + fi +else + JAVACMD="java" + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + +Please set the JAVA_HOME variable in your environment to match the +location of your Java installation." +fi + +# Increase the maximum file descriptors if we can. +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then + MAX_FD_LIMIT=`ulimit -H -n` + if [ $? -eq 0 ] ; then + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then + MAX_FD="$MAX_FD_LIMIT" + fi + ulimit -n $MAX_FD + if [ $? -ne 0 ] ; then + warn "Could not set maximum file descriptor limit: $MAX_FD" + fi + else + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" + fi +fi + +# For Darwin, add options to specify how the application appears in the dock +if $darwin; then + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" +fi + +# For Cygwin or MSYS, switch paths to Windows format before running java +if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then + APP_HOME=`cygpath --path --mixed "$APP_HOME"` + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` + + JAVACMD=`cygpath --unix "$JAVACMD"` + + # We build the pattern for arguments to be converted via cygpath + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` + SEP="" + for dir in $ROOTDIRSRAW ; do + ROOTDIRS="$ROOTDIRS$SEP$dir" + SEP="|" + done + OURCYGPATTERN="(^($ROOTDIRS))" + # Add a user-defined pattern to the cygpath arguments + if [ "$GRADLE_CYGPATTERN" != "" ] ; then + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" + fi + # Now convert the arguments - kludge to limit ourselves to /bin/sh + i=0 + for arg in "$@" ; do + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option + + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` + else + eval `echo args$i`="\"$arg\"" + fi + i=`expr $i + 1` + done + case $i in + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + esac +fi + +# Escape application args +save () { + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done + echo " " +} +APP_ARGS=`save "$@"` + +# Collect all arguments for the java command, following the shell quoting and substitution rules +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" + +exec "$JAVACMD" "$@" diff --git a/hw-sign-android/gradlew.bat b/hw-sign-android/gradlew.bat new file mode 100644 index 0000000..107acd3 --- /dev/null +++ b/hw-sign-android/gradlew.bat @@ -0,0 +1,89 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + +@if "%DEBUG%" == "" @echo off +@rem ########################################################################## +@rem +@rem Gradle startup script for Windows +@rem +@rem ########################################################################## + +@rem Set local scope for the variables with windows NT shell +if "%OS%"=="Windows_NT" setlocal + +set DIRNAME=%~dp0 +if "%DIRNAME%" == "" set DIRNAME=. +set APP_BASE_NAME=%~n0 +set APP_HOME=%DIRNAME% + +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" + +@rem Find java.exe +if defined JAVA_HOME goto findJavaFromJavaHome + +set JAVA_EXE=java.exe +%JAVA_EXE% -version >NUL 2>&1 +if "%ERRORLEVEL%" == "0" goto execute + +echo. +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:findJavaFromJavaHome +set JAVA_HOME=%JAVA_HOME:"=% +set JAVA_EXE=%JAVA_HOME%/bin/java.exe + +if exist "%JAVA_EXE%" goto execute + +echo. +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% +echo. +echo Please set the JAVA_HOME variable in your environment to match the +echo location of your Java installation. + +goto fail + +:execute +@rem Setup the command line + +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + + +@rem Execute Gradle +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* + +:end +@rem End local scope for the variables with windows NT shell +if "%ERRORLEVEL%"=="0" goto mainEnd + +:fail +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of +rem the _cmd.exe /c_ return code! +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 +exit /b 1 + +:mainEnd +if "%OS%"=="Windows_NT" endlocal + +:omega diff --git a/hw-sign-android/settings.gradle.kts b/hw-sign-android/settings.gradle.kts new file mode 100644 index 0000000..b7d737e --- /dev/null +++ b/hw-sign-android/settings.gradle.kts @@ -0,0 +1,24 @@ +pluginManagement { + repositories { + google { + content { + includeGroupByRegex("com\\.android.*") + includeGroupByRegex("com\\.google.*") + includeGroupByRegex("androidx.*") + } + } + mavenCentral() + gradlePluginPortal() + } +} +dependencyResolutionManagement { + repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) + repositories { + google() + mavenCentral() + } +} + +rootProject.name = "dbcs" +include(":app") + \ No newline at end of file diff --git a/hw-sign-apple/hw-sign-apple.xcodeproj/project.pbxproj b/hw-sign-apple/hw-sign-apple.xcodeproj/project.pbxproj new file mode 100644 index 0000000..f107af5 --- /dev/null +++ b/hw-sign-apple/hw-sign-apple.xcodeproj/project.pbxproj @@ -0,0 +1,356 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 77; + objects = { + +/* Begin PBXFileReference section */ + 7195F3972D9A86CC00FA3526 /* hw-sign-apple.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "hw-sign-apple.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + 7195F3AF2D9A87C700FA3526 /* hw-sign-apple.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = "hw-sign-apple.xcodeproj"; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + 7195F3992D9A86CC00FA3526 /* hw-sign-apple */ = { + isa = PBXFileSystemSynchronizedRootGroup; + path = "hw-sign-apple"; + sourceTree = ""; + }; +/* End PBXFileSystemSynchronizedRootGroup section */ + +/* Begin PBXFrameworksBuildPhase section */ + 7195F3942D9A86CC00FA3526 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 7195F38E2D9A86CC00FA3526 = { + isa = PBXGroup; + children = ( + 7195F3992D9A86CC00FA3526 /* hw-sign-apple */, + 7195F3982D9A86CC00FA3526 /* Products */, + ); + sourceTree = ""; + }; + 7195F3982D9A86CC00FA3526 /* Products */ = { + isa = PBXGroup; + children = ( + 7195F3972D9A86CC00FA3526 /* hw-sign-apple.app */, + ); + name = Products; + sourceTree = ""; + }; + 7195F3B02D9A87C700FA3526 /* Products */ = { + isa = PBXGroup; + name = Products; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 7195F3962D9A86CC00FA3526 /* hw-sign-apple */ = { + isa = PBXNativeTarget; + buildConfigurationList = 7195F3A62D9A86CD00FA3526 /* Build configuration list for PBXNativeTarget "hw-sign-apple" */; + buildPhases = ( + 7195F3932D9A86CC00FA3526 /* Sources */, + 7195F3942D9A86CC00FA3526 /* Frameworks */, + 7195F3952D9A86CC00FA3526 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + 7195F3992D9A86CC00FA3526 /* hw-sign-apple */, + ); + name = "hw-sign-apple"; + packageProductDependencies = ( + ); + productName = "hw-sign-apple"; + productReference = 7195F3972D9A86CC00FA3526 /* hw-sign-apple.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 7195F38F2D9A86CC00FA3526 /* Project object */ = { + isa = PBXProject; + attributes = { + BuildIndependentTargetsInParallel = 1; + LastSwiftUpdateCheck = 1620; + LastUpgradeCheck = 1620; + TargetAttributes = { + 7195F3962D9A86CC00FA3526 = { + CreatedOnToolsVersion = 16.2; + }; + }; + }; + buildConfigurationList = 7195F3922D9A86CC00FA3526 /* Build configuration list for PBXProject "hw-sign-apple" */; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 7195F38E2D9A86CC00FA3526; + minimizedProjectReferenceProxies = 1; + preferredProjectObjectVersion = 77; + productRefGroup = 7195F3982D9A86CC00FA3526 /* Products */; + projectDirPath = ""; + projectReferences = ( + { + ProductGroup = 7195F3B02D9A87C700FA3526 /* Products */; + ProjectRef = 7195F3AF2D9A87C700FA3526 /* hw-sign-apple.xcodeproj */; + }, + ); + projectRoot = ""; + targets = ( + 7195F3962D9A86CC00FA3526 /* hw-sign-apple */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 7195F3952D9A86CC00FA3526 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 7195F3932D9A86CC00FA3526 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 7195F3A42D9A86CD00FA3526 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + ONLY_ACTIVE_ARCH = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 7195F3A52D9A86CD00FA3526 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MTL_ENABLE_DEBUG_INFO = NO; + MTL_FAST_MATH = YES; + SWIFT_COMPILATION_MODE = wholemodule; + }; + name = Release; + }; + 7195F3A72D9A86CD00FA3526 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "hw-sign-apple/hw_sign_apple.entitlements"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"hw-sign-apple/Preview Content\""; + DEVELOPMENT_TEAM = XV53H7ABC6; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 15.2; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = fan.ovo.hwsign; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 2.2; + }; + name = Debug; + }; + 7195F3A82D9A86CD00FA3526 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + CODE_SIGN_ENTITLEMENTS = "hw-sign-apple/hw_sign_apple.entitlements"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_ASSET_PATHS = "\"hw-sign-apple/Preview Content\""; + DEVELOPMENT_TEAM = XV53H7ABC6; + ENABLE_HARDENED_RUNTIME = YES; + ENABLE_PREVIEWS = YES; + GENERATE_INFOPLIST_FILE = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSceneManifest_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphoneos*]" = YES; + "INFOPLIST_KEY_UILaunchScreen_Generation[sdk=iphonesimulator*]" = YES; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphoneos*]" = UIStatusBarStyleDefault; + "INFOPLIST_KEY_UIStatusBarStyle[sdk=iphonesimulator*]" = UIStatusBarStyleDefault; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight"; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks"; + "LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks"; + MACOSX_DEPLOYMENT_TARGET = 15.2; + MARKETING_VERSION = 1.0; + PRODUCT_BUNDLE_IDENTIFIER = fan.ovo.hwsign; + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = auto; + SUPPORTED_PLATFORMS = "iphoneos iphonesimulator macosx xros xrsimulator"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2,7"; + XROS_DEPLOYMENT_TARGET = 2.2; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 7195F3922D9A86CC00FA3526 /* Build configuration list for PBXProject "hw-sign-apple" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7195F3A42D9A86CD00FA3526 /* Debug */, + 7195F3A52D9A86CD00FA3526 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 7195F3A62D9A86CD00FA3526 /* Build configuration list for PBXNativeTarget "hw-sign-apple" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 7195F3A72D9A86CD00FA3526 /* Debug */, + 7195F3A82D9A86CD00FA3526 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 7195F38F2D9A86CC00FA3526 /* Project object */; +} diff --git a/hw-sign-apple/hw-sign-apple.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/hw-sign-apple/hw-sign-apple.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/hw-sign-apple/hw-sign-apple.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/hw-sign-apple/hw-sign-apple/App.swift b/hw-sign-apple/hw-sign-apple/App.swift new file mode 100644 index 0000000..94904ca --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/App.swift @@ -0,0 +1,60 @@ +import SwiftUI + +@main +struct HWSignApp: App { + #if os(macOS) + @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate + #endif + + @StateObject private var themeManager = ThemeManager() + + var body: some Scene { + WindowGroup { + ContentView() + .environmentObject(themeManager) + #if os(macOS) + .frame(minWidth: 400, minHeight: 400) + #endif + .preferredColorScheme(themeManager.isDarkMode ? .dark : .light) + } + #if os(macOS) + .windowStyle(HiddenTitleBarWindowStyle()) + #endif + } +} + +#if os(macOS) + class AppDelegate: NSObject, NSApplicationDelegate { + func applicationDidFinishLaunching(_ notification: Notification) { + // Setup macOS specific behavior if needed + let appearance = + UserDefaults.standard.bool(forKey: "isDarkMode") + ? NSAppearance(named: .darkAqua) : NSAppearance(named: .aqua) + NSApp.appearance = appearance + } + } +#endif + +class ThemeManager: ObservableObject { + @Published var isDarkMode: Bool { + didSet { + UserDefaults.standard.set(isDarkMode, forKey: "isDarkMode") + #if os(macOS) + NSApp.appearance = NSAppearance(named: isDarkMode ? .darkAqua : .aqua) + #endif + } + } + + init() { + // Use saved preference or default to system setting + if UserDefaults.standard.object(forKey: "isDarkMode") != nil { + self.isDarkMode = UserDefaults.standard.bool(forKey: "isDarkMode") + } else { + #if os(iOS) + self.isDarkMode = UITraitCollection.current.userInterfaceStyle == .dark + #else + self.isDarkMode = false + #endif + } + } +} diff --git a/hw-sign-apple/hw-sign-apple/Assets.xcassets/AccentColor.colorset/Contents.json b/hw-sign-apple/hw-sign-apple/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/hw-sign-apple/hw-sign-apple/Assets.xcassets/AppIcon.appiconset/Contents.json b/hw-sign-apple/hw-sign-apple/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..ffdfe15 --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,85 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "16x16" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "32x32" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "128x128" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "256x256" + }, + { + "idiom" : "mac", + "scale" : "1x", + "size" : "512x512" + }, + { + "idiom" : "mac", + "scale" : "2x", + "size" : "512x512" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/hw-sign-apple/hw-sign-apple/Assets.xcassets/Contents.json b/hw-sign-apple/hw-sign-apple/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/hw-sign-apple/hw-sign-apple/ContentView.swift b/hw-sign-apple/hw-sign-apple/ContentView.swift new file mode 100644 index 0000000..e6ad2c3 --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/ContentView.swift @@ -0,0 +1,200 @@ +import Combine +import SwiftUI + +struct ContentView: View { + @StateObject private var viewModel = AuthViewModel() + @EnvironmentObject private var themeManager: ThemeManager + + var body: some View { + VStack(spacing: 20) { + Text("Hardware Secure Authentication") + .font(.largeTitle) + .fontWeight(.bold) + .padding() + .multilineTextAlignment(.center) + + if !viewModel.isAuthenticated { + // Login/Registration Form + loginForm + } else { + // Authenticated View + authenticatedView + } + + // Message display + Text(viewModel.message) + .foregroundColor( + viewModel.message.contains("successful") || viewModel.message.contains("verified") + ? .green : .red + ) + .padding() + .frame(minHeight: 60) + + Spacer() + + // Dark Mode Toggle + Toggle("Dark Mode", isOn: $themeManager.isDarkMode) + .padding(.horizontal) + } + .padding() + .disabled(viewModel.isLoading) + } + + private var loginForm: some View { + Group { + TextField("Username", text: $viewModel.username) + .textFieldStyle(RoundedBorderTextFieldStyle()) + .disableAutocorrection(true) + .padding(.horizontal) + + SecureField("Password", text: $viewModel.password) + .textFieldStyle(RoundedBorderTextFieldStyle()) + .padding(.horizontal) + + HStack(spacing: 20) { + Button("Register") { + viewModel.handleRegister() + } + .buttonStyle(.borderedProminent) + .disabled(viewModel.isLoading) + + Button("Login") { + viewModel.handleLogin() + } + .buttonStyle(.borderedProminent) + .disabled(viewModel.isLoading) + } + } + } + + private var authenticatedView: some View { + Group { + Text("You are authenticated with hardware security!") + .font(.headline) + .foregroundColor(.green) + .padding() + + Button("Check Authentication") { + viewModel.checkAuthentication() + } + .buttonStyle(.borderedProminent) + .disabled(viewModel.isLoading) + + Button("Logout") { + viewModel.handleLogout() + } + .buttonStyle(.bordered) + .foregroundColor(.red) + .padding(.top) + .disabled(viewModel.isLoading) + } + } +} + +class AuthViewModel: ObservableObject { + @Published var username = "" + @Published var password = "" + @Published var message = "" + @Published var isAuthenticated = false + @Published var isLoading = false + + private var cancellables = Set() + private let authService = AuthService.shared + + init() { + // Check if user is already authenticated + isAuthenticated = KeyManager.shared.getAuthToken() != nil + } + + func handleRegister() { + guard !username.isEmpty, !password.isEmpty else { + message = "Username and password required" + return + } + + isLoading = true + message = "Registering..." + + authService.register(username: username, password: password) + .receive(on: DispatchQueue.main) + .sink( + receiveCompletion: { [weak self] completion in + guard let self = self else { return } + self.isLoading = false + if case let .failure(error) = completion { + self.message = "Registration failed: \(error.localizedDescription)" + } + }, + receiveValue: { [weak self] response in + guard let self = self else { return } + self.message = response + } + ) + .store(in: &cancellables) + } + + func handleLogin() { + guard !username.isEmpty, !password.isEmpty else { + message = "Username and password required" + return + } + + isLoading = true + message = "Logging in..." + + authService.login(username: username, password: password) + .receive(on: DispatchQueue.main) + .sink( + receiveCompletion: { [weak self] completion in + guard let self = self else { return } + self.isLoading = false + if case let .failure(error) = completion { + self.message = "Login failed: \(error.localizedDescription)" + } + }, + receiveValue: { [weak self] response in + guard let self = self else { return } + self.isAuthenticated = true + self.message = response + } + ) + .store(in: &cancellables) + } + + func checkAuthentication() { + isLoading = true + message = "Checking authentication..." + + authService.checkAuthentication() + .receive(on: DispatchQueue.main) + .sink( + receiveCompletion: { [weak self] completion in + guard let self = self else { return } + self.isLoading = false + if case let .failure(error) = completion { + self.message = "Authentication check failed: \(error.localizedDescription)" + } + }, + receiveValue: { [weak self] response in + guard let self = self else { return } + self.message = response + } + ) + .store(in: &cancellables) + } + + func handleLogout() { + authService.logout() + isAuthenticated = false + message = "Logged out successfully" + } +} + +#if DEBUG + struct ContentView_Previews: PreviewProvider { + static var previews: some View { + ContentView() + .environmentObject(ThemeManager()) + } + } +#endif diff --git a/hw-sign-apple/hw-sign-apple/Preview Content/Preview Assets.xcassets/Contents.json b/hw-sign-apple/hw-sign-apple/Preview Content/Preview Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/Preview Content/Preview Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/hw-sign-apple/hw-sign-apple/Services/AuthService.swift b/hw-sign-apple/hw-sign-apple/Services/AuthService.swift new file mode 100644 index 0000000..5c4afa4 --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/Services/AuthService.swift @@ -0,0 +1,283 @@ +import Combine +import Foundation +import Security + +class AuthService { + static let shared = AuthService() + private let baseURL = URL(string: "https://dbcs-api.ovo.fan")! + // private let baseURL = URL(string: "http://127.0.0.1:28280")! + private let keyManager = KeyManager.shared + private var cancellables = Set() + + private init() {} + + // MARK: - Authentication Flow + + func register(username: String, password: String) -> AnyPublisher { + let body = ["username": username, "password": password] + return makeRequest("register", method: "POST", body: body, responseType: EmptyResponse.self) + .map { _ in "Registration successful!" } + .eraseToAnyPublisher() + } + + func login(username: String, password: String) -> AnyPublisher { + return Future { [weak self] promise in + guard let self = self else { + promise( + .failure( + NSError( + domain: "AuthService", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Service unavailable"]))) + return + } + + do { + // Create new hardware key for this session + let hwKey = try self.keyManager.createKey(.hardware, forceNew: true) + guard let hwPubKey = self.keyManager.getPublicKey(for: hwKey) else { + throw NSError( + domain: "AuthService", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Failed to get public key"]) + } + + let hwPubKeyData = try self.keyManager.exportPublicKey(hwPubKey) + let hwPubKeyBase64 = hwPubKeyData.base64EncodedString() + + // Make login request with hardware key + let body = ["username": username, "password": password] + var request = try self.createRequest("login", method: "POST", body: body) + request.setValue(hwPubKeyBase64, forHTTPHeaderField: "x-rpc-sec-bound-token-hw-pub") + request.setValue("ecdsa", forHTTPHeaderField: "x-rpc-sec-bound-token-hw-pub-type") // Always use ECDSA + + URLSession.shared.dataTaskPublisher(for: request) + .tryMap { data, response -> Data in + guard let httpResponse = response as? HTTPURLResponse else { + throw NSError( + domain: "AuthService", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Invalid response type"]) + } + + if !(200...299).contains(httpResponse.statusCode) { + throw NSError( + domain: "AuthService", code: httpResponse.statusCode, + userInfo: [NSLocalizedDescriptionKey: "Server error: \(httpResponse.statusCode)"]) + } + + return data + } + .decode(type: LoginResponse.self, decoder: JSONDecoder()) + .receive(on: DispatchQueue.main) + .sink( + receiveCompletion: { completion in + if case let .failure(error) = completion { + promise(.failure(error)) + } + }, + receiveValue: { response in + self.keyManager.storeAuthToken(response.token) + promise(.success("Login successful!")) + } + ) + .store(in: &self.cancellables) + + } catch { + promise(.failure(error)) + } + }.eraseToAnyPublisher() + } + + func checkAuthentication() -> AnyPublisher { + return authenticatedRequest("authenticated", method: "GET", responseType: AuthResponse.self) + .map { _ in "Authentication verified with hardware security!" } + .eraseToAnyPublisher() + } + + func logout() { + try? keyManager.deleteKey(.hardware) + try? keyManager.deleteKey(.acceleration) + keyManager.deleteAuthToken() + keyManager.deleteAccelKeyId() + } + + // MARK: - Request Helpers + + private func makeRequest( + _ path: String, method: String, body: [String: Any]? = nil, responseType: T.Type + ) -> AnyPublisher { + return Future { [weak self] promise in + guard let self = self else { + promise( + .failure( + NSError( + domain: "AuthService", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Service unavailable"]))) + return + } + + do { + let request = try self.createRequest(path, method: method, body: body) + + URLSession.shared.dataTaskPublisher(for: request) + .tryMap { data, response -> Data in + guard let httpResponse = response as? HTTPURLResponse else { + throw NSError( + domain: "AuthService", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Invalid response type"]) + } + + if !(200...299).contains(httpResponse.statusCode) { + throw NSError( + domain: "AuthService", code: httpResponse.statusCode, + userInfo: [NSLocalizedDescriptionKey: "Server error: \(httpResponse.statusCode)"]) + } + + return data + } + .decode(type: T.self, decoder: JSONDecoder()) + .receive(on: DispatchQueue.main) + .sink( + receiveCompletion: { completion in + if case let .failure(error) = completion { + promise(.failure(error)) + } + }, + receiveValue: { response in + promise(.success(response)) + } + ) + .store(in: &self.cancellables) + } catch { + promise(.failure(error)) + } + }.eraseToAnyPublisher() + } + + private func authenticatedRequest( + _ path: String, method: String, responseType: T.Type, body: [String: Any]? = nil + ) -> AnyPublisher { + return Future { [weak self] promise in + guard let self = self else { + promise( + .failure( + NSError( + domain: "AuthService", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Service unavailable"]))) + return + } + + do { + let timestamp = String(Int(Date().timeIntervalSince1970)) + let accelKeyId = self.keyManager.getAccelKeyId() + + var request = try self.createRequest(path, method: method, body: body) + request.setValue( + "Bearer \(self.keyManager.getAuthToken() ?? "")", forHTTPHeaderField: "Authorization") + request.setValue(timestamp, forHTTPHeaderField: "x-rpc-sec-bound-token-data") + + if let accelKeyId = accelKeyId { + // Use existing acceleration key + let accelKey = try self.keyManager.loadKey(.acceleration) + let signature = try self.keyManager.sign( + data: timestamp.data(using: .utf8)!, with: accelKey) + + request.setValue( + signature.base64EncodedString(), forHTTPHeaderField: "x-rpc-sec-bound-token-data-sig") + request.setValue(accelKeyId, forHTTPHeaderField: "x-rpc-sec-bound-token-accel-pub-id") + } else { + // Create new acceleration key + let accelKey = try self.keyManager.createKey(.acceleration) + guard let accelPubKey = self.keyManager.getPublicKey(for: accelKey) else { + throw NSError( + domain: "AuthService", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Failed to get acceleration public key"]) + } + + let accelPubKeyData = try self.keyManager.exportPublicKey(accelPubKey) + let accelPubKeyBase64 = accelPubKeyData.base64EncodedString() + + // Sign acceleration key with hardware key + let hwKey = try self.keyManager.loadKey(.hardware) + let accelKeySig = try self.keyManager.sign( + data: accelPubKeyBase64.data(using: .utf8)!, with: hwKey) + + let signature = try self.keyManager.sign( + data: timestamp.data(using: .utf8)!, with: accelKey) + + request.setValue(accelPubKeyBase64, forHTTPHeaderField: "x-rpc-sec-bound-token-accel-pub") + request.setValue("ecdsa", forHTTPHeaderField: "x-rpc-sec-bound-token-accel-pub-type") // Always use ECDSA + request.setValue( + accelKeySig.base64EncodedString(), forHTTPHeaderField: "x-rpc-sec-bound-token-accel-pub-sig") + request.setValue( + signature.base64EncodedString(), forHTTPHeaderField: "x-rpc-sec-bound-token-data-sig") + } + + URLSession.shared.dataTaskPublisher(for: request) + .tryMap { data, response -> Data in + guard let httpResponse = response as? HTTPURLResponse else { + throw NSError( + domain: "AuthService", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Invalid response type"]) + } + + if let accelKeyId = httpResponse.value( + forHTTPHeaderField: "x-rpc-sec-bound-token-accel-pub-id") + { + self.keyManager.storeAccelKeyId(accelKeyId) + } + + if !(200...299).contains(httpResponse.statusCode) { + throw NSError( + domain: "AuthService", code: httpResponse.statusCode, + userInfo: [NSLocalizedDescriptionKey: "Server error: \(httpResponse.statusCode)"]) + } + + return data + } + .decode(type: T.self, decoder: JSONDecoder()) + .receive(on: DispatchQueue.main) + .sink( + receiveCompletion: { completion in + if case let .failure(error) = completion { + promise(.failure(error)) + } + }, + receiveValue: { response in + promise(.success(response)) + } + ) + .store(in: &self.cancellables) + + } catch { + promise(.failure(error)) + } + }.eraseToAnyPublisher() + } + + private func createRequest(_ path: String, method: String, body: [String: Any]? = nil) throws + -> URLRequest + { + var request = URLRequest(url: baseURL.appendingPathComponent(path)) + request.httpMethod = method + request.setValue("application/json", forHTTPHeaderField: "Content-Type") + + if let body = body { + request.httpBody = try JSONSerialization.data(withJSONObject: body) + } + + return request + } +} + +// MARK: - Response Models + +struct LoginResponse: Codable { + let token: String +} + +struct AuthResponse: Codable { + let authenticated: Bool +} + +struct EmptyResponse: Codable { + // Empty response structure for endpoints that don't return meaningful data +} diff --git a/hw-sign-apple/hw-sign-apple/Services/KeyManager.swift b/hw-sign-apple/hw-sign-apple/Services/KeyManager.swift new file mode 100644 index 0000000..d5e00a4 --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/Services/KeyManager.swift @@ -0,0 +1,149 @@ +import Foundation +import LocalAuthentication +import Security + +class KeyManager { + static let shared = KeyManager() + private let tagPrefix = "fan.ovo.hwsign" + + enum KeyType: String { + case hardware = "hardware" + case acceleration = "acceleration" + } + + private init() {} + + // MARK: - Key Management + + func createKey(_ type: KeyType, forceNew: Bool = false) throws -> SecKey { + let tag = "\(tagPrefix).\(type.rawValue)" + + // Always attempt to delete an existing key with the same tag to avoid conflicts + try? deleteKey(type) + + let flags: SecAccessControlCreateFlags = [.privateKeyUsage] + + let access = SecAccessControlCreateWithFlags( + kCFAllocatorDefault, + kSecAttrAccessibleWhenUnlockedThisDeviceOnly, + flags, + nil + )! + + let attributes: [String: Any] = [ + kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, + kSecAttrKeySizeInBits as String: 256, + kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, + kSecPrivateKeyAttrs as String: [ + kSecAttrIsPermanent as String: true, + kSecAttrAccessControl as String: access, + kSecAttrApplicationTag as String: tag.data(using: .utf8)!, + ], + ] + + var error: Unmanaged? + guard let privateKey = SecKeyCreateRandomKey(attributes as CFDictionary, &error) else { + throw error!.takeRetainedValue() as Error + } + + return privateKey + } + + func loadKey(_ type: KeyType) throws -> SecKey { + let tag = "\(tagPrefix).\(type.rawValue)" + + let query: [String: Any] = [ + kSecClass as String: kSecClassKey, + kSecAttrApplicationTag as String: tag.data(using: .utf8)!, + kSecAttrKeyType as String: kSecAttrKeyTypeECSECPrimeRandom, + kSecReturnRef as String: true, + ] + + var item: CFTypeRef? + let status = SecItemCopyMatching(query as CFDictionary, &item) + + guard status == errSecSuccess else { + throw NSError(domain: NSOSStatusErrorDomain, code: Int(status)) + } + + // Fix: Use proper type safety pattern instead of direct force casting + guard let key = item else { + throw NSError( + domain: "KeyManager", code: -1, + userInfo: [NSLocalizedDescriptionKey: "Retrieved key is nil"]) + } + + return (key as! SecKey) // This cast is safe because SecItemCopyMatching guarantees a SecKey when using kSecReturnRef + } + + func deleteKey(_ type: KeyType) throws { + let tag = "\(tagPrefix).\(type.rawValue)" + + let query: [String: Any] = [ + kSecClass as String: kSecClassKey, + kSecAttrApplicationTag as String: tag.data(using: .utf8)!, + ] + + let status = SecItemDelete(query as CFDictionary) + guard status == errSecSuccess || status == errSecItemNotFound else { + throw NSError(domain: NSOSStatusErrorDomain, code: Int(status)) + } + } + + // MARK: - Signing Operations + + func sign(data: Data, with key: SecKey) throws -> Data { + var error: Unmanaged? + guard + let signature = SecKeyCreateSignature( + key, + .ecdsaSignatureMessageX962SHA256, + data as CFData, + &error + ) as Data? + else { + throw error!.takeRetainedValue() as Error + } + return signature + } + + func getPublicKey(for privateKey: SecKey) -> SecKey? { + return SecKeyCopyPublicKey(privateKey) + } + + func exportPublicKey(_ key: SecKey) throws -> Data { + // This encodes ec public to x962 + var error: Unmanaged? + guard let exportedKey = SecKeyCopyExternalRepresentation(key, &error) as Data? else { + throw error!.takeRetainedValue() as Error + } + + return exportedKey + } + + // MARK: - Token Management + + func storeAuthToken(_ token: String) { + UserDefaults.standard.set(token, forKey: "\(tagPrefix).authToken") + } + + func getAuthToken() -> String? { + return UserDefaults.standard.string(forKey: "\(tagPrefix).authToken") + } + + func deleteAuthToken() { + UserDefaults.standard.removeObject(forKey: "\(tagPrefix).authToken") + } + + func storeAccelKeyId(_ keyId: String) { + UserDefaults.standard.set(keyId, forKey: "\(tagPrefix).accelKeyId") + } + + func getAccelKeyId() -> String? { + return UserDefaults.standard.string(forKey: "\(tagPrefix).accelKeyId") + } + + func deleteAccelKeyId() { + UserDefaults.standard.removeObject(forKey: "\(tagPrefix).accelKeyId") + } +} diff --git a/hw-sign-apple/hw-sign-apple/hw_sign_apple.entitlements b/hw-sign-apple/hw-sign-apple/hw_sign_apple.entitlements new file mode 100644 index 0000000..1342d0d --- /dev/null +++ b/hw-sign-apple/hw-sign-apple/hw_sign_apple.entitlements @@ -0,0 +1,18 @@ + + + + + com.apple.security.app-sandbox + + com.apple.security.files.user-selected + + com.apple.security.network.client + + com.apple.security.network.dns + + com.apple.security.network.server + + keychain-access-groups + + + diff --git a/hw-sign-browser/.gitignore b/hw-sign-browser/.gitignore new file mode 100644 index 0000000..8ee54e8 --- /dev/null +++ b/hw-sign-browser/.gitignore @@ -0,0 +1,30 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo diff --git a/hw-sign-browser/README.md b/hw-sign-browser/README.md new file mode 100644 index 0000000..74c0c24 --- /dev/null +++ b/hw-sign-browser/README.md @@ -0,0 +1,33 @@ +# hw-sign-browser + +This template should help get you started developing with Vue 3 in Vite. + +## Recommended IDE Setup + +[VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur). + +## Type Support for `.vue` Imports in TS + +TypeScript cannot handle type information for `.vue` imports by default, so we replace the `tsc` CLI with `vue-tsc` for type checking. In editors, we need [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) to make the TypeScript language service aware of `.vue` types. + +## Customize configuration + +See [Vite Configuration Reference](https://vite.dev/config/). + +## Project Setup + +```sh +npm install +``` + +### Compile and Hot-Reload for Development + +```sh +npm run dev +``` + +### Type-Check, Compile and Minify for Production + +```sh +npm run build +``` diff --git a/hw-sign-browser/env.d.ts b/hw-sign-browser/env.d.ts new file mode 100644 index 0000000..11f02fe --- /dev/null +++ b/hw-sign-browser/env.d.ts @@ -0,0 +1 @@ +/// diff --git a/hw-sign-browser/index.html b/hw-sign-browser/index.html new file mode 100644 index 0000000..058972f --- /dev/null +++ b/hw-sign-browser/index.html @@ -0,0 +1,13 @@ + + + + + + + DBCS Demo + + +

+ + + diff --git a/hw-sign-browser/package.json b/hw-sign-browser/package.json new file mode 100644 index 0000000..7fb4d42 --- /dev/null +++ b/hw-sign-browser/package.json @@ -0,0 +1,31 @@ +{ + "name": "hw-sign-browser", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "vite --port 3000", + "build": "run-p type-check \"build-only {@}\" --", + "preview": "vite preview", + "build-only": "vite build", + "type-check": "vue-tsc --build" + }, + "dependencies": { + "axios": "^1.8.4", + "vue": "^3.5.13" + }, + "devDependencies": { + "@tsconfig/node22": "^22.0.0", + "@types/node": "^22.13.9", + "@vitejs/plugin-vue": "^5.2.1", + "@vue/tsconfig": "^0.7.0", + "autoprefixer": "^10.4.21", + "npm-run-all2": "^7.0.2", + "postcss": "^8.5.3", + "tailwindcss": "3", + "typescript": "~5.8.0", + "vite": "^6.2.1", + "vite-plugin-vue-devtools": "^7.7.2", + "vue-tsc": "^2.2.8" + } +} diff --git a/hw-sign-browser/pnpm-lock.yaml b/hw-sign-browser/pnpm-lock.yaml new file mode 100644 index 0000000..64c8c0e --- /dev/null +++ b/hw-sign-browser/pnpm-lock.yaml @@ -0,0 +1,2886 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + axios: + specifier: ^1.8.4 + version: 1.8.4 + vue: + specifier: ^3.5.13 + version: 3.5.13(typescript@5.8.2) + devDependencies: + '@tsconfig/node22': + specifier: ^22.0.0 + version: 22.0.1 + '@types/node': + specifier: ^22.13.9 + version: 22.13.14 + '@vitejs/plugin-vue': + specifier: ^5.2.1 + version: 5.2.3(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0))(vue@3.5.13(typescript@5.8.2)) + '@vue/tsconfig': + specifier: ^0.7.0 + version: 0.7.0(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2)) + autoprefixer: + specifier: ^10.4.21 + version: 10.4.21(postcss@8.5.3) + npm-run-all2: + specifier: ^7.0.2 + version: 7.0.2 + postcss: + specifier: ^8.5.3 + version: 8.5.3 + tailwindcss: + specifier: '3' + version: 3.4.17 + typescript: + specifier: ~5.8.0 + version: 5.8.2 + vite: + specifier: ^6.2.1 + version: 6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0) + vite-plugin-vue-devtools: + specifier: ^7.7.2 + version: 7.7.2(rollup@4.37.0)(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0))(vue@3.5.13(typescript@5.8.2)) + vue-tsc: + specifier: ^2.2.8 + version: 2.2.8(typescript@5.8.2) + +packages: + + '@alloc/quick-lru@5.2.0': + resolution: {integrity: sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw==} + engines: {node: '>=10'} + + '@ampproject/remapping@2.3.0': + resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} + engines: {node: '>=6.0.0'} + + '@antfu/utils@0.7.10': + resolution: {integrity: sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==} + + '@babel/code-frame@7.26.2': + resolution: {integrity: sha512-RJlIHRueQgwWitWgF8OdFYGZX328Ax5BCemNGlqHfplnRT9ESi8JkFlvaVYbS+UubVY6dpv87Fs2u5M29iNFVQ==} + engines: {node: '>=6.9.0'} + + '@babel/compat-data@7.26.8': + resolution: {integrity: sha512-oH5UPLMWR3L2wEFLnFJ1TZXqHufiTKAiLfqw5zkhS4dKXLJ10yVztfil/twG8EDTA4F/tvVNw9nOl4ZMslB8rQ==} + engines: {node: '>=6.9.0'} + + '@babel/core@7.26.10': + resolution: {integrity: sha512-vMqyb7XCDMPvJFFOaT9kxtiRh42GwlZEg1/uIgtZshS5a/8OaduUfCi7kynKgc3Tw/6Uo2D+db9qBttghhmxwQ==} + engines: {node: '>=6.9.0'} + + '@babel/generator@7.27.0': + resolution: {integrity: sha512-VybsKvpiN1gU1sdMZIp7FcqphVVKEwcuj02x73uvcHE0PTihx1nlBcowYWhDwjpoAXRv43+gDzyggGnn1XZhVw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-annotate-as-pure@7.25.9': + resolution: {integrity: sha512-gv7320KBUFJz1RnylIg5WWYPRXKZ884AGkYpgpWW02TH66Dl+HaC1t1CKd0z3R4b6hdYEcmrNZHUmfCP+1u3/g==} + engines: {node: '>=6.9.0'} + + '@babel/helper-compilation-targets@7.27.0': + resolution: {integrity: sha512-LVk7fbXml0H2xH34dFzKQ7TDZ2G4/rVTOrq9V+icbbadjbVxxeFeDsNHv2SrZeWoA+6ZiTyWYWtScEIW07EAcA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-create-class-features-plugin@7.27.0': + resolution: {integrity: sha512-vSGCvMecvFCd/BdpGlhpXYNhhC4ccxyvQWpbGL4CWbvfEoLFWUZuSuf7s9Aw70flgQF+6vptvgK2IfOnKlRmBg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-member-expression-to-functions@7.25.9': + resolution: {integrity: sha512-wbfdZ9w5vk0C0oyHqAJbc62+vet5prjj01jjJ8sKn3j9h3MQQlflEdXYvuqRWjHnM12coDEqiC1IRCi0U/EKwQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-imports@7.25.9': + resolution: {integrity: sha512-tnUA4RsrmflIM6W6RFTLFSXITtl0wKjgpnLgXyowocVPrbYrLUXSBXDgTs8BlbmIzIdlBySRQjINYs2BAkiLtw==} + engines: {node: '>=6.9.0'} + + '@babel/helper-module-transforms@7.26.0': + resolution: {integrity: sha512-xO+xu6B5K2czEnQye6BHA7DolFFmS3LB7stHZFaOLb1pAwO1HWLS8fXA+eh0A2yIvltPVmx3eNNDBJA2SLHXFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-optimise-call-expression@7.25.9': + resolution: {integrity: sha512-FIpuNaz5ow8VyrYcnXQTDRGvV6tTjkNtCK/RYNDXGSLlUD6cBuQTSw43CShGxjvfBTfcUA/r6UhUCbtYqkhcuQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-plugin-utils@7.26.5': + resolution: {integrity: sha512-RS+jZcRdZdRFzMyr+wcsaqOmld1/EqTghfaBGQQd/WnRdzdlvSZ//kF7U8VQTxf1ynZ4cjUcYgjVGx13ewNPMg==} + engines: {node: '>=6.9.0'} + + '@babel/helper-replace-supers@7.26.5': + resolution: {integrity: sha512-bJ6iIVdYX1YooY2X7w1q6VITt+LnUILtNk7zT78ykuwStx8BauCzxvFqFaHjOpW1bVnSUM1PN1f0p5P21wHxvg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + + '@babel/helper-skip-transparent-expression-wrappers@7.25.9': + resolution: {integrity: sha512-K4Du3BFa3gvyhzgPcntrkDgZzQaq6uozzcpGbOO1OEJaI+EJdqWIMTLgFgQf6lrfiDFo5FU+BxKepI9RmZqahA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-string-parser@7.25.9': + resolution: {integrity: sha512-4A/SCr/2KLd5jrtOMFzaKjVtAei3+2r/NChoBNoZ3EyP/+GlhoaEGoWOZUmFmoITP7zOJyHIMm+DYRd8o3PvHA==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-identifier@7.25.9': + resolution: {integrity: sha512-Ed61U6XJc3CVRfkERJWDz4dJwKe7iLmmJsbOGu9wSloNSFttHV0I8g6UAgb7qnK5ly5bGLPd4oXZlxCdANBOWQ==} + engines: {node: '>=6.9.0'} + + '@babel/helper-validator-option@7.25.9': + resolution: {integrity: sha512-e/zv1co8pp55dNdEcCynfj9X7nyUKUXoUEwfXqaZt0omVOmDe9oOTdKStH4GmAw6zxMFs50ZayuMfHDKlO7Tfw==} + engines: {node: '>=6.9.0'} + + '@babel/helpers@7.27.0': + resolution: {integrity: sha512-U5eyP/CTFPuNE3qk+WZMxFkp/4zUzdceQlfzf7DdGdhp+Fezd7HD+i8Y24ZuTMKX3wQBld449jijbGq6OdGNQg==} + engines: {node: '>=6.9.0'} + + '@babel/parser@7.27.0': + resolution: {integrity: sha512-iaepho73/2Pz7w2eMS0Q5f83+0RKI7i4xmiYeBmDzfRVbQtTOG7Ts0S4HzJVsTMGI9keU8rNfuZr8DKfSt7Yyg==} + engines: {node: '>=6.0.0'} + hasBin: true + + '@babel/plugin-proposal-decorators@7.25.9': + resolution: {integrity: sha512-smkNLL/O1ezy9Nhy4CNosc4Va+1wo5w4gzSZeLe6y6dM4mmHfYOCPolXQPHQxonZCF+ZyebxN9vqOolkYrSn5g==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-decorators@7.25.9': + resolution: {integrity: sha512-ryzI0McXUPJnRCvMo4lumIKZUzhYUO/ScI+Mz4YVaTLt04DHNSjEUjKVvbzQjZFLuod/cYEc07mJWhzl6v4DPg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-attributes@7.26.0': + resolution: {integrity: sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-import-meta@7.10.4': + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-jsx@7.25.9': + resolution: {integrity: sha512-ld6oezHQMZsZfp6pWtbjaNDF2tiiCYYDqQszHt5VV437lewP9aSi2Of99CK0D0XB21k7FLgnLcmQKyKzynfeAA==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-syntax-typescript@7.25.9': + resolution: {integrity: sha512-hjMgRy5hb8uJJjUcdWunWVcoi9bGpJp8p5Ol1229PoN6aytsLwNMgmdftO23wnCLMfVmTwZDWMPNq/D1SY60JQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/plugin-transform-typescript@7.27.0': + resolution: {integrity: sha512-fRGGjO2UEGPjvEcyAZXRXAS8AfdaQoq7HnxAbJoAoW10B9xOKesmmndJv+Sym2a+9FHWZ9KbyyLCe9s0Sn5jtg==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@babel/template@7.27.0': + resolution: {integrity: sha512-2ncevenBqXI6qRMukPlXwHKHchC7RyMuu4xv5JBXRfOGVcTy1mXCD12qrp7Jsoxll1EV3+9sE4GugBVRjT2jFA==} + engines: {node: '>=6.9.0'} + + '@babel/traverse@7.27.0': + resolution: {integrity: sha512-19lYZFzYVQkkHkl4Cy4WrAVcqBkgvV2YM2TU3xG6DIwO7O3ecbDPfW3yM3bjAGcqcQHi+CCtjMR3dIEHxsd6bA==} + engines: {node: '>=6.9.0'} + + '@babel/types@7.27.0': + resolution: {integrity: sha512-H45s8fVLYjbhFH62dIJ3WtmJ6RSPt/3DRO0ZcT2SUiYiQyz3BLVb9ADEnLl91m74aQPS3AzzeajZHYOalWe3bg==} + engines: {node: '>=6.9.0'} + + '@esbuild/aix-ppc64@0.25.1': + resolution: {integrity: sha512-kfYGy8IdzTGy+z0vFGvExZtxkFlA4zAxgKEahG9KE1ScBjpQnFsNOX8KTU5ojNru5ed5CVoJYXFtoxaq5nFbjQ==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [aix] + + '@esbuild/android-arm64@0.25.1': + resolution: {integrity: sha512-50tM0zCJW5kGqgG7fQ7IHvQOcAn9TKiVRuQ/lN0xR+T2lzEFvAi1ZcS8DiksFcEpf1t/GYOeOfCAgDHFpkiSmA==} + engines: {node: '>=18'} + cpu: [arm64] + os: [android] + + '@esbuild/android-arm@0.25.1': + resolution: {integrity: sha512-dp+MshLYux6j/JjdqVLnMglQlFu+MuVeNrmT5nk6q07wNhCdSnB7QZj+7G8VMUGh1q+vj2Bq8kRsuyA00I/k+Q==} + engines: {node: '>=18'} + cpu: [arm] + os: [android] + + '@esbuild/android-x64@0.25.1': + resolution: {integrity: sha512-GCj6WfUtNldqUzYkN/ITtlhwQqGWu9S45vUXs7EIYf+7rCiiqH9bCloatO9VhxsL0Pji+PF4Lz2XXCES+Q8hDw==} + engines: {node: '>=18'} + cpu: [x64] + os: [android] + + '@esbuild/darwin-arm64@0.25.1': + resolution: {integrity: sha512-5hEZKPf+nQjYoSr/elb62U19/l1mZDdqidGfmFutVUjjUZrOazAtwK+Kr+3y0C/oeJfLlxo9fXb1w7L+P7E4FQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [darwin] + + '@esbuild/darwin-x64@0.25.1': + resolution: {integrity: sha512-hxVnwL2Dqs3fM1IWq8Iezh0cX7ZGdVhbTfnOy5uURtao5OIVCEyj9xIzemDi7sRvKsuSdtCAhMKarxqtlyVyfA==} + engines: {node: '>=18'} + cpu: [x64] + os: [darwin] + + '@esbuild/freebsd-arm64@0.25.1': + resolution: {integrity: sha512-1MrCZs0fZa2g8E+FUo2ipw6jw5qqQiH+tERoS5fAfKnRx6NXH31tXBKI3VpmLijLH6yriMZsxJtaXUyFt/8Y4A==} + engines: {node: '>=18'} + cpu: [arm64] + os: [freebsd] + + '@esbuild/freebsd-x64@0.25.1': + resolution: {integrity: sha512-0IZWLiTyz7nm0xuIs0q1Y3QWJC52R8aSXxe40VUxm6BB1RNmkODtW6LHvWRrGiICulcX7ZvyH6h5fqdLu4gkww==} + engines: {node: '>=18'} + cpu: [x64] + os: [freebsd] + + '@esbuild/linux-arm64@0.25.1': + resolution: {integrity: sha512-jaN3dHi0/DDPelk0nLcXRm1q7DNJpjXy7yWaWvbfkPvI+7XNSc/lDOnCLN7gzsyzgu6qSAmgSvP9oXAhP973uQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [linux] + + '@esbuild/linux-arm@0.25.1': + resolution: {integrity: sha512-NdKOhS4u7JhDKw9G3cY6sWqFcnLITn6SqivVArbzIaf3cemShqfLGHYMx8Xlm/lBit3/5d7kXvriTUGa5YViuQ==} + engines: {node: '>=18'} + cpu: [arm] + os: [linux] + + '@esbuild/linux-ia32@0.25.1': + resolution: {integrity: sha512-OJykPaF4v8JidKNGz8c/q1lBO44sQNUQtq1KktJXdBLn1hPod5rE/Hko5ugKKZd+D2+o1a9MFGUEIUwO2YfgkQ==} + engines: {node: '>=18'} + cpu: [ia32] + os: [linux] + + '@esbuild/linux-loong64@0.25.1': + resolution: {integrity: sha512-nGfornQj4dzcq5Vp835oM/o21UMlXzn79KobKlcs3Wz9smwiifknLy4xDCLUU0BWp7b/houtdrgUz7nOGnfIYg==} + engines: {node: '>=18'} + cpu: [loong64] + os: [linux] + + '@esbuild/linux-mips64el@0.25.1': + resolution: {integrity: sha512-1osBbPEFYwIE5IVB/0g2X6i1qInZa1aIoj1TdL4AaAb55xIIgbg8Doq6a5BzYWgr+tEcDzYH67XVnTmUzL+nXg==} + engines: {node: '>=18'} + cpu: [mips64el] + os: [linux] + + '@esbuild/linux-ppc64@0.25.1': + resolution: {integrity: sha512-/6VBJOwUf3TdTvJZ82qF3tbLuWsscd7/1w+D9LH0W/SqUgM5/JJD0lrJ1fVIfZsqB6RFmLCe0Xz3fmZc3WtyVg==} + engines: {node: '>=18'} + cpu: [ppc64] + os: [linux] + + '@esbuild/linux-riscv64@0.25.1': + resolution: {integrity: sha512-nSut/Mx5gnilhcq2yIMLMe3Wl4FK5wx/o0QuuCLMtmJn+WeWYoEGDN1ipcN72g1WHsnIbxGXd4i/MF0gTcuAjQ==} + engines: {node: '>=18'} + cpu: [riscv64] + os: [linux] + + '@esbuild/linux-s390x@0.25.1': + resolution: {integrity: sha512-cEECeLlJNfT8kZHqLarDBQso9a27o2Zd2AQ8USAEoGtejOrCYHNtKP8XQhMDJMtthdF4GBmjR2au3x1udADQQQ==} + engines: {node: '>=18'} + cpu: [s390x] + os: [linux] + + '@esbuild/linux-x64@0.25.1': + resolution: {integrity: sha512-xbfUhu/gnvSEg+EGovRc+kjBAkrvtk38RlerAzQxvMzlB4fXpCFCeUAYzJvrnhFtdeyVCDANSjJvOvGYoeKzFA==} + engines: {node: '>=18'} + cpu: [x64] + os: [linux] + + '@esbuild/netbsd-arm64@0.25.1': + resolution: {integrity: sha512-O96poM2XGhLtpTh+s4+nP7YCCAfb4tJNRVZHfIE7dgmax+yMP2WgMd2OecBuaATHKTHsLWHQeuaxMRnCsH8+5g==} + engines: {node: '>=18'} + cpu: [arm64] + os: [netbsd] + + '@esbuild/netbsd-x64@0.25.1': + resolution: {integrity: sha512-X53z6uXip6KFXBQ+Krbx25XHV/NCbzryM6ehOAeAil7X7oa4XIq+394PWGnwaSQ2WRA0KI6PUO6hTO5zeF5ijA==} + engines: {node: '>=18'} + cpu: [x64] + os: [netbsd] + + '@esbuild/openbsd-arm64@0.25.1': + resolution: {integrity: sha512-Na9T3szbXezdzM/Kfs3GcRQNjHzM6GzFBeU1/6IV/npKP5ORtp9zbQjvkDJ47s6BCgaAZnnnu/cY1x342+MvZg==} + engines: {node: '>=18'} + cpu: [arm64] + os: [openbsd] + + '@esbuild/openbsd-x64@0.25.1': + resolution: {integrity: sha512-T3H78X2h1tszfRSf+txbt5aOp/e7TAz3ptVKu9Oyir3IAOFPGV6O9c2naym5TOriy1l0nNf6a4X5UXRZSGX/dw==} + engines: {node: '>=18'} + cpu: [x64] + os: [openbsd] + + '@esbuild/sunos-x64@0.25.1': + resolution: {integrity: sha512-2H3RUvcmULO7dIE5EWJH8eubZAI4xw54H1ilJnRNZdeo8dTADEZ21w6J22XBkXqGJbe0+wnNJtw3UXRoLJnFEg==} + engines: {node: '>=18'} + cpu: [x64] + os: [sunos] + + '@esbuild/win32-arm64@0.25.1': + resolution: {integrity: sha512-GE7XvrdOzrb+yVKB9KsRMq+7a2U/K5Cf/8grVFRAGJmfADr/e/ODQ134RK2/eeHqYV5eQRFxb1hY7Nr15fv1NQ==} + engines: {node: '>=18'} + cpu: [arm64] + os: [win32] + + '@esbuild/win32-ia32@0.25.1': + resolution: {integrity: sha512-uOxSJCIcavSiT6UnBhBzE8wy3n0hOkJsBOzy7HDAuTDE++1DJMRRVCPGisULScHL+a/ZwdXPpXD3IyFKjA7K8A==} + engines: {node: '>=18'} + cpu: [ia32] + os: [win32] + + '@esbuild/win32-x64@0.25.1': + resolution: {integrity: sha512-Y1EQdcfwMSeQN/ujR5VayLOJ1BHaK+ssyk0AEzPjC+t1lITgsnccPqFjb6V+LsTp/9Iov4ysfjxLaGJ9RPtkVg==} + engines: {node: '>=18'} + cpu: [x64] + os: [win32] + + '@isaacs/cliui@8.0.2': + resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} + engines: {node: '>=12'} + + '@jridgewell/gen-mapping@0.3.8': + resolution: {integrity: sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA==} + engines: {node: '>=6.0.0'} + + '@jridgewell/resolve-uri@3.1.2': + resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} + engines: {node: '>=6.0.0'} + + '@jridgewell/set-array@1.2.1': + resolution: {integrity: sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A==} + engines: {node: '>=6.0.0'} + + '@jridgewell/sourcemap-codec@1.5.0': + resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==} + + '@jridgewell/trace-mapping@0.3.25': + resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} + + '@nodelib/fs.scandir@2.1.5': + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + + '@nodelib/fs.stat@2.0.5': + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + + '@nodelib/fs.walk@1.2.8': + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + + '@pkgjs/parseargs@0.11.0': + resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} + engines: {node: '>=14'} + + '@polka/url@1.0.0-next.28': + resolution: {integrity: sha512-8LduaNlMZGwdZ6qWrKlfa+2M4gahzFkprZiAt2TF8uS0qQgBizKXpXURqvTJ4WtmupWxaLqjRb2UCTe72mu+Aw==} + + '@rollup/pluginutils@5.1.4': + resolution: {integrity: sha512-USm05zrsFxYLPdWWq+K3STlWiT/3ELn3RcV5hJMghpeAIhxfsUIg6mt12CBJBInWMV4VneoV7SfGv8xIwo2qNQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + + '@rollup/rollup-android-arm-eabi@4.37.0': + resolution: {integrity: sha512-l7StVw6WAa8l3vA1ov80jyetOAEo1FtHvZDbzXDO/02Sq/QVvqlHkYoFwDJPIMj0GKiistsBudfx5tGFnwYWDQ==} + cpu: [arm] + os: [android] + + '@rollup/rollup-android-arm64@4.37.0': + resolution: {integrity: sha512-6U3SlVyMxezt8Y+/iEBcbp945uZjJwjZimu76xoG7tO1av9VO691z8PkhzQ85ith2I8R2RddEPeSfcbyPfD4hA==} + cpu: [arm64] + os: [android] + + '@rollup/rollup-darwin-arm64@4.37.0': + resolution: {integrity: sha512-+iTQ5YHuGmPt10NTzEyMPbayiNTcOZDWsbxZYR1ZnmLnZxG17ivrPSWFO9j6GalY0+gV3Jtwrrs12DBscxnlYA==} + cpu: [arm64] + os: [darwin] + + '@rollup/rollup-darwin-x64@4.37.0': + resolution: {integrity: sha512-m8W2UbxLDcmRKVjgl5J/k4B8d7qX2EcJve3Sut7YGrQoPtCIQGPH5AMzuFvYRWZi0FVS0zEY4c8uttPfX6bwYQ==} + cpu: [x64] + os: [darwin] + + '@rollup/rollup-freebsd-arm64@4.37.0': + resolution: {integrity: sha512-FOMXGmH15OmtQWEt174v9P1JqqhlgYge/bUjIbiVD1nI1NeJ30HYT9SJlZMqdo1uQFyt9cz748F1BHghWaDnVA==} + cpu: [arm64] + os: [freebsd] + + '@rollup/rollup-freebsd-x64@4.37.0': + resolution: {integrity: sha512-SZMxNttjPKvV14Hjck5t70xS3l63sbVwl98g3FlVVx2YIDmfUIy29jQrsw06ewEYQ8lQSuY9mpAPlmgRD2iSsA==} + cpu: [x64] + os: [freebsd] + + '@rollup/rollup-linux-arm-gnueabihf@4.37.0': + resolution: {integrity: sha512-hhAALKJPidCwZcj+g+iN+38SIOkhK2a9bqtJR+EtyxrKKSt1ynCBeqrQy31z0oWU6thRZzdx53hVgEbRkuI19w==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm-musleabihf@4.37.0': + resolution: {integrity: sha512-jUb/kmn/Gd8epbHKEqkRAxq5c2EwRt0DqhSGWjPFxLeFvldFdHQs/n8lQ9x85oAeVb6bHcS8irhTJX2FCOd8Ag==} + cpu: [arm] + os: [linux] + + '@rollup/rollup-linux-arm64-gnu@4.37.0': + resolution: {integrity: sha512-oNrJxcQT9IcbcmKlkF+Yz2tmOxZgG9D9GRq+1OE6XCQwCVwxixYAa38Z8qqPzQvzt1FCfmrHX03E0pWoXm1DqA==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-arm64-musl@4.37.0': + resolution: {integrity: sha512-pfxLBMls+28Ey2enpX3JvjEjaJMBX5XlPCZNGxj4kdJyHduPBXtxYeb8alo0a7bqOoWZW2uKynhHxF/MWoHaGQ==} + cpu: [arm64] + os: [linux] + + '@rollup/rollup-linux-loongarch64-gnu@4.37.0': + resolution: {integrity: sha512-yCE0NnutTC/7IGUq/PUHmoeZbIwq3KRh02e9SfFh7Vmc1Z7atuJRYWhRME5fKgT8aS20mwi1RyChA23qSyRGpA==} + cpu: [loong64] + os: [linux] + + '@rollup/rollup-linux-powerpc64le-gnu@4.37.0': + resolution: {integrity: sha512-NxcICptHk06E2Lh3a4Pu+2PEdZ6ahNHuK7o6Np9zcWkrBMuv21j10SQDJW3C9Yf/A/P7cutWoC/DptNLVsZ0VQ==} + cpu: [ppc64] + os: [linux] + + '@rollup/rollup-linux-riscv64-gnu@4.37.0': + resolution: {integrity: sha512-PpWwHMPCVpFZLTfLq7EWJWvrmEuLdGn1GMYcm5MV7PaRgwCEYJAwiN94uBuZev0/J/hFIIJCsYw4nLmXA9J7Pw==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-riscv64-musl@4.37.0': + resolution: {integrity: sha512-DTNwl6a3CfhGTAOYZ4KtYbdS8b+275LSLqJVJIrPa5/JuIufWWZ/QFvkxp52gpmguN95eujrM68ZG+zVxa8zHA==} + cpu: [riscv64] + os: [linux] + + '@rollup/rollup-linux-s390x-gnu@4.37.0': + resolution: {integrity: sha512-hZDDU5fgWvDdHFuExN1gBOhCuzo/8TMpidfOR+1cPZJflcEzXdCy1LjnklQdW8/Et9sryOPJAKAQRw8Jq7Tg+A==} + cpu: [s390x] + os: [linux] + + '@rollup/rollup-linux-x64-gnu@4.37.0': + resolution: {integrity: sha512-pKivGpgJM5g8dwj0ywBwe/HeVAUSuVVJhUTa/URXjxvoyTT/AxsLTAbkHkDHG7qQxLoW2s3apEIl26uUe08LVQ==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-linux-x64-musl@4.37.0': + resolution: {integrity: sha512-E2lPrLKE8sQbY/2bEkVTGDEk4/49UYRVWgj90MY8yPjpnGBQ+Xi1Qnr7b7UIWw1NOggdFQFOLZ8+5CzCiz143w==} + cpu: [x64] + os: [linux] + + '@rollup/rollup-win32-arm64-msvc@4.37.0': + resolution: {integrity: sha512-Jm7biMazjNzTU4PrQtr7VS8ibeys9Pn29/1bm4ph7CP2kf21950LgN+BaE2mJ1QujnvOc6p54eWWiVvn05SOBg==} + cpu: [arm64] + os: [win32] + + '@rollup/rollup-win32-ia32-msvc@4.37.0': + resolution: {integrity: sha512-e3/1SFm1OjefWICB2Ucstg2dxYDkDTZGDYgwufcbsxTHyqQps1UQf33dFEChBNmeSsTOyrjw2JJq0zbG5GF6RA==} + cpu: [ia32] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.37.0': + resolution: {integrity: sha512-LWbXUBwn/bcLx2sSsqy7pK5o+Nr+VCoRoAohfJ5C/aBio9nfJmGQqHAhU6pwxV/RmyTk5AqdySma7uwWGlmeuA==} + cpu: [x64] + os: [win32] + + '@sec-ant/readable-stream@0.4.1': + resolution: {integrity: sha512-831qok9r2t8AlxLko40y2ebgSDhenenCatLVeW/uBtnHPyhHOvG0C7TvfgecV+wHzIm5KUICgzmVpWS+IMEAeg==} + + '@sindresorhus/merge-streams@4.0.0': + resolution: {integrity: sha512-tlqY9xq5ukxTUZBmoOp+m61cqwQD5pHJtFY3Mn8CA8ps6yghLH/Hw8UPdqg4OLmFW3IFlcXnQNmo/dh8HzXYIQ==} + engines: {node: '>=18'} + + '@tsconfig/node22@22.0.1': + resolution: {integrity: sha512-VkgOa3n6jvs1p+r3DiwBqeEwGAwEvnVCg/hIjiANl5IEcqP3G0u5m8cBJspe1t9qjZRlZ7WFgqq5bJrGdgAKMg==} + + '@types/estree@1.0.6': + resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} + + '@types/estree@1.0.7': + resolution: {integrity: sha512-w28IoSUCJpidD/TGviZwwMJckNESJZXFu7NBZ5YJ4mEUnNraUn9Pm8HSZm/jDF1pDWYKspWE7oVphigUPRakIQ==} + + '@types/node@22.13.14': + resolution: {integrity: sha512-Zs/Ollc1SJ8nKUAgc7ivOEdIBM8JAKgrqqUYi2J997JuKO7/tpQC+WCetQ1sypiKCQWHdvdg9wBNpUPEWZae7w==} + + '@vitejs/plugin-vue@5.2.3': + resolution: {integrity: sha512-IYSLEQj4LgZZuoVpdSUCw3dIynTWQgPlaRP6iAvMle4My0HdYwr5g5wQAfwOeHQBmYwEkqF70nRpSilr6PoUDg==} + engines: {node: ^18.0.0 || >=20.0.0} + peerDependencies: + vite: ^5.0.0 || ^6.0.0 + vue: ^3.2.25 + + '@volar/language-core@2.4.12': + resolution: {integrity: sha512-RLrFdXEaQBWfSnYGVxvR2WrO6Bub0unkdHYIdC31HzIEqATIuuhRRzYu76iGPZ6OtA4Au1SnW0ZwIqPP217YhA==} + + '@volar/source-map@2.4.12': + resolution: {integrity: sha512-bUFIKvn2U0AWojOaqf63ER0N/iHIBYZPpNGogfLPQ68F5Eet6FnLlyho7BS0y2HJ1jFhSif7AcuTx1TqsCzRzw==} + + '@volar/typescript@2.4.12': + resolution: {integrity: sha512-HJB73OTJDgPc80K30wxi3if4fSsZZAOScbj2fcicMuOPoOkcf9NNAINb33o+DzhBdF9xTKC1gnPmIRDous5S0g==} + + '@vue/babel-helper-vue-transform-on@1.4.0': + resolution: {integrity: sha512-mCokbouEQ/ocRce/FpKCRItGo+013tHg7tixg3DUNS+6bmIchPt66012kBMm476vyEIJPafrvOf4E5OYj3shSw==} + + '@vue/babel-plugin-jsx@1.4.0': + resolution: {integrity: sha512-9zAHmwgMWlaN6qRKdrg1uKsBKHvnUU+Py+MOCTuYZBoZsopa90Di10QRjB+YPnVss0BZbG/H5XFwJY1fTxJWhA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + peerDependenciesMeta: + '@babel/core': + optional: true + + '@vue/babel-plugin-resolve-type@1.4.0': + resolution: {integrity: sha512-4xqDRRbQQEWHQyjlYSgZsWj44KfiF6D+ktCuXyZ8EnVDYV3pztmXJDf1HveAjUAXxAnR8daCQT51RneWWxtTyQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + + '@vue/compiler-core@3.5.13': + resolution: {integrity: sha512-oOdAkwqUfW1WqpwSYJce06wvt6HljgY3fGeM9NcVA1HaYOij3mZG9Rkysn0OHuyUAGMbEbARIpsG+LPVlBJ5/Q==} + + '@vue/compiler-dom@3.5.13': + resolution: {integrity: sha512-ZOJ46sMOKUjO3e94wPdCzQ6P1Lx/vhp2RSvfaab88Ajexs0AHeV0uasYhi99WPaogmBlRHNRuly8xV75cNTMDA==} + + '@vue/compiler-sfc@3.5.13': + resolution: {integrity: sha512-6VdaljMpD82w6c2749Zhf5T9u5uLBWKnVue6XWxprDobftnletJ8+oel7sexFfM3qIxNmVE7LSFGTpv6obNyaQ==} + + '@vue/compiler-ssr@3.5.13': + resolution: {integrity: sha512-wMH6vrYHxQl/IybKJagqbquvxpWCuVYpoUJfCqFZwa/JY1GdATAQ+TgVtgrwwMZ0D07QhA99rs/EAAWfvG6KpA==} + + '@vue/compiler-vue2@2.7.16': + resolution: {integrity: sha512-qYC3Psj9S/mfu9uVi5WvNZIzq+xnXMhOwbTFKKDD7b1lhpnn71jXSFdTQ+WsIEk0ONCd7VV2IMm7ONl6tbQ86A==} + + '@vue/devtools-core@7.7.2': + resolution: {integrity: sha512-lexREWj1lKi91Tblr38ntSsy6CvI8ba7u+jmwh2yruib/ltLUcsIzEjCnrkh1yYGGIKXbAuYV2tOG10fGDB9OQ==} + peerDependencies: + vue: ^3.0.0 + + '@vue/devtools-kit@7.7.2': + resolution: {integrity: sha512-CY0I1JH3Z8PECbn6k3TqM1Bk9ASWxeMtTCvZr7vb+CHi+X/QwQm5F1/fPagraamKMAHVfuuCbdcnNg1A4CYVWQ==} + + '@vue/devtools-shared@7.7.2': + resolution: {integrity: sha512-uBFxnp8gwW2vD6FrJB8JZLUzVb6PNRG0B0jBnHsOH8uKyva2qINY8PTF5Te4QlTbMDqU5K6qtJDr6cNsKWhbOA==} + + '@vue/language-core@2.2.8': + resolution: {integrity: sha512-rrzB0wPGBvcwaSNRriVWdNAbHQWSf0NlGqgKHK5mEkXpefjUlVRP62u03KvwZpvKVjRnBIQ/Lwre+Mx9N6juUQ==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + '@vue/reactivity@3.5.13': + resolution: {integrity: sha512-NaCwtw8o48B9I6L1zl2p41OHo/2Z4wqYGGIK1Khu5T7yxrn+ATOixn/Udn2m+6kZKB/J7cuT9DbWWhRxqixACg==} + + '@vue/runtime-core@3.5.13': + resolution: {integrity: sha512-Fj4YRQ3Az0WTZw1sFe+QDb0aXCerigEpw418pw1HBUKFtnQHWzwojaukAs2X/c9DQz4MQ4bsXTGlcpGxU/RCIw==} + + '@vue/runtime-dom@3.5.13': + resolution: {integrity: sha512-dLaj94s93NYLqjLiyFzVs9X6dWhTdAlEAciC3Moq7gzAc13VJUdCnjjRurNM6uTLFATRHexHCTu/Xp3eW6yoog==} + + '@vue/server-renderer@3.5.13': + resolution: {integrity: sha512-wAi4IRJV/2SAW3htkTlB+dHeRmpTiVIK1OGLWV1yeStVSebSQQOwGwIq0D3ZIoBj2C2qpgz5+vX9iEBkTdk5YA==} + peerDependencies: + vue: 3.5.13 + + '@vue/shared@3.5.13': + resolution: {integrity: sha512-/hnE/qP5ZoGpol0a5mDi45bOd7t3tjYJBjsgCsivow7D48cJeV5l05RD82lPqi7gRiphZM37rnhW1l6ZoCNNnQ==} + + '@vue/tsconfig@0.7.0': + resolution: {integrity: sha512-ku2uNz5MaZ9IerPPUyOHzyjhXoX2kVJaVf7hL315DC17vS6IiZRmmCPfggNbU16QTvM80+uYYy3eYJB59WCtvg==} + peerDependencies: + typescript: 5.x + vue: ^3.4.0 + peerDependenciesMeta: + typescript: + optional: true + vue: + optional: true + + alien-signals@1.0.10: + resolution: {integrity: sha512-pBrgovDvA/c55/aA+ar5pxNCvjQB5IlODtpOQXmUyrpclWIsHmUMsfIuCWsSU/l1iLU2O3ZhICdPaYTsuvGu8Q==} + + ansi-regex@5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + ansi-regex@6.1.0: + resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} + engines: {node: '>=12'} + + ansi-styles@4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + + ansi-styles@6.2.1: + resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + engines: {node: '>=12'} + + any-promise@1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + + anymatch@3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} + engines: {node: '>= 8'} + + arg@5.0.2: + resolution: {integrity: sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==} + + asynckit@0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + + autoprefixer@10.4.21: + resolution: {integrity: sha512-O+A6LWV5LDHSJD3LjHYoNi4VLsj/Whi7k6zG12xTYaU4cQ8oxQGckXNX8cRHK5yOZ/ppVHe0ZBXGzSV9jXdVbQ==} + engines: {node: ^10 || ^12 || >=14} + hasBin: true + peerDependencies: + postcss: ^8.1.0 + + axios@1.8.4: + resolution: {integrity: sha512-eBSYY4Y68NNlHbHBMdeDmKNtDgXWhQsJcGqzO3iLUM0GraQFSS9cVgPX5I9b3lbdFKyYoAEGAZF1DwhTaljNAw==} + + balanced-match@1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + binary-extensions@2.3.0: + resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} + engines: {node: '>=8'} + + birpc@0.2.19: + resolution: {integrity: sha512-5WeXXAvTmitV1RqJFppT5QtUiz2p1mRSYU000Jkft5ZUCLJIk4uQriYNO50HknxKwM6jd8utNc66K1qGIwwWBQ==} + + brace-expansion@2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + + braces@3.0.3: + resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==} + engines: {node: '>=8'} + + browserslist@4.24.4: + resolution: {integrity: sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + + bundle-name@4.1.0: + resolution: {integrity: sha512-tjwM5exMg6BGRI+kNmTntNsvdZS1X8BFYS6tnJ2hdH0kVxM6/eVZ2xy+FqStSWvYmtfFMDLIxurorHwDKfDz5Q==} + engines: {node: '>=18'} + + call-bind-apply-helpers@1.0.2: + resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==} + engines: {node: '>= 0.4'} + + camelcase-css@2.0.1: + resolution: {integrity: sha512-QOSvevhslijgYwRx6Rv7zKdMF8lbRmx+uQGx2+vDc+KI/eBnsy9kit5aj23AgGu3pa4t9AgwbnXWqS+iOY+2aA==} + engines: {node: '>= 6'} + + caniuse-lite@1.0.30001707: + resolution: {integrity: sha512-3qtRjw/HQSMlDWf+X79N206fepf4SOOU6SQLMaq/0KkZLmSjPxAkBOQQ+FxbHKfHmYLZFfdWsO3KA90ceHPSnw==} + + chokidar@3.6.0: + resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} + engines: {node: '>= 8.10.0'} + + color-convert@2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + + color-name@1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + combined-stream@1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + + commander@4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + + convert-source-map@2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + + copy-anything@3.0.5: + resolution: {integrity: sha512-yCEafptTtb4bk7GLEQoM8KVJpxAfdBJYaXyzQEgQQQgYrZiDp8SJmGKlYza6CYjEDNstAdNdKA3UuoULlEbS6w==} + engines: {node: '>=12.13'} + + cross-spawn@7.0.6: + resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} + engines: {node: '>= 8'} + + cssesc@3.0.0: + resolution: {integrity: sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==} + engines: {node: '>=4'} + hasBin: true + + csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + + de-indent@1.0.2: + resolution: {integrity: sha512-e/1zu3xH5MQryN2zdVaF0OrdNLUbvWxzMbi+iNA6Bky7l1RoP8a2fIbRocyHclXt/arDrrR6lL3TqFD9pMQTsg==} + + debug@4.4.0: + resolution: {integrity: sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + default-browser-id@5.0.0: + resolution: {integrity: sha512-A6p/pu/6fyBcA1TRz/GqWYPViplrftcW2gZC9q79ngNCKAeR/X3gcEdXQHl4KNXV+3wgIJ1CPkJQ3IHM6lcsyA==} + engines: {node: '>=18'} + + default-browser@5.2.1: + resolution: {integrity: sha512-WY/3TUME0x3KPYdRRxEJJvXRHV4PyPoUsxtZa78lwItwRQRHhd2U9xOscaT/YTf8uCXIAjeJOFBVEh/7FtD8Xg==} + engines: {node: '>=18'} + + define-lazy-prop@3.0.0: + resolution: {integrity: sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==} + engines: {node: '>=12'} + + delayed-stream@1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + + didyoumean@1.2.2: + resolution: {integrity: sha512-gxtyfqMg7GKyhQmb056K7M3xszy/myH8w+B4RT+QXBQsvAOdc3XymqDDPHx1BgPgsdAA5SIifona89YtRATDzw==} + + dlv@1.1.3: + resolution: {integrity: sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==} + + dunder-proto@1.0.1: + resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} + engines: {node: '>= 0.4'} + + eastasianwidth@0.2.0: + resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} + + electron-to-chromium@1.5.128: + resolution: {integrity: sha512-bo1A4HH/NS522Ws0QNFIzyPcyUUNV/yyy70Ho1xqfGYzPUme2F/xr4tlEOuM6/A538U1vDA7a4XfCd1CKRegKQ==} + + emoji-regex@8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + emoji-regex@9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + + entities@4.5.0: + resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==} + engines: {node: '>=0.12'} + + error-stack-parser-es@0.1.5: + resolution: {integrity: sha512-xHku1X40RO+fO8yJ8Wh2f2rZWVjqyhb1zgq1yZ8aZRQkv6OOKhKWRUaht3eSCUbAOBaKIgM+ykwFLE+QUxgGeg==} + + es-define-property@1.0.1: + resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==} + engines: {node: '>= 0.4'} + + es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + + es-object-atoms@1.1.1: + resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} + engines: {node: '>= 0.4'} + + es-set-tostringtag@2.1.0: + resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==} + engines: {node: '>= 0.4'} + + esbuild@0.25.1: + resolution: {integrity: sha512-BGO5LtrGC7vxnqucAe/rmvKdJllfGaYWdyABvyMoXQlfYMb2bbRuReWR5tEGE//4LcNJj9XrkovTqNYRFZHAMQ==} + engines: {node: '>=18'} + hasBin: true + + escalade@3.2.0: + resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} + engines: {node: '>=6'} + + estree-walker@2.0.2: + resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} + + execa@9.5.2: + resolution: {integrity: sha512-EHlpxMCpHWSAh1dgS6bVeoLAXGnJNdR93aabr4QCGbzOM73o5XmRfM/e5FUqsw3aagP8S8XEWUWFAxnRBnAF0Q==} + engines: {node: ^18.19.0 || >=20.5.0} + + fast-glob@3.3.3: + resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} + engines: {node: '>=8.6.0'} + + fastq@1.19.1: + resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} + + figures@6.1.0: + resolution: {integrity: sha512-d+l3qxjSesT4V7v2fh+QnmFnUWv9lSpjarhShNTgBOfA0ttejbQUAlHLitbjkoRiDulW0OPoQPYIGhIC8ohejg==} + engines: {node: '>=18'} + + fill-range@7.1.1: + resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==} + engines: {node: '>=8'} + + follow-redirects@1.15.9: + resolution: {integrity: sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + + foreground-child@3.3.1: + resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==} + engines: {node: '>=14'} + + form-data@4.0.2: + resolution: {integrity: sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==} + engines: {node: '>= 6'} + + fraction.js@4.3.7: + resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==} + + fs-extra@11.3.0: + resolution: {integrity: sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew==} + engines: {node: '>=14.14'} + + fsevents@2.3.3: + resolution: {integrity: sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + + function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + + gensync@1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + get-intrinsic@1.3.0: + resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==} + engines: {node: '>= 0.4'} + + get-proto@1.0.1: + resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} + engines: {node: '>= 0.4'} + + get-stream@9.0.1: + resolution: {integrity: sha512-kVCxPF3vQM/N0B1PmoqVUqgHP+EeVjmZSQn+1oCRPxd2P21P2F19lIgbR3HBosbB1PUhOAoctJnfEn2GbN2eZA==} + engines: {node: '>=18'} + + glob-parent@5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + + glob-parent@6.0.2: + resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} + engines: {node: '>=10.13.0'} + + glob@10.4.5: + resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} + hasBin: true + + globals@11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + + gopd@1.2.0: + resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} + engines: {node: '>= 0.4'} + + graceful-fs@4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} + + has-symbols@1.1.0: + resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==} + engines: {node: '>= 0.4'} + + has-tostringtag@1.0.2: + resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==} + engines: {node: '>= 0.4'} + + hasown@2.0.2: + resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} + engines: {node: '>= 0.4'} + + he@1.2.0: + resolution: {integrity: sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==} + hasBin: true + + hookable@5.5.3: + resolution: {integrity: sha512-Yc+BQe8SvoXH1643Qez1zqLRmbA5rCL+sSmk6TVos0LWVfNIB7PGncdlId77WzLGSIB5KaWgTaNTs2lNVEI6VQ==} + + human-signals@8.0.0: + resolution: {integrity: sha512-/1/GPCpDUCCYwlERiYjxoczfP0zfvZMU/OWgQPMya9AbAE24vseigFdhAMObpc8Q4lc/kjutPfUddDYyAmejnA==} + engines: {node: '>=18.18.0'} + + is-binary-path@2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + + is-core-module@2.16.1: + resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==} + engines: {node: '>= 0.4'} + + is-docker@3.0.0: + resolution: {integrity: sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + hasBin: true + + is-extglob@2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + is-fullwidth-code-point@3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + is-glob@4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + + is-inside-container@1.0.0: + resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} + engines: {node: '>=14.16'} + hasBin: true + + is-number@7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + + is-plain-obj@4.1.0: + resolution: {integrity: sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==} + engines: {node: '>=12'} + + is-stream@4.0.1: + resolution: {integrity: sha512-Dnz92NInDqYckGEUJv689RbRiTSEHCQ7wOVeALbkOz999YpqT46yMRIGtSNl2iCL1waAZSx40+h59NV/EwzV/A==} + engines: {node: '>=18'} + + is-unicode-supported@2.1.0: + resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==} + engines: {node: '>=18'} + + is-what@4.1.16: + resolution: {integrity: sha512-ZhMwEosbFJkA0YhFnNDgTM4ZxDRsS6HqTo7qsZM08fehyRYIYa0yHu5R6mgo1n/8MgaPBXiPimPD77baVFYg+A==} + engines: {node: '>=12.13'} + + is-wsl@3.1.0: + resolution: {integrity: sha512-UcVfVfaK4Sc4m7X3dUSoHoozQGBEFeDC+zVo06t98xe8CzHSZZBekNXH+tu0NalHolcJ/QAGqS46Hef7QXBIMw==} + engines: {node: '>=16'} + + isexe@2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + isexe@3.1.1: + resolution: {integrity: sha512-LpB/54B+/2J5hqQ7imZHfdU31OlgQqx7ZicVlkm9kzg9/w8GKLEcFfJl/t7DCEDueOyBAD6zCCwTO6Fzs0NoEQ==} + engines: {node: '>=16'} + + jackspeak@3.4.3: + resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} + + jiti@1.21.7: + resolution: {integrity: sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==} + hasBin: true + + js-tokens@4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + jsesc@3.1.0: + resolution: {integrity: sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA==} + engines: {node: '>=6'} + hasBin: true + + json-parse-even-better-errors@4.0.0: + resolution: {integrity: sha512-lR4MXjGNgkJc7tkQ97kb2nuEMnNCyU//XYVH0MKTGcXEiSudQ5MKGKen3C5QubYy0vmq+JGitUg92uuywGEwIA==} + engines: {node: ^18.17.0 || >=20.5.0} + + json5@2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + + jsonfile@6.1.0: + resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + + kolorist@1.8.0: + resolution: {integrity: sha512-Y+60/zizpJ3HRH8DCss+q95yr6145JXZo46OTpFvDZWLfRCE4qChOyk1b26nMaNpfHHgxagk9dXT5OP0Tfe+dQ==} + + lilconfig@3.1.3: + resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} + engines: {node: '>=14'} + + lines-and-columns@1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + + lru-cache@10.4.3: + resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} + + lru-cache@5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + + magic-string@0.30.17: + resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + + math-intrinsics@1.1.0: + resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} + engines: {node: '>= 0.4'} + + memorystream@0.3.1: + resolution: {integrity: sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==} + engines: {node: '>= 0.10.0'} + + merge2@1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + + micromatch@4.0.8: + resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} + engines: {node: '>=8.6'} + + mime-db@1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + + mime-types@2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + + minimatch@9.0.5: + resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} + engines: {node: '>=16 || 14 >=14.17'} + + minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} + engines: {node: '>=16 || 14 >=14.17'} + + mitt@3.0.1: + resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + + mrmime@2.0.1: + resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} + engines: {node: '>=10'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + muggle-string@0.4.1: + resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==} + + mz@2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + + nanoid@3.3.11: + resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + + nanoid@5.1.5: + resolution: {integrity: sha512-Ir/+ZpE9fDsNH0hQ3C68uyThDXzYcim2EqcZ8zn8Chtt1iylPT9xXJB0kPCnqzgcEGikO9RxSrh63MsmVCU7Fw==} + engines: {node: ^18 || >=20} + hasBin: true + + node-releases@2.0.19: + resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} + + normalize-path@3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + + normalize-range@0.1.2: + resolution: {integrity: sha512-bdok/XvKII3nUpklnV6P2hxtMNrCboOjAcyBuQnWEhO665FwrSNRxU+AqpsyvO6LgGYPspN+lu5CLtw4jPRKNA==} + engines: {node: '>=0.10.0'} + + npm-normalize-package-bin@4.0.0: + resolution: {integrity: sha512-TZKxPvItzai9kN9H/TkmCtx/ZN/hvr3vUycjlfmH0ootY9yFBzNOpiXAdIn1Iteqsvk4lQn6B5PTrt+n6h8k/w==} + engines: {node: ^18.17.0 || >=20.5.0} + + npm-run-all2@7.0.2: + resolution: {integrity: sha512-7tXR+r9hzRNOPNTvXegM+QzCuMjzUIIq66VDunL6j60O4RrExx32XUhlrS7UK4VcdGw5/Wxzb3kfNcFix9JKDA==} + engines: {node: ^18.17.0 || >=20.5.0, npm: '>= 9'} + hasBin: true + + npm-run-path@6.0.0: + resolution: {integrity: sha512-9qny7Z9DsQU8Ou39ERsPU4OZQlSTP47ShQzuKZ6PRXpYLtIFgl/DEBYEXKlvcEa+9tHVcK8CF81Y2V72qaZhWA==} + engines: {node: '>=18'} + + object-assign@4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + + object-hash@3.0.0: + resolution: {integrity: sha512-RSn9F68PjH9HqtltsSnqYC1XXoWe9Bju5+213R98cNGttag9q9yAOTzdbsqvIa7aNm5WffBZFpWYr2aWrklWAw==} + engines: {node: '>= 6'} + + open@10.1.0: + resolution: {integrity: sha512-mnkeQ1qP5Ue2wd+aivTD3NHd/lZ96Lu0jgf0pwktLPtx6cTZiH7tyeGRRHs0zX0rbrahXPnXlUnbeXyaBBuIaw==} + engines: {node: '>=18'} + + package-json-from-dist@1.0.1: + resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + + parse-ms@4.0.0: + resolution: {integrity: sha512-TXfryirbmq34y8QBwgqCVLi+8oA3oWx2eAnSn62ITyEhEYaWRlVZ2DvMM9eZbMs/RfxPu/PK/aBLyGj4IrqMHw==} + engines: {node: '>=18'} + + path-browserify@1.0.1: + resolution: {integrity: sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==} + + path-key@3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + path-key@4.0.0: + resolution: {integrity: sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==} + engines: {node: '>=12'} + + path-parse@1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + + path-scurry@1.11.1: + resolution: {integrity: sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==} + engines: {node: '>=16 || 14 >=14.18'} + + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + + perfect-debounce@1.0.0: + resolution: {integrity: sha512-xCy9V055GLEqoFaHoC1SoLIaLmWctgCUaBaWxDZ7/Zx4CTyX7cJQLJOok/orfjZAh9kEYpjJa4d0KcJmCbctZA==} + + picocolors@1.1.1: + resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} + + picomatch@2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + + picomatch@4.0.2: + resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} + engines: {node: '>=12'} + + pidtree@0.6.0: + resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} + engines: {node: '>=0.10'} + hasBin: true + + pify@2.3.0: + resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} + engines: {node: '>=0.10.0'} + + pirates@4.0.7: + resolution: {integrity: sha512-TfySrs/5nm8fQJDcBDuUng3VOUKsd7S+zqvbOTiGXHfxX4wK31ard+hoNuvkicM/2YFzlpDgABOevKSsB4G/FA==} + engines: {node: '>= 6'} + + postcss-import@15.1.0: + resolution: {integrity: sha512-hpr+J05B2FVYUAXHeK1YyI267J/dDDhMU6B6civm8hSY1jYJnBXxzKDKDswzJmtLHryrjhnDjqqp/49t8FALew==} + engines: {node: '>=14.0.0'} + peerDependencies: + postcss: ^8.0.0 + + postcss-js@4.0.1: + resolution: {integrity: sha512-dDLF8pEO191hJMtlHFPRa8xsizHaM82MLfNkUHdUtVEV3tgTp5oj+8qbEqYM57SLfc74KSbw//4SeJma2LRVIw==} + engines: {node: ^12 || ^14 || >= 16} + peerDependencies: + postcss: ^8.4.21 + + postcss-load-config@4.0.2: + resolution: {integrity: sha512-bSVhyJGL00wMVoPUzAVAnbEoWyqRxkjv64tUl427SKnPrENtq6hJwUojroMz2VB+Q1edmi4IfrAPpami5VVgMQ==} + engines: {node: '>= 14'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + + postcss-nested@6.2.0: + resolution: {integrity: sha512-HQbt28KulC5AJzG+cZtj9kvKB93CFCdLvog1WFLf1D+xmMvPGlBstkpTEZfK5+AN9hfJocyBFCNiqyS48bpgzQ==} + engines: {node: '>=12.0'} + peerDependencies: + postcss: ^8.2.14 + + postcss-selector-parser@6.1.2: + resolution: {integrity: sha512-Q8qQfPiZ+THO/3ZrOrO0cJJKfpYCagtMUkXbnEfmgUjwXg6z/WBeOyS9APBBPCTSiDV+s4SwQGu8yFsiMRIudg==} + engines: {node: '>=4'} + + postcss-value-parser@4.2.0: + resolution: {integrity: sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==} + + postcss@8.5.3: + resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} + engines: {node: ^10 || ^12 || >=14} + + pretty-ms@9.2.0: + resolution: {integrity: sha512-4yf0QO/sllf/1zbZWYnvWw3NxCQwLXKzIj0G849LSufP15BXKM0rbD2Z3wVnkMfjdn/CB0Dpp444gYAACdsplg==} + engines: {node: '>=18'} + + proxy-from-env@1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + + queue-microtask@1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + + read-cache@1.0.0: + resolution: {integrity: sha512-Owdv/Ft7IjOgm/i0xvNDZ1LrRANRfew4b2prF3OWMQLxLfu3bS8FVhCsrSCMK4lR56Y9ya+AThoTpDCTxCmpRA==} + + read-package-json-fast@4.0.0: + resolution: {integrity: sha512-qpt8EwugBWDw2cgE2W+/3oxC+KTez2uSVR8JU9Q36TXPAGCaozfQUs59v4j4GFpWTaw0i6hAZSvOmu1J0uOEUg==} + engines: {node: ^18.17.0 || >=20.5.0} + + readdirp@3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + + resolve@1.22.10: + resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + engines: {node: '>= 0.4'} + hasBin: true + + reusify@1.1.0: + resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + + rfdc@1.4.1: + resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} + + rollup@4.37.0: + resolution: {integrity: sha512-iAtQy/L4QFU+rTJ1YUjXqJOJzuwEghqWzCEYD2FEghT7Gsy1VdABntrO4CLopA5IkflTyqNiLNwPcOJ3S7UKLg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + + run-applescript@7.0.0: + resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==} + engines: {node: '>=18'} + + run-parallel@1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + + semver@6.3.1: + resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true + + shebang-command@2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + + shebang-regex@3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + shell-quote@1.8.2: + resolution: {integrity: sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==} + engines: {node: '>= 0.4'} + + signal-exit@4.1.0: + resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} + engines: {node: '>=14'} + + sirv@3.0.1: + resolution: {integrity: sha512-FoqMu0NCGBLCcAkS1qA+XJIQTR6/JHfQXl+uGteNCQ76T91DMUjPa9xfmeqMY3z80nLSg9yQmNjK0Px6RWsH/A==} + engines: {node: '>=18'} + + source-map-js@1.2.1: + resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} + engines: {node: '>=0.10.0'} + + speakingurl@14.0.1: + resolution: {integrity: sha512-1POYv7uv2gXoyGFpBCmpDVSNV74IfsWlDW216UPjbWufNf+bSU6GdbDsxdcxtfwb4xlI3yxzOTKClUosxARYrQ==} + engines: {node: '>=0.10.0'} + + string-width@4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + + string-width@5.1.2: + resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} + engines: {node: '>=12'} + + strip-ansi@6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + + strip-ansi@7.1.0: + resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + engines: {node: '>=12'} + + strip-final-newline@4.0.0: + resolution: {integrity: sha512-aulFJcD6YK8V1G7iRB5tigAP4TsHBZZrOV8pjV++zdUwmeV8uzbY7yn6h9MswN62adStNZFuCIx4haBnRuMDaw==} + engines: {node: '>=18'} + + sucrase@3.35.0: + resolution: {integrity: sha512-8EbVDiu9iN/nESwxeSxDKe0dunta1GOlHufmSSXxMD2z2/tMZpDMpvXQGsc+ajGo8y2uYUmixaSRUc/QPoQ0GA==} + engines: {node: '>=16 || 14 >=14.17'} + hasBin: true + + superjson@2.2.2: + resolution: {integrity: sha512-5JRxVqC8I8NuOUjzBbvVJAKNM8qoVuH0O77h4WInc/qC2q5IreqKxYwgkga3PfA22OayK2ikceb/B26dztPl+Q==} + engines: {node: '>=16'} + + supports-preserve-symlinks-flag@1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + + tailwindcss@3.4.17: + resolution: {integrity: sha512-w33E2aCvSDP0tW9RZuNXadXlkHXqFzSkQew/aIa2i/Sj8fThxwovwlXHSPXTbAHwEIhBFXAedUhP2tueAKP8Og==} + engines: {node: '>=14.0.0'} + hasBin: true + + thenify-all@1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + + thenify@3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + + to-regex-range@5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + + totalist@3.0.1: + resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} + engines: {node: '>=6'} + + ts-interface-checker@0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + + typescript@5.8.2: + resolution: {integrity: sha512-aJn6wq13/afZp/jT9QZmwEjDqqvSGp1VT5GVg+f/t6/oVyrgXM6BY1h9BRh/O5p3PlUPAe+WuiEZOmb/49RqoQ==} + engines: {node: '>=14.17'} + hasBin: true + + undici-types@6.20.0: + resolution: {integrity: sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==} + + unicorn-magic@0.3.0: + resolution: {integrity: sha512-+QBBXBCvifc56fsbuxZQ6Sic3wqqc3WWaqxs58gvJrcOuN83HGTCwz3oS5phzU9LthRNE9VrJCFCLUgHeeFnfA==} + engines: {node: '>=18'} + + universalify@2.0.1: + resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} + engines: {node: '>= 10.0.0'} + + update-browserslist-db@1.1.3: + resolution: {integrity: sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + + util-deprecate@1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + + vite-hot-client@0.2.4: + resolution: {integrity: sha512-a1nzURqO7DDmnXqabFOliz908FRmIppkBKsJthS8rbe8hBEXwEwe4C3Pp33Z1JoFCYfVL4kTOMLKk0ZZxREIeA==} + peerDependencies: + vite: ^2.6.0 || ^3.0.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.0-0 + + vite-plugin-inspect@0.8.9: + resolution: {integrity: sha512-22/8qn+LYonzibb1VeFZmISdVao5kC22jmEKm24vfFE8siEn47EpVcCLYMv6iKOYMJfjSvSJfueOwcFCkUnV3A==} + engines: {node: '>=14'} + peerDependencies: + '@nuxt/kit': '*' + vite: ^3.1.0 || ^4.0.0 || ^5.0.0-0 || ^6.0.1 + peerDependenciesMeta: + '@nuxt/kit': + optional: true + + vite-plugin-vue-devtools@7.7.2: + resolution: {integrity: sha512-5V0UijQWiSBj32blkyPEqIbzc6HO9c1bwnBhx+ay2dzU0FakH+qMdNUT8nF9BvDE+i6I1U8CqCuJiO20vKEdQw==} + engines: {node: '>=v14.21.3'} + peerDependencies: + vite: ^3.1.0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0 + + vite-plugin-vue-inspector@5.3.1: + resolution: {integrity: sha512-cBk172kZKTdvGpJuzCCLg8lJ909wopwsu3Ve9FsL1XsnLBiRT9U3MePcqrgGHgCX2ZgkqZmAGR8taxw+TV6s7A==} + peerDependencies: + vite: ^3.0.0-0 || ^4.0.0-0 || ^5.0.0-0 || ^6.0.0-0 + + vite@6.2.3: + resolution: {integrity: sha512-IzwM54g4y9JA/xAeBPNaDXiBF8Jsgl3VBQ2YQ/wOY6fyW3xMdSoltIV3Bo59DErdqdE6RxUfv8W69DvUorE4Eg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + jiti: '>=1.21.0' + less: '*' + lightningcss: ^1.21.0 + sass: '*' + sass-embedded: '*' + stylus: '*' + sugarss: '*' + terser: ^5.16.0 + tsx: ^4.8.1 + yaml: ^2.4.2 + peerDependenciesMeta: + '@types/node': + optional: true + jiti: + optional: true + less: + optional: true + lightningcss: + optional: true + sass: + optional: true + sass-embedded: + optional: true + stylus: + optional: true + sugarss: + optional: true + terser: + optional: true + tsx: + optional: true + yaml: + optional: true + + vscode-uri@3.1.0: + resolution: {integrity: sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ==} + + vue-tsc@2.2.8: + resolution: {integrity: sha512-jBYKBNFADTN+L+MdesNX/TB3XuDSyaWynKMDgR+yCSln0GQ9Tfb7JS2lr46s2LiFUT1WsmfWsSvIElyxzOPqcQ==} + hasBin: true + peerDependencies: + typescript: '>=5.0.0' + + vue@3.5.13: + resolution: {integrity: sha512-wmeiSMxkZCSc+PM2w2VRsOYAZC8GdipNFRTsLSfodVqI9mbejKeXEGr8SckuLnrQPGe3oJN5c3K0vpoU9q/wCQ==} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + + which@2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + + which@5.0.0: + resolution: {integrity: sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ==} + engines: {node: ^18.17.0 || >=20.5.0} + hasBin: true + + wrap-ansi@7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + + wrap-ansi@8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + + yallist@3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + + yaml@2.7.0: + resolution: {integrity: sha512-+hSoy/QHluxmC9kCIJyL/uyFmLmc+e5CFR5Wa+bpIhIj85LVb9ZH2nVnqrHoSvKogwODv0ClqZkmiSSaIH5LTA==} + engines: {node: '>= 14'} + hasBin: true + + yoctocolors@2.1.1: + resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==} + engines: {node: '>=18'} + +snapshots: + + '@alloc/quick-lru@5.2.0': {} + + '@ampproject/remapping@2.3.0': + dependencies: + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + + '@antfu/utils@0.7.10': {} + + '@babel/code-frame@7.26.2': + dependencies: + '@babel/helper-validator-identifier': 7.25.9 + js-tokens: 4.0.0 + picocolors: 1.1.1 + + '@babel/compat-data@7.26.8': {} + + '@babel/core@7.26.10': + dependencies: + '@ampproject/remapping': 2.3.0 + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.27.0 + '@babel/helper-compilation-targets': 7.27.0 + '@babel/helper-module-transforms': 7.26.0(@babel/core@7.26.10) + '@babel/helpers': 7.27.0 + '@babel/parser': 7.27.0 + '@babel/template': 7.27.0 + '@babel/traverse': 7.27.0 + '@babel/types': 7.27.0 + convert-source-map: 2.0.0 + debug: 4.4.0 + gensync: 1.0.0-beta.2 + json5: 2.2.3 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/generator@7.27.0': + dependencies: + '@babel/parser': 7.27.0 + '@babel/types': 7.27.0 + '@jridgewell/gen-mapping': 0.3.8 + '@jridgewell/trace-mapping': 0.3.25 + jsesc: 3.1.0 + + '@babel/helper-annotate-as-pure@7.25.9': + dependencies: + '@babel/types': 7.27.0 + + '@babel/helper-compilation-targets@7.27.0': + dependencies: + '@babel/compat-data': 7.26.8 + '@babel/helper-validator-option': 7.25.9 + browserslist: 4.24.4 + lru-cache: 5.1.1 + semver: 6.3.1 + + '@babel/helper-create-class-features-plugin@7.27.0(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-member-expression-to-functions': 7.25.9 + '@babel/helper-optimise-call-expression': 7.25.9 + '@babel/helper-replace-supers': 7.26.5(@babel/core@7.26.10) + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/traverse': 7.27.0 + semver: 6.3.1 + transitivePeerDependencies: + - supports-color + + '@babel/helper-member-expression-to-functions@7.25.9': + dependencies: + '@babel/traverse': 7.27.0 + '@babel/types': 7.27.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-imports@7.25.9': + dependencies: + '@babel/traverse': 7.27.0 + '@babel/types': 7.27.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-module-transforms@7.26.0(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + '@babel/traverse': 7.27.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-optimise-call-expression@7.25.9': + dependencies: + '@babel/types': 7.27.0 + + '@babel/helper-plugin-utils@7.26.5': {} + + '@babel/helper-replace-supers@7.26.5(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-member-expression-to-functions': 7.25.9 + '@babel/helper-optimise-call-expression': 7.25.9 + '@babel/traverse': 7.27.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-skip-transparent-expression-wrappers@7.25.9': + dependencies: + '@babel/traverse': 7.27.0 + '@babel/types': 7.27.0 + transitivePeerDependencies: + - supports-color + + '@babel/helper-string-parser@7.25.9': {} + + '@babel/helper-validator-identifier@7.25.9': {} + + '@babel/helper-validator-option@7.25.9': {} + + '@babel/helpers@7.27.0': + dependencies: + '@babel/template': 7.27.0 + '@babel/types': 7.27.0 + + '@babel/parser@7.27.0': + dependencies: + '@babel/types': 7.27.0 + + '@babel/plugin-proposal-decorators@7.25.9(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-create-class-features-plugin': 7.27.0(@babel/core@7.26.10) + '@babel/helper-plugin-utils': 7.26.5 + '@babel/plugin-syntax-decorators': 7.25.9(@babel/core@7.26.10) + transitivePeerDependencies: + - supports-color + + '@babel/plugin-syntax-decorators@7.25.9(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-plugin-utils': 7.26.5 + + '@babel/plugin-syntax-import-attributes@7.26.0(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-plugin-utils': 7.26.5 + + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-plugin-utils': 7.26.5 + + '@babel/plugin-syntax-jsx@7.25.9(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-plugin-utils': 7.26.5 + + '@babel/plugin-syntax-typescript@7.25.9(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-plugin-utils': 7.26.5 + + '@babel/plugin-transform-typescript@7.27.0(@babel/core@7.26.10)': + dependencies: + '@babel/core': 7.26.10 + '@babel/helper-annotate-as-pure': 7.25.9 + '@babel/helper-create-class-features-plugin': 7.27.0(@babel/core@7.26.10) + '@babel/helper-plugin-utils': 7.26.5 + '@babel/helper-skip-transparent-expression-wrappers': 7.25.9 + '@babel/plugin-syntax-typescript': 7.25.9(@babel/core@7.26.10) + transitivePeerDependencies: + - supports-color + + '@babel/template@7.27.0': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/parser': 7.27.0 + '@babel/types': 7.27.0 + + '@babel/traverse@7.27.0': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/generator': 7.27.0 + '@babel/parser': 7.27.0 + '@babel/template': 7.27.0 + '@babel/types': 7.27.0 + debug: 4.4.0 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + '@babel/types@7.27.0': + dependencies: + '@babel/helper-string-parser': 7.25.9 + '@babel/helper-validator-identifier': 7.25.9 + + '@esbuild/aix-ppc64@0.25.1': + optional: true + + '@esbuild/android-arm64@0.25.1': + optional: true + + '@esbuild/android-arm@0.25.1': + optional: true + + '@esbuild/android-x64@0.25.1': + optional: true + + '@esbuild/darwin-arm64@0.25.1': + optional: true + + '@esbuild/darwin-x64@0.25.1': + optional: true + + '@esbuild/freebsd-arm64@0.25.1': + optional: true + + '@esbuild/freebsd-x64@0.25.1': + optional: true + + '@esbuild/linux-arm64@0.25.1': + optional: true + + '@esbuild/linux-arm@0.25.1': + optional: true + + '@esbuild/linux-ia32@0.25.1': + optional: true + + '@esbuild/linux-loong64@0.25.1': + optional: true + + '@esbuild/linux-mips64el@0.25.1': + optional: true + + '@esbuild/linux-ppc64@0.25.1': + optional: true + + '@esbuild/linux-riscv64@0.25.1': + optional: true + + '@esbuild/linux-s390x@0.25.1': + optional: true + + '@esbuild/linux-x64@0.25.1': + optional: true + + '@esbuild/netbsd-arm64@0.25.1': + optional: true + + '@esbuild/netbsd-x64@0.25.1': + optional: true + + '@esbuild/openbsd-arm64@0.25.1': + optional: true + + '@esbuild/openbsd-x64@0.25.1': + optional: true + + '@esbuild/sunos-x64@0.25.1': + optional: true + + '@esbuild/win32-arm64@0.25.1': + optional: true + + '@esbuild/win32-ia32@0.25.1': + optional: true + + '@esbuild/win32-x64@0.25.1': + optional: true + + '@isaacs/cliui@8.0.2': + dependencies: + string-width: 5.1.2 + string-width-cjs: string-width@4.2.3 + strip-ansi: 7.1.0 + strip-ansi-cjs: strip-ansi@6.0.1 + wrap-ansi: 8.1.0 + wrap-ansi-cjs: wrap-ansi@7.0.0 + + '@jridgewell/gen-mapping@0.3.8': + dependencies: + '@jridgewell/set-array': 1.2.1 + '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/trace-mapping': 0.3.25 + + '@jridgewell/resolve-uri@3.1.2': {} + + '@jridgewell/set-array@1.2.1': {} + + '@jridgewell/sourcemap-codec@1.5.0': {} + + '@jridgewell/trace-mapping@0.3.25': + dependencies: + '@jridgewell/resolve-uri': 3.1.2 + '@jridgewell/sourcemap-codec': 1.5.0 + + '@nodelib/fs.scandir@2.1.5': + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + + '@nodelib/fs.stat@2.0.5': {} + + '@nodelib/fs.walk@1.2.8': + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.19.1 + + '@pkgjs/parseargs@0.11.0': + optional: true + + '@polka/url@1.0.0-next.28': {} + + '@rollup/pluginutils@5.1.4(rollup@4.37.0)': + dependencies: + '@types/estree': 1.0.7 + estree-walker: 2.0.2 + picomatch: 4.0.2 + optionalDependencies: + rollup: 4.37.0 + + '@rollup/rollup-android-arm-eabi@4.37.0': + optional: true + + '@rollup/rollup-android-arm64@4.37.0': + optional: true + + '@rollup/rollup-darwin-arm64@4.37.0': + optional: true + + '@rollup/rollup-darwin-x64@4.37.0': + optional: true + + '@rollup/rollup-freebsd-arm64@4.37.0': + optional: true + + '@rollup/rollup-freebsd-x64@4.37.0': + optional: true + + '@rollup/rollup-linux-arm-gnueabihf@4.37.0': + optional: true + + '@rollup/rollup-linux-arm-musleabihf@4.37.0': + optional: true + + '@rollup/rollup-linux-arm64-gnu@4.37.0': + optional: true + + '@rollup/rollup-linux-arm64-musl@4.37.0': + optional: true + + '@rollup/rollup-linux-loongarch64-gnu@4.37.0': + optional: true + + '@rollup/rollup-linux-powerpc64le-gnu@4.37.0': + optional: true + + '@rollup/rollup-linux-riscv64-gnu@4.37.0': + optional: true + + '@rollup/rollup-linux-riscv64-musl@4.37.0': + optional: true + + '@rollup/rollup-linux-s390x-gnu@4.37.0': + optional: true + + '@rollup/rollup-linux-x64-gnu@4.37.0': + optional: true + + '@rollup/rollup-linux-x64-musl@4.37.0': + optional: true + + '@rollup/rollup-win32-arm64-msvc@4.37.0': + optional: true + + '@rollup/rollup-win32-ia32-msvc@4.37.0': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.37.0': + optional: true + + '@sec-ant/readable-stream@0.4.1': {} + + '@sindresorhus/merge-streams@4.0.0': {} + + '@tsconfig/node22@22.0.1': {} + + '@types/estree@1.0.6': {} + + '@types/estree@1.0.7': {} + + '@types/node@22.13.14': + dependencies: + undici-types: 6.20.0 + + '@vitejs/plugin-vue@5.2.3(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0))(vue@3.5.13(typescript@5.8.2))': + dependencies: + vite: 6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0) + vue: 3.5.13(typescript@5.8.2) + + '@volar/language-core@2.4.12': + dependencies: + '@volar/source-map': 2.4.12 + + '@volar/source-map@2.4.12': {} + + '@volar/typescript@2.4.12': + dependencies: + '@volar/language-core': 2.4.12 + path-browserify: 1.0.1 + vscode-uri: 3.1.0 + + '@vue/babel-helper-vue-transform-on@1.4.0': {} + + '@vue/babel-plugin-jsx@1.4.0(@babel/core@7.26.10)': + dependencies: + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-plugin-utils': 7.26.5 + '@babel/plugin-syntax-jsx': 7.25.9(@babel/core@7.26.10) + '@babel/template': 7.27.0 + '@babel/traverse': 7.27.0 + '@babel/types': 7.27.0 + '@vue/babel-helper-vue-transform-on': 1.4.0 + '@vue/babel-plugin-resolve-type': 1.4.0(@babel/core@7.26.10) + '@vue/shared': 3.5.13 + optionalDependencies: + '@babel/core': 7.26.10 + transitivePeerDependencies: + - supports-color + + '@vue/babel-plugin-resolve-type@1.4.0(@babel/core@7.26.10)': + dependencies: + '@babel/code-frame': 7.26.2 + '@babel/core': 7.26.10 + '@babel/helper-module-imports': 7.25.9 + '@babel/helper-plugin-utils': 7.26.5 + '@babel/parser': 7.27.0 + '@vue/compiler-sfc': 3.5.13 + transitivePeerDependencies: + - supports-color + + '@vue/compiler-core@3.5.13': + dependencies: + '@babel/parser': 7.27.0 + '@vue/shared': 3.5.13 + entities: 4.5.0 + estree-walker: 2.0.2 + source-map-js: 1.2.1 + + '@vue/compiler-dom@3.5.13': + dependencies: + '@vue/compiler-core': 3.5.13 + '@vue/shared': 3.5.13 + + '@vue/compiler-sfc@3.5.13': + dependencies: + '@babel/parser': 7.27.0 + '@vue/compiler-core': 3.5.13 + '@vue/compiler-dom': 3.5.13 + '@vue/compiler-ssr': 3.5.13 + '@vue/shared': 3.5.13 + estree-walker: 2.0.2 + magic-string: 0.30.17 + postcss: 8.5.3 + source-map-js: 1.2.1 + + '@vue/compiler-ssr@3.5.13': + dependencies: + '@vue/compiler-dom': 3.5.13 + '@vue/shared': 3.5.13 + + '@vue/compiler-vue2@2.7.16': + dependencies: + de-indent: 1.0.2 + he: 1.2.0 + + '@vue/devtools-core@7.7.2(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0))(vue@3.5.13(typescript@5.8.2))': + dependencies: + '@vue/devtools-kit': 7.7.2 + '@vue/devtools-shared': 7.7.2 + mitt: 3.0.1 + nanoid: 5.1.5 + pathe: 2.0.3 + vite-hot-client: 0.2.4(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0)) + vue: 3.5.13(typescript@5.8.2) + transitivePeerDependencies: + - vite + + '@vue/devtools-kit@7.7.2': + dependencies: + '@vue/devtools-shared': 7.7.2 + birpc: 0.2.19 + hookable: 5.5.3 + mitt: 3.0.1 + perfect-debounce: 1.0.0 + speakingurl: 14.0.1 + superjson: 2.2.2 + + '@vue/devtools-shared@7.7.2': + dependencies: + rfdc: 1.4.1 + + '@vue/language-core@2.2.8(typescript@5.8.2)': + dependencies: + '@volar/language-core': 2.4.12 + '@vue/compiler-dom': 3.5.13 + '@vue/compiler-vue2': 2.7.16 + '@vue/shared': 3.5.13 + alien-signals: 1.0.10 + minimatch: 9.0.5 + muggle-string: 0.4.1 + path-browserify: 1.0.1 + optionalDependencies: + typescript: 5.8.2 + + '@vue/reactivity@3.5.13': + dependencies: + '@vue/shared': 3.5.13 + + '@vue/runtime-core@3.5.13': + dependencies: + '@vue/reactivity': 3.5.13 + '@vue/shared': 3.5.13 + + '@vue/runtime-dom@3.5.13': + dependencies: + '@vue/reactivity': 3.5.13 + '@vue/runtime-core': 3.5.13 + '@vue/shared': 3.5.13 + csstype: 3.1.3 + + '@vue/server-renderer@3.5.13(vue@3.5.13(typescript@5.8.2))': + dependencies: + '@vue/compiler-ssr': 3.5.13 + '@vue/shared': 3.5.13 + vue: 3.5.13(typescript@5.8.2) + + '@vue/shared@3.5.13': {} + + '@vue/tsconfig@0.7.0(typescript@5.8.2)(vue@3.5.13(typescript@5.8.2))': + optionalDependencies: + typescript: 5.8.2 + vue: 3.5.13(typescript@5.8.2) + + alien-signals@1.0.10: {} + + ansi-regex@5.0.1: {} + + ansi-regex@6.1.0: {} + + ansi-styles@4.3.0: + dependencies: + color-convert: 2.0.1 + + ansi-styles@6.2.1: {} + + any-promise@1.3.0: {} + + anymatch@3.1.3: + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + + arg@5.0.2: {} + + asynckit@0.4.0: {} + + autoprefixer@10.4.21(postcss@8.5.3): + dependencies: + browserslist: 4.24.4 + caniuse-lite: 1.0.30001707 + fraction.js: 4.3.7 + normalize-range: 0.1.2 + picocolors: 1.1.1 + postcss: 8.5.3 + postcss-value-parser: 4.2.0 + + axios@1.8.4: + dependencies: + follow-redirects: 1.15.9 + form-data: 4.0.2 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + + balanced-match@1.0.2: {} + + binary-extensions@2.3.0: {} + + birpc@0.2.19: {} + + brace-expansion@2.0.1: + dependencies: + balanced-match: 1.0.2 + + braces@3.0.3: + dependencies: + fill-range: 7.1.1 + + browserslist@4.24.4: + dependencies: + caniuse-lite: 1.0.30001707 + electron-to-chromium: 1.5.128 + node-releases: 2.0.19 + update-browserslist-db: 1.1.3(browserslist@4.24.4) + + bundle-name@4.1.0: + dependencies: + run-applescript: 7.0.0 + + call-bind-apply-helpers@1.0.2: + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + + camelcase-css@2.0.1: {} + + caniuse-lite@1.0.30001707: {} + + chokidar@3.6.0: + dependencies: + anymatch: 3.1.3 + braces: 3.0.3 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.3 + + color-convert@2.0.1: + dependencies: + color-name: 1.1.4 + + color-name@1.1.4: {} + + combined-stream@1.0.8: + dependencies: + delayed-stream: 1.0.0 + + commander@4.1.1: {} + + convert-source-map@2.0.0: {} + + copy-anything@3.0.5: + dependencies: + is-what: 4.1.16 + + cross-spawn@7.0.6: + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + cssesc@3.0.0: {} + + csstype@3.1.3: {} + + de-indent@1.0.2: {} + + debug@4.4.0: + dependencies: + ms: 2.1.3 + + default-browser-id@5.0.0: {} + + default-browser@5.2.1: + dependencies: + bundle-name: 4.1.0 + default-browser-id: 5.0.0 + + define-lazy-prop@3.0.0: {} + + delayed-stream@1.0.0: {} + + didyoumean@1.2.2: {} + + dlv@1.1.3: {} + + dunder-proto@1.0.1: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-errors: 1.3.0 + gopd: 1.2.0 + + eastasianwidth@0.2.0: {} + + electron-to-chromium@1.5.128: {} + + emoji-regex@8.0.0: {} + + emoji-regex@9.2.2: {} + + entities@4.5.0: {} + + error-stack-parser-es@0.1.5: {} + + es-define-property@1.0.1: {} + + es-errors@1.3.0: {} + + es-object-atoms@1.1.1: + dependencies: + es-errors: 1.3.0 + + es-set-tostringtag@2.1.0: + dependencies: + es-errors: 1.3.0 + get-intrinsic: 1.3.0 + has-tostringtag: 1.0.2 + hasown: 2.0.2 + + esbuild@0.25.1: + optionalDependencies: + '@esbuild/aix-ppc64': 0.25.1 + '@esbuild/android-arm': 0.25.1 + '@esbuild/android-arm64': 0.25.1 + '@esbuild/android-x64': 0.25.1 + '@esbuild/darwin-arm64': 0.25.1 + '@esbuild/darwin-x64': 0.25.1 + '@esbuild/freebsd-arm64': 0.25.1 + '@esbuild/freebsd-x64': 0.25.1 + '@esbuild/linux-arm': 0.25.1 + '@esbuild/linux-arm64': 0.25.1 + '@esbuild/linux-ia32': 0.25.1 + '@esbuild/linux-loong64': 0.25.1 + '@esbuild/linux-mips64el': 0.25.1 + '@esbuild/linux-ppc64': 0.25.1 + '@esbuild/linux-riscv64': 0.25.1 + '@esbuild/linux-s390x': 0.25.1 + '@esbuild/linux-x64': 0.25.1 + '@esbuild/netbsd-arm64': 0.25.1 + '@esbuild/netbsd-x64': 0.25.1 + '@esbuild/openbsd-arm64': 0.25.1 + '@esbuild/openbsd-x64': 0.25.1 + '@esbuild/sunos-x64': 0.25.1 + '@esbuild/win32-arm64': 0.25.1 + '@esbuild/win32-ia32': 0.25.1 + '@esbuild/win32-x64': 0.25.1 + + escalade@3.2.0: {} + + estree-walker@2.0.2: {} + + execa@9.5.2: + dependencies: + '@sindresorhus/merge-streams': 4.0.0 + cross-spawn: 7.0.6 + figures: 6.1.0 + get-stream: 9.0.1 + human-signals: 8.0.0 + is-plain-obj: 4.1.0 + is-stream: 4.0.1 + npm-run-path: 6.0.0 + pretty-ms: 9.2.0 + signal-exit: 4.1.0 + strip-final-newline: 4.0.0 + yoctocolors: 2.1.1 + + fast-glob@3.3.3: + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.8 + + fastq@1.19.1: + dependencies: + reusify: 1.1.0 + + figures@6.1.0: + dependencies: + is-unicode-supported: 2.1.0 + + fill-range@7.1.1: + dependencies: + to-regex-range: 5.0.1 + + follow-redirects@1.15.9: {} + + foreground-child@3.3.1: + dependencies: + cross-spawn: 7.0.6 + signal-exit: 4.1.0 + + form-data@4.0.2: + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + es-set-tostringtag: 2.1.0 + mime-types: 2.1.35 + + fraction.js@4.3.7: {} + + fs-extra@11.3.0: + dependencies: + graceful-fs: 4.2.11 + jsonfile: 6.1.0 + universalify: 2.0.1 + + fsevents@2.3.3: + optional: true + + function-bind@1.1.2: {} + + gensync@1.0.0-beta.2: {} + + get-intrinsic@1.3.0: + dependencies: + call-bind-apply-helpers: 1.0.2 + es-define-property: 1.0.1 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + function-bind: 1.1.2 + get-proto: 1.0.1 + gopd: 1.2.0 + has-symbols: 1.1.0 + hasown: 2.0.2 + math-intrinsics: 1.1.0 + + get-proto@1.0.1: + dependencies: + dunder-proto: 1.0.1 + es-object-atoms: 1.1.1 + + get-stream@9.0.1: + dependencies: + '@sec-ant/readable-stream': 0.4.1 + is-stream: 4.0.1 + + glob-parent@5.1.2: + dependencies: + is-glob: 4.0.3 + + glob-parent@6.0.2: + dependencies: + is-glob: 4.0.3 + + glob@10.4.5: + dependencies: + foreground-child: 3.3.1 + jackspeak: 3.4.3 + minimatch: 9.0.5 + minipass: 7.1.2 + package-json-from-dist: 1.0.1 + path-scurry: 1.11.1 + + globals@11.12.0: {} + + gopd@1.2.0: {} + + graceful-fs@4.2.11: {} + + has-symbols@1.1.0: {} + + has-tostringtag@1.0.2: + dependencies: + has-symbols: 1.1.0 + + hasown@2.0.2: + dependencies: + function-bind: 1.1.2 + + he@1.2.0: {} + + hookable@5.5.3: {} + + human-signals@8.0.0: {} + + is-binary-path@2.1.0: + dependencies: + binary-extensions: 2.3.0 + + is-core-module@2.16.1: + dependencies: + hasown: 2.0.2 + + is-docker@3.0.0: {} + + is-extglob@2.1.1: {} + + is-fullwidth-code-point@3.0.0: {} + + is-glob@4.0.3: + dependencies: + is-extglob: 2.1.1 + + is-inside-container@1.0.0: + dependencies: + is-docker: 3.0.0 + + is-number@7.0.0: {} + + is-plain-obj@4.1.0: {} + + is-stream@4.0.1: {} + + is-unicode-supported@2.1.0: {} + + is-what@4.1.16: {} + + is-wsl@3.1.0: + dependencies: + is-inside-container: 1.0.0 + + isexe@2.0.0: {} + + isexe@3.1.1: {} + + jackspeak@3.4.3: + dependencies: + '@isaacs/cliui': 8.0.2 + optionalDependencies: + '@pkgjs/parseargs': 0.11.0 + + jiti@1.21.7: {} + + js-tokens@4.0.0: {} + + jsesc@3.1.0: {} + + json-parse-even-better-errors@4.0.0: {} + + json5@2.2.3: {} + + jsonfile@6.1.0: + dependencies: + universalify: 2.0.1 + optionalDependencies: + graceful-fs: 4.2.11 + + kolorist@1.8.0: {} + + lilconfig@3.1.3: {} + + lines-and-columns@1.2.4: {} + + lru-cache@10.4.3: {} + + lru-cache@5.1.1: + dependencies: + yallist: 3.1.1 + + magic-string@0.30.17: + dependencies: + '@jridgewell/sourcemap-codec': 1.5.0 + + math-intrinsics@1.1.0: {} + + memorystream@0.3.1: {} + + merge2@1.4.1: {} + + micromatch@4.0.8: + dependencies: + braces: 3.0.3 + picomatch: 2.3.1 + + mime-db@1.52.0: {} + + mime-types@2.1.35: + dependencies: + mime-db: 1.52.0 + + minimatch@9.0.5: + dependencies: + brace-expansion: 2.0.1 + + minipass@7.1.2: {} + + mitt@3.0.1: {} + + mrmime@2.0.1: {} + + ms@2.1.3: {} + + muggle-string@0.4.1: {} + + mz@2.7.0: + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + + nanoid@3.3.11: {} + + nanoid@5.1.5: {} + + node-releases@2.0.19: {} + + normalize-path@3.0.0: {} + + normalize-range@0.1.2: {} + + npm-normalize-package-bin@4.0.0: {} + + npm-run-all2@7.0.2: + dependencies: + ansi-styles: 6.2.1 + cross-spawn: 7.0.6 + memorystream: 0.3.1 + minimatch: 9.0.5 + pidtree: 0.6.0 + read-package-json-fast: 4.0.0 + shell-quote: 1.8.2 + which: 5.0.0 + + npm-run-path@6.0.0: + dependencies: + path-key: 4.0.0 + unicorn-magic: 0.3.0 + + object-assign@4.1.1: {} + + object-hash@3.0.0: {} + + open@10.1.0: + dependencies: + default-browser: 5.2.1 + define-lazy-prop: 3.0.0 + is-inside-container: 1.0.0 + is-wsl: 3.1.0 + + package-json-from-dist@1.0.1: {} + + parse-ms@4.0.0: {} + + path-browserify@1.0.1: {} + + path-key@3.1.1: {} + + path-key@4.0.0: {} + + path-parse@1.0.7: {} + + path-scurry@1.11.1: + dependencies: + lru-cache: 10.4.3 + minipass: 7.1.2 + + pathe@2.0.3: {} + + perfect-debounce@1.0.0: {} + + picocolors@1.1.1: {} + + picomatch@2.3.1: {} + + picomatch@4.0.2: {} + + pidtree@0.6.0: {} + + pify@2.3.0: {} + + pirates@4.0.7: {} + + postcss-import@15.1.0(postcss@8.5.3): + dependencies: + postcss: 8.5.3 + postcss-value-parser: 4.2.0 + read-cache: 1.0.0 + resolve: 1.22.10 + + postcss-js@4.0.1(postcss@8.5.3): + dependencies: + camelcase-css: 2.0.1 + postcss: 8.5.3 + + postcss-load-config@4.0.2(postcss@8.5.3): + dependencies: + lilconfig: 3.1.3 + yaml: 2.7.0 + optionalDependencies: + postcss: 8.5.3 + + postcss-nested@6.2.0(postcss@8.5.3): + dependencies: + postcss: 8.5.3 + postcss-selector-parser: 6.1.2 + + postcss-selector-parser@6.1.2: + dependencies: + cssesc: 3.0.0 + util-deprecate: 1.0.2 + + postcss-value-parser@4.2.0: {} + + postcss@8.5.3: + dependencies: + nanoid: 3.3.11 + picocolors: 1.1.1 + source-map-js: 1.2.1 + + pretty-ms@9.2.0: + dependencies: + parse-ms: 4.0.0 + + proxy-from-env@1.1.0: {} + + queue-microtask@1.2.3: {} + + read-cache@1.0.0: + dependencies: + pify: 2.3.0 + + read-package-json-fast@4.0.0: + dependencies: + json-parse-even-better-errors: 4.0.0 + npm-normalize-package-bin: 4.0.0 + + readdirp@3.6.0: + dependencies: + picomatch: 2.3.1 + + resolve@1.22.10: + dependencies: + is-core-module: 2.16.1 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + + reusify@1.1.0: {} + + rfdc@1.4.1: {} + + rollup@4.37.0: + dependencies: + '@types/estree': 1.0.6 + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.37.0 + '@rollup/rollup-android-arm64': 4.37.0 + '@rollup/rollup-darwin-arm64': 4.37.0 + '@rollup/rollup-darwin-x64': 4.37.0 + '@rollup/rollup-freebsd-arm64': 4.37.0 + '@rollup/rollup-freebsd-x64': 4.37.0 + '@rollup/rollup-linux-arm-gnueabihf': 4.37.0 + '@rollup/rollup-linux-arm-musleabihf': 4.37.0 + '@rollup/rollup-linux-arm64-gnu': 4.37.0 + '@rollup/rollup-linux-arm64-musl': 4.37.0 + '@rollup/rollup-linux-loongarch64-gnu': 4.37.0 + '@rollup/rollup-linux-powerpc64le-gnu': 4.37.0 + '@rollup/rollup-linux-riscv64-gnu': 4.37.0 + '@rollup/rollup-linux-riscv64-musl': 4.37.0 + '@rollup/rollup-linux-s390x-gnu': 4.37.0 + '@rollup/rollup-linux-x64-gnu': 4.37.0 + '@rollup/rollup-linux-x64-musl': 4.37.0 + '@rollup/rollup-win32-arm64-msvc': 4.37.0 + '@rollup/rollup-win32-ia32-msvc': 4.37.0 + '@rollup/rollup-win32-x64-msvc': 4.37.0 + fsevents: 2.3.3 + + run-applescript@7.0.0: {} + + run-parallel@1.2.0: + dependencies: + queue-microtask: 1.2.3 + + semver@6.3.1: {} + + shebang-command@2.0.0: + dependencies: + shebang-regex: 3.0.0 + + shebang-regex@3.0.0: {} + + shell-quote@1.8.2: {} + + signal-exit@4.1.0: {} + + sirv@3.0.1: + dependencies: + '@polka/url': 1.0.0-next.28 + mrmime: 2.0.1 + totalist: 3.0.1 + + source-map-js@1.2.1: {} + + speakingurl@14.0.1: {} + + string-width@4.2.3: + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + string-width@5.1.2: + dependencies: + eastasianwidth: 0.2.0 + emoji-regex: 9.2.2 + strip-ansi: 7.1.0 + + strip-ansi@6.0.1: + dependencies: + ansi-regex: 5.0.1 + + strip-ansi@7.1.0: + dependencies: + ansi-regex: 6.1.0 + + strip-final-newline@4.0.0: {} + + sucrase@3.35.0: + dependencies: + '@jridgewell/gen-mapping': 0.3.8 + commander: 4.1.1 + glob: 10.4.5 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.7 + ts-interface-checker: 0.1.13 + + superjson@2.2.2: + dependencies: + copy-anything: 3.0.5 + + supports-preserve-symlinks-flag@1.0.0: {} + + tailwindcss@3.4.17: + dependencies: + '@alloc/quick-lru': 5.2.0 + arg: 5.0.2 + chokidar: 3.6.0 + didyoumean: 1.2.2 + dlv: 1.1.3 + fast-glob: 3.3.3 + glob-parent: 6.0.2 + is-glob: 4.0.3 + jiti: 1.21.7 + lilconfig: 3.1.3 + micromatch: 4.0.8 + normalize-path: 3.0.0 + object-hash: 3.0.0 + picocolors: 1.1.1 + postcss: 8.5.3 + postcss-import: 15.1.0(postcss@8.5.3) + postcss-js: 4.0.1(postcss@8.5.3) + postcss-load-config: 4.0.2(postcss@8.5.3) + postcss-nested: 6.2.0(postcss@8.5.3) + postcss-selector-parser: 6.1.2 + resolve: 1.22.10 + sucrase: 3.35.0 + transitivePeerDependencies: + - ts-node + + thenify-all@1.6.0: + dependencies: + thenify: 3.3.1 + + thenify@3.3.1: + dependencies: + any-promise: 1.3.0 + + to-regex-range@5.0.1: + dependencies: + is-number: 7.0.0 + + totalist@3.0.1: {} + + ts-interface-checker@0.1.13: {} + + typescript@5.8.2: {} + + undici-types@6.20.0: {} + + unicorn-magic@0.3.0: {} + + universalify@2.0.1: {} + + update-browserslist-db@1.1.3(browserslist@4.24.4): + dependencies: + browserslist: 4.24.4 + escalade: 3.2.0 + picocolors: 1.1.1 + + util-deprecate@1.0.2: {} + + vite-hot-client@0.2.4(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0)): + dependencies: + vite: 6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0) + + vite-plugin-inspect@0.8.9(rollup@4.37.0)(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0)): + dependencies: + '@antfu/utils': 0.7.10 + '@rollup/pluginutils': 5.1.4(rollup@4.37.0) + debug: 4.4.0 + error-stack-parser-es: 0.1.5 + fs-extra: 11.3.0 + open: 10.1.0 + perfect-debounce: 1.0.0 + picocolors: 1.1.1 + sirv: 3.0.1 + vite: 6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0) + transitivePeerDependencies: + - rollup + - supports-color + + vite-plugin-vue-devtools@7.7.2(rollup@4.37.0)(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0))(vue@3.5.13(typescript@5.8.2)): + dependencies: + '@vue/devtools-core': 7.7.2(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0))(vue@3.5.13(typescript@5.8.2)) + '@vue/devtools-kit': 7.7.2 + '@vue/devtools-shared': 7.7.2 + execa: 9.5.2 + sirv: 3.0.1 + vite: 6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0) + vite-plugin-inspect: 0.8.9(rollup@4.37.0)(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0)) + vite-plugin-vue-inspector: 5.3.1(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0)) + transitivePeerDependencies: + - '@nuxt/kit' + - rollup + - supports-color + - vue + + vite-plugin-vue-inspector@5.3.1(vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0)): + dependencies: + '@babel/core': 7.26.10 + '@babel/plugin-proposal-decorators': 7.25.9(@babel/core@7.26.10) + '@babel/plugin-syntax-import-attributes': 7.26.0(@babel/core@7.26.10) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.26.10) + '@babel/plugin-transform-typescript': 7.27.0(@babel/core@7.26.10) + '@vue/babel-plugin-jsx': 1.4.0(@babel/core@7.26.10) + '@vue/compiler-dom': 3.5.13 + kolorist: 1.8.0 + magic-string: 0.30.17 + vite: 6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0) + transitivePeerDependencies: + - supports-color + + vite@6.2.3(@types/node@22.13.14)(jiti@1.21.7)(yaml@2.7.0): + dependencies: + esbuild: 0.25.1 + postcss: 8.5.3 + rollup: 4.37.0 + optionalDependencies: + '@types/node': 22.13.14 + fsevents: 2.3.3 + jiti: 1.21.7 + yaml: 2.7.0 + + vscode-uri@3.1.0: {} + + vue-tsc@2.2.8(typescript@5.8.2): + dependencies: + '@volar/typescript': 2.4.12 + '@vue/language-core': 2.2.8(typescript@5.8.2) + typescript: 5.8.2 + + vue@3.5.13(typescript@5.8.2): + dependencies: + '@vue/compiler-dom': 3.5.13 + '@vue/compiler-sfc': 3.5.13 + '@vue/runtime-dom': 3.5.13 + '@vue/server-renderer': 3.5.13(vue@3.5.13(typescript@5.8.2)) + '@vue/shared': 3.5.13 + optionalDependencies: + typescript: 5.8.2 + + which@2.0.2: + dependencies: + isexe: 2.0.0 + + which@5.0.0: + dependencies: + isexe: 3.1.1 + + wrap-ansi@7.0.0: + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + wrap-ansi@8.1.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.1.0 + + yallist@3.1.1: {} + + yaml@2.7.0: {} + + yoctocolors@2.1.1: {} diff --git a/hw-sign-browser/postcss.config.js b/hw-sign-browser/postcss.config.js new file mode 100644 index 0000000..2e7af2b --- /dev/null +++ b/hw-sign-browser/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/hw-sign-browser/public/favicon.ico b/hw-sign-browser/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..df36fcfb72584e00488330b560ebcf34a41c64c2 GIT binary patch literal 4286 zcmds*O-Phc6o&64GDVCEQHxsW(p4>LW*W<827=Unuo8sGpRux(DN@jWP-e29Wl%wj zY84_aq9}^Am9-cWTD5GGEo#+5Fi2wX_P*bo+xO!)p*7B;iKlbFd(U~_d(U?#hLj56 zPhFkj-|A6~Qk#@g^#D^U0XT1cu=c-vu1+SElX9NR;kzAUV(q0|dl0|%h|dI$%VICy zJnu2^L*Te9JrJMGh%-P79CL0}dq92RGU6gI{v2~|)p}sG5x0U*z<8U;Ij*hB9z?ei z@g6Xq-pDoPl=MANPiR7%172VA%r)kevtV-_5H*QJKFmd;8yA$98zCxBZYXTNZ#QFk2(TX0;Y2dt&WitL#$96|gJY=3xX zpCoi|YNzgO3R`f@IiEeSmKrPSf#h#Qd<$%Ej^RIeeYfsxhPMOG`S`Pz8q``=511zm zAm)MX5AV^5xIWPyEu7u>qYs?pn$I4nL9J!=K=SGlKLXpE<5x+2cDTXq?brj?n6sp= zphe9;_JHf40^9~}9i08r{XM$7HB!`{Ys~TK0kx<}ZQng`UPvH*11|q7&l9?@FQz;8 zx!=3<4seY*%=OlbCbcae?5^V_}*K>Uo6ZWV8mTyE^B=DKy7-sdLYkR5Z?paTgK-zyIkKjIcpyO z{+uIt&YSa_$QnN_@t~L014dyK(fOOo+W*MIxbA6Ndgr=Y!f#Tokqv}n<7-9qfHkc3 z=>a|HWqcX8fzQCT=dqVbogRq!-S>H%yA{1w#2Pn;=e>JiEj7Hl;zdt-2f+j2%DeVD zsW0Ab)ZK@0cIW%W7z}H{&~yGhn~D;aiP4=;m-HCo`BEI+Kd6 z={Xwx{TKxD#iCLfl2vQGDitKtN>z|-AdCN|$jTFDg0m3O`WLD4_s#$S literal 0 HcmV?d00001 diff --git a/hw-sign-browser/src/App.vue b/hw-sign-browser/src/App.vue new file mode 100644 index 0000000..af8617c --- /dev/null +++ b/hw-sign-browser/src/App.vue @@ -0,0 +1,260 @@ + + + + + diff --git a/hw-sign-browser/src/assets/base.css b/hw-sign-browser/src/assets/base.css new file mode 100644 index 0000000..b03235e --- /dev/null +++ b/hw-sign-browser/src/assets/base.css @@ -0,0 +1,90 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +/* color palette from */ +:root { + --vt-c-white: #ffffff; + --vt-c-white-soft: #f8f8f8; + --vt-c-white-mute: #f2f2f2; + + --vt-c-black: #181818; + --vt-c-black-soft: #222222; + --vt-c-black-mute: #282828; + + --vt-c-indigo: #2c3e50; + + --vt-c-divider-light-1: rgba(60, 60, 60, 0.29); + --vt-c-divider-light-2: rgba(60, 60, 60, 0.12); + --vt-c-divider-dark-1: rgba(84, 84, 84, 0.65); + --vt-c-divider-dark-2: rgba(84, 84, 84, 0.48); + + --vt-c-text-light-1: var(--vt-c-indigo); + --vt-c-text-light-2: rgba(60, 60, 60, 0.66); + --vt-c-text-dark-1: var(--vt-c-white); + --vt-c-text-dark-2: rgba(235, 235, 235, 0.64); +} + +/* semantic color variables for this project */ +:root { + --color-background: var(--vt-c-white); + --color-background-soft: var(--vt-c-white-soft); + --color-background-mute: var(--vt-c-white-mute); + + --color-border: var(--vt-c-divider-light-2); + --color-border-hover: var(--vt-c-divider-light-1); + + --color-heading: var(--vt-c-text-light-1); + --color-text: var(--vt-c-text-light-1); + + --section-gap: 160px; +} + +@media (prefers-color-scheme: dark) { + :root { + --color-background: var(--vt-c-black); + --color-background-soft: var(--vt-c-black-soft); + --color-background-mute: var(--vt-c-black-mute); + + --color-border: var(--vt-c-divider-dark-2); + --color-border-hover: var(--vt-c-divider-dark-1); + + --color-heading: var(--vt-c-text-dark-1); + --color-text: var(--vt-c-text-dark-2); + } +} + +*, +*::before, +*::after { + box-sizing: border-box; + margin: 0; + font-weight: normal; +} + +body { + min-height: 100vh; + color: var(--color-text); + background: var(--color-background); + transition: + color 0.5s, + background-color 0.5s; + line-height: 1.6; + font-family: + Inter, + -apple-system, + BlinkMacSystemFont, + 'Segoe UI', + Roboto, + Oxygen, + Ubuntu, + Cantarell, + 'Fira Sans', + 'Droid Sans', + 'Helvetica Neue', + sans-serif; + font-size: 15px; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} diff --git a/hw-sign-browser/src/assets/logo.svg b/hw-sign-browser/src/assets/logo.svg new file mode 100644 index 0000000..7565660 --- /dev/null +++ b/hw-sign-browser/src/assets/logo.svg @@ -0,0 +1 @@ + diff --git a/hw-sign-browser/src/assets/main.css b/hw-sign-browser/src/assets/main.css new file mode 100644 index 0000000..c24bffd --- /dev/null +++ b/hw-sign-browser/src/assets/main.css @@ -0,0 +1,20 @@ +@import './base.css'; + +#app { + margin: 0 auto; + font-weight: normal; +} + +a, +.green { + text-decoration: none; + color: hsla(160, 100%, 37%, 1); + transition: 0.4s; + padding: 3px; +} + +@media (hover: hover) { + a:hover { + background-color: hsla(160, 100%, 37%, 0.2); + } +} diff --git a/hw-sign-browser/src/main.ts b/hw-sign-browser/src/main.ts new file mode 100644 index 0000000..de09068 --- /dev/null +++ b/hw-sign-browser/src/main.ts @@ -0,0 +1,5 @@ +import './assets/main.css'; +import { createApp } from 'vue'; +import App from './App.vue'; + +createApp(App).mount('#app'); diff --git a/hw-sign-browser/src/services/authService.ts b/hw-sign-browser/src/services/authService.ts new file mode 100644 index 0000000..1ef684e --- /dev/null +++ b/hw-sign-browser/src/services/authService.ts @@ -0,0 +1,701 @@ +import axios, { AxiosError } from 'axios'; + +// Response type definitions +interface ServerResponse { + message?: string; +} + +interface LoginResponse extends ServerResponse { + token: string; +} + +interface AuthResponse extends ServerResponse { + authenticated: boolean; +} + +const apiClient = axios.create({ + baseURL: import.meta.env.DEV ? 'http://127.0.0.1:28280' : 'https://dbcs-api.ovo.fan', + headers: { 'Content-Type': 'application/json' }, +}); + +// Storage constants +const DB_NAME = 'DBCS'; +const DB_VERSION = 1; +const STORE_NAME = 'auth_data'; +const HW_KEY_ID = 'hardware_key'; +const AUTH_TOKEN_ID = 'auth_token'; +const ACCEL_KEY_ID_STORE = 'accel_key_id'; +const PREFER_SYMMETRIC_STORE = 'prefer_symmetric'; + +// In-memory state +let hardwareKey: CryptoKeyPair | null = null; +let accelerationKey: CryptoKeyPair | null = null; +let accelerationKeyId: string | null = null; +let ecdhAccelerationKey: CryptoKeyPair | null = null; +let symmetricKey: CryptoKey | null = null; +let preferSymmetricEncryption = true; // Default to true for better performance + +// Add debug logger +function debugLog(step: string, message: string, data?: any): void { + const timestamp = new Date().toISOString(); + console.debug(`[${timestamp}] [DBCS] ${step}: ${message}`, data || ''); +} + +// IndexedDB helper functions +async function openDB(): Promise { + return new Promise((resolve, reject) => { + const request = indexedDB.open(DB_NAME, DB_VERSION); + + request.onerror = () => reject(request.error); + request.onsuccess = () => resolve(request.result); + + request.onupgradeneeded = (event) => { + const db = (event.target as IDBOpenDBRequest).result; + if (!db.objectStoreNames.contains(STORE_NAME)) { + db.createObjectStore(STORE_NAME); + } + }; + }); +} + +async function storeData(key: string, value: any): Promise { + const db = await openDB(); + return new Promise((resolve, reject) => { + const transaction = db.transaction(STORE_NAME, 'readwrite'); + const store = transaction.objectStore(STORE_NAME); + + const request = store.put(value, key); + + request.onerror = () => reject(request.error); + request.onsuccess = () => resolve(); + + transaction.oncomplete = () => db.close(); + }); +} + +async function loadData(key: string): Promise { + const db = await openDB(); + return new Promise((resolve, reject) => { + const transaction = db.transaction(STORE_NAME, 'readonly'); + const store = transaction.objectStore(STORE_NAME); + + const request = store.get(key); + + request.onerror = () => reject(request.error); + request.onsuccess = () => resolve(request.result || null); + + transaction.oncomplete = () => db.close(); + }); +} + +async function deleteData(key: string): Promise { + const db = await openDB(); + return new Promise((resolve, reject) => { + const transaction = db.transaction(STORE_NAME, 'readwrite'); + const store = transaction.objectStore(STORE_NAME); + + const request = store.delete(key); + + request.onerror = () => reject(request.error); + request.onsuccess = () => resolve(); + + transaction.oncomplete = () => db.close(); + }); +} + +// Key storage wrappers +const storage = { + hardwareKey: { + store: (key: CryptoKeyPair) => storeData(HW_KEY_ID, key), + load: () => loadData(HW_KEY_ID) as Promise, + delete: () => deleteData(HW_KEY_ID) + }, + authToken: { + store: (token: string) => storeData(AUTH_TOKEN_ID, token), + load: () => loadData(AUTH_TOKEN_ID) as Promise, + delete: () => deleteData(AUTH_TOKEN_ID) + }, + preferSymmetric: { + store: (value: boolean) => storeData(PREFER_SYMMETRIC_STORE, value), + load: async () => { + const value = await loadData(PREFER_SYMMETRIC_STORE); + return value !== false; // Default to true if not set + } + } +}; + +// Supported key algorithms +type KeyAlgorithm = 'Ed25519' | 'ECDSA' | 'RSA-PSS' | 'ECDH'; + +// Generate keys with fallback support +async function tryGenerateKey(type: KeyAlgorithm, extractable: boolean): Promise { + if (!window.crypto?.subtle) return null; + + try { + debugLog('Key Generation', `Attempting to generate ${type} key, extractable: ${extractable}`); + switch (type) { + case 'Ed25519': + return await window.crypto.subtle.generateKey( + { name: 'Ed25519' }, + extractable, + ['sign', 'verify'] + ); + case 'ECDSA': + return await window.crypto.subtle.generateKey( + { name: 'ECDSA', namedCurve: 'P-256' }, + extractable, + ['sign', 'verify'] + ); + case 'RSA-PSS': + return await window.crypto.subtle.generateKey( + { + name: 'RSA-PSS', + modulusLength: 2048, + publicExponent: new Uint8Array([1, 0, 1]), + hash: 'SHA-256', + }, + extractable, + ['sign', 'verify'] + ); + case 'ECDH': + return await window.crypto.subtle.generateKey( + { name: 'ECDH', namedCurve: 'P-256' }, + extractable, + ['deriveKey', 'deriveBits'] + ); + default: + return null; + } + } catch (e) { + debugLog('Key Generation', `Failed to generate ${type} key:`, e); + console.debug(`Failed to generate ${type} key:`, e); + return null; + } +} + +async function generateKey(extractable: boolean, type?: KeyAlgorithm): Promise { + if (!window.crypto?.subtle) { + debugLog('Key Generation', 'Web Crypto API not supported'); + throw new Error('Web Crypto API not supported'); + } + + // If a specific algorithm is requested, try it first + if (type) { + const key = await tryGenerateKey(type, extractable); + if (key) { + console.debug(`Using ${type} for key`); + debugLog('Key Generation', `Successfully generated ${key.publicKey.algorithm.name} key`); + return key; + } + } + + // Try algorithms in order of preference + const algorithms: KeyAlgorithm[] = ['Ed25519', 'ECDSA', 'RSA-PSS']; + for (const algo of algorithms) { + const key = await tryGenerateKey(algo, extractable); + if (key) { + console.debug(`Using ${algo} for ${extractable ? 'acceleration' : 'hardware'} key`); + debugLog('Key Generation', `Successfully generated ${key.publicKey.algorithm.name} key`); + return key; + } + } + throw new Error('No supported key algorithms available'); +} + +// Utility functions for data conversion and encryption +function arrayBufferToBase64(buffer: ArrayBuffer): string { + return btoa(String.fromCharCode(...new Uint8Array(buffer))); +} + +function base64ToArrayBuffer(base64: string): ArrayBuffer { + const binaryString = atob(base64); + const bytes = new Uint8Array(binaryString.length); + for (let i = 0; i < binaryString.length; i++) { + bytes[i] = binaryString.charCodeAt(i); + } + return bytes.buffer; +} + +async function exportPublicKey(key: CryptoKey): Promise { + // Choose export format based on algorithm + const format = ['Ed25519', 'ECDH'].includes(key.algorithm.name) ? 'raw' : 'spki'; + const exported = await window.crypto.subtle.exportKey(format, key); + return arrayBufferToBase64(exported); +} + +// HMAC generation for ECDH-derived keys +async function generateHMAC(key: CryptoKey, data: string): Promise { + debugLog('HMAC', `Generating HMAC for data (${data.length} chars)`, { + dataPreview: data.substring(0, 20) + '...', + keyAlgo: key.algorithm.name, + keyUsages: key.usages + }); + + const encoder = new TextEncoder(); + const dataBuffer = encoder.encode(data); + + const signature = await window.crypto.subtle.sign( + { name: 'HMAC' }, + key, + dataBuffer + ); + + debugLog('HMAC', `Generated HMAC: ${signature.byteLength} bytes`); + return arrayBufferToBase64(signature); +} + +// Function to derive shared secret and create HMAC key +async function deriveSharedKey(privateKey: CryptoKey, publicKeyBase64: string): Promise { + debugLog('ECDH', 'Starting key derivation process', { + publicKeyLength: publicKeyBase64.length, + privateKeyAlgo: privateKey.algorithm.name + }); + + try { + // Import the server's public key + const publicKeyData = base64ToArrayBuffer(publicKeyBase64); + + // Import the raw key data for ECDH + const serverPublicKey = await window.crypto.subtle.importKey( + 'raw', + publicKeyData, + { name: 'ECDH', namedCurve: 'P-256' }, + false, + [] + ); + + // Derive bits from the ECDH exchange + const derivedBits = await window.crypto.subtle.deriveBits( + { name: 'ECDH', public: serverPublicKey }, + privateKey, + 256 // 256 bits for HMAC key + ); + + debugLog('ECDH', 'Derived HMAC key successfully', { + derivedBitsLength: derivedBits.byteLength + }); + + // Create HMAC key from the derived bits + return await window.crypto.subtle.importKey( + 'raw', + derivedBits, + { name: 'HMAC', hash: 'SHA-256' }, + false, + ['sign', 'verify'] + ); + } catch (error) { + debugLog('ECDH', 'Failed to derive shared key', error); + console.error('Failed to derive shared key:', error); + throw new Error('Failed to derive HMAC key'); + } +} + +// Key management functions +async function setupECDHAccelerationKey(): Promise<{ + ecdhPubKeyBase64: string; + ecdhPubKeySig: string; +}> { + debugLog('ECDH Setup', 'Generating ECDH acceleration key pair'); + try { + // Generate ECDH key pair - set extractable to FALSE for better security + ecdhAccelerationKey = await generateKey(false, 'ECDH'); + + // Export the public key + const ecdhPubKeyBase64 = await exportPublicKey(ecdhAccelerationKey.publicKey); + + debugLog('ECDH Setup', 'ECDH key pair generated successfully', { + publicKeyLength: ecdhPubKeyBase64.length + }); + + // Sign the public key with hardware key + const ecdhPubKeySig = await signWithKey(hardwareKey!.privateKey, ecdhPubKeyBase64); + + debugLog('ECDH Setup', 'Signed ECDH public key with hardware key'); + return { ecdhPubKeyBase64, ecdhPubKeySig }; + } catch (error) { + debugLog('ECDH Setup', 'Failed to setup ECDH key', error); + console.error('Failed to setup ECDH key:', error); + throw error; + } +} + +async function setupAccelerationKey(): Promise<{ accelPubKeyBase64: string; accelPubKeySig: string; keyType: string }> { + if (accelerationKey) { + const accelPubKeyBase64 = await exportPublicKey(accelerationKey.publicKey); + const accelPubKeySig = await signWithKey(hardwareKey!.privateKey, accelPubKeyBase64); + const keyType = accelerationKey.publicKey.algorithm.name.toLowerCase(); + return { accelPubKeyBase64, accelPubKeySig, keyType }; + } + + try { + // Generate new acceleration key + accelerationKey = await generateKey(true); + + // Export acceleration public key + const accelPubKeyBase64 = await exportPublicKey(accelerationKey.publicKey); + const accelPubKeySig = await signWithKey(hardwareKey!.privateKey, accelPubKeyBase64); + const keyType = accelerationKey.publicKey.algorithm.name.toLowerCase(); + + return { accelPubKeyBase64, accelPubKeySig, keyType }; + } catch (error) { + // Reset the acceleration key on failure + accelerationKey = null; + accelerationKeyId = null; + throw error; + } +} + +async function checkStorageSupport(): Promise { + if (!window.indexedDB) return false; + + try { + const db = await openDB(); + db.close(); + return true; + } catch (e) { + console.debug('IndexedDB not available:', e); + return false; + } +} + +async function initHardwareKey(): Promise { + debugLog('Hardware Key', 'Initializing hardware key'); + if (hardwareKey) { + debugLog('Hardware Key', 'Hardware key already initialized'); + return; // Already initialized + } + + // Check storage support first + const hasStorage = await checkStorageSupport(); + if (!hasStorage) { + throw new Error('Secure key storage is not available in your browser. Please enable IndexedDB or use a modern browser.'); + } + + // Try to load existing key first + hardwareKey = await storage.hardwareKey.load(); + debugLog('Hardware Key', hardwareKey ? 'Loaded existing hardware key' : 'Generating new hardware key'); + if (!hardwareKey) { + // Generate new key if none exists + hardwareKey = await generateKey(false); // Ensure hardware key is non-exportable + await storage.hardwareKey.store(hardwareKey); + } + + debugLog('Hardware Key', 'Hardware key initialization complete'); +} + +async function init(): Promise { + try { + // Load hardware key and auth token + await initHardwareKey(); + + // Load symmetric encryption preference + preferSymmetricEncryption = await storage.preferSymmetric.load(); + } catch (error) { + console.error('Failed to initialize auth service', error); + } +} + +async function signWithKey(key: CryptoKey, data: string): Promise { + const dataBuffer = new TextEncoder().encode(data); + + // Configure algorithm parameters based on key type + const params = key.algorithm.name === 'RSA-PSS' + ? { name: 'RSA-PSS', saltLength: 32 } + : key.algorithm.name === 'ECDSA' + ? { name: 'ECDSA', hash: 'SHA-256' } + : { name: key.algorithm.name }; + + const signature = await window.crypto.subtle.sign( + params, + key, + dataBuffer + ); + return arrayBufferToBase64(signature); +} + +// Primary authentication function +async function authenticatedRequest( + method: 'get' | 'post', + url: string, + data?: any +): Promise { + debugLog('Auth Request', `${method.toUpperCase()} ${url}`, data ? { dataType: typeof data } : {}); + try { + const token = await storage.authToken.load(); + if (!token) throw new Error('Not authenticated'); + + // Ensure hardware key is ready + await initHardwareKey(); + + // Prepare request data + const timestamp = Date.now().toString(); + const requestData = data ? JSON.stringify(data) : timestamp; + const headers: Record = { 'Authorization': `Bearer ${token}` }; + + debugLog('Auth Request', `Using ${accelerationKeyId ? 'existing' : 'new'} acceleration key`); + + // Handle different authentication methods based on available keys + if (accelerationKeyId) { + // Use existing acceleration key ID + await handleExistingKeyAuth(headers, requestData); + } else { + // Register new acceleration key + await handleNewKeyRegistration(headers, requestData); + } + + // Make the authenticated request + const response = await apiClient.request({ + method, + url, + data, + headers + }); + + // Process response if this was a new key registration + if (!accelerationKeyId && response.headers['x-rpc-sec-bound-token-accel-pub-id']) { + const headers = Object.fromEntries( + Object.entries(response.headers).map(([key, value]) => [key, String(value)]) + ); + await processKeyRegistrationResponse(headers); + } + + debugLog('Auth Request', 'Request completed successfully'); + return response.data; + } catch (error) { + debugLog('Auth Request', 'Request failed', error); + if (axios.isAxiosError(error)) { + const axiosError = error as AxiosError; + if (axiosError.response?.data?.message) { + throw new Error(axiosError.response.data.message); + } + } + throw error; + } +} + +// Helper for existing key authentication +async function handleExistingKeyAuth(headers: Record, requestData: string): Promise { + debugLog('Existing Auth', 'Setting up authentication with existing key', { + keyType: symmetricKey && preferSymmetricEncryption ? 'symmetric' : 'asymmetric', + dataLength: requestData.length, + accelerationKeyId + }); + + if (symmetricKey && preferSymmetricEncryption) { + // Use HMAC for authentication + debugLog('Existing Auth', 'Using HMAC authentication'); + const hmac = await generateHMAC(symmetricKey, requestData); + debugLog('Existing Auth', `Generated HMAC signature: ${hmac.substring(0, 20)}...`); + + headers['x-rpc-sec-bound-token-data'] = requestData; + headers['x-rpc-sec-bound-token-data-sig'] = hmac; // Unified header for signature + headers['x-rpc-sec-bound-token-accel-pub-id'] = accelerationKeyId!; + } else if (accelerationKey) { + // Use asymmetric signatures + debugLog('Existing Auth', 'Using asymmetric signature authentication'); + const signature = await signWithKey(accelerationKey.privateKey, requestData); + debugLog('Existing Auth', `Generated signature: ${signature.substring(0, 20)}...`); + + headers['x-rpc-sec-bound-token-data'] = requestData; + headers['x-rpc-sec-bound-token-data-sig'] = signature; // Unified header for signature + headers['x-rpc-sec-bound-token-accel-pub-id'] = accelerationKeyId!; + } else { + debugLog('Existing Auth', 'Invalid key state, forcing new registration'); + accelerationKeyId = null; + throw new Error('Invalid key state, will register new key'); + } +} + +// Helper for new key registration +async function handleNewKeyRegistration(headers: Record, requestData: string): Promise { + debugLog('New Key Auth', 'Registering new acceleration key', { + preferSymmetric: preferSymmetricEncryption + }); + + let isEcdhGenerated = false; + + // Try ECDH key exchange if supported and preferred + if (window.crypto.subtle && preferSymmetricEncryption) { + try { + // Setup ECDH key exchange + const { ecdhPubKeyBase64, ecdhPubKeySig } = await setupECDHAccelerationKey(); + + // Sign request data with hardware key for this first exchange + const dataSig = await signWithKey(hardwareKey!.privateKey, requestData); + + headers['x-rpc-sec-bound-token-accel-pub'] = ecdhPubKeyBase64; + headers['x-rpc-sec-bound-token-accel-pub-type'] = 'ecdh'; + headers['x-rpc-sec-bound-token-accel-pub-sig'] = ecdhPubKeySig; + headers['x-rpc-sec-bound-token-data'] = requestData; + headers['x-rpc-sec-bound-token-data-sig'] = dataSig; + isEcdhGenerated = true; + } catch (error) { + debugLog('New Key Auth', 'ECDH key exchange failed, falling back to asymmetric keys', error); + console.debug('ECDH key exchange failed, falling back to asymmetric keys', error); + } + } + + // Fall back to asymmetric keys if ECDH isn't available or failed + if (!isEcdhGenerated) { + debugLog('New Key Auth', 'Using asymmetric key pair'); + const { accelPubKeyBase64, accelPubKeySig, keyType } = await setupAccelerationKey(); + const signature = await signWithKey(accelerationKey!.privateKey, requestData); + + headers['x-rpc-sec-bound-token-accel-pub'] = accelPubKeyBase64; + headers['x-rpc-sec-bound-token-accel-pub-type'] = keyType; + headers['x-rpc-sec-bound-token-accel-pub-sig'] = accelPubKeySig; + headers['x-rpc-sec-bound-token-data'] = requestData; + headers['x-rpc-sec-bound-token-data-sig'] = signature; + } + + debugLog('New Key Auth', 'New key registration headers set up'); +} + +// Process key registration response +async function processKeyRegistrationResponse(headers: Record): Promise { + debugLog('Key Registration', 'Processing key registration response', headers); + + // Store the key ID + const keyId = headers['x-rpc-sec-bound-token-accel-pub-id']; + if (keyId) { + debugLog('Key Registration', `Received key ID: ${keyId}`); + accelerationKeyId = keyId; + + // If this was an ECDH key exchange, process server's public key + const serverPubKey = headers['x-rpc-sec-bound-token-accel-pub']; + if (ecdhAccelerationKey && serverPubKey && preferSymmetricEncryption) { + debugLog('Key Registration', 'Processing ECDH server public key', { + publicKeyLength: serverPubKey.length + }); + + try { + // Derive the shared secret and create the HMAC key + symmetricKey = await deriveSharedKey(ecdhAccelerationKey.privateKey, serverPubKey); + debugLog('Key Registration', 'ECDH key exchange completed successfully'); + console.debug('ECDH key exchange successful, HMAC authentication enabled'); + } catch (error) { + debugLog('Key Registration', 'Failed to establish HMAC key', error); + console.error('Failed to establish HMAC key:', error); + } + } + } else { + debugLog('Key Registration', 'No acceleration key ID received'); + } +} + +// Public API functions +export async function toggleSymmetricEncryption(): Promise { + debugLog('API', `Toggling symmetric encryption from ${preferSymmetricEncryption} to ${!preferSymmetricEncryption}`); + + // Toggle the preference + preferSymmetricEncryption = !preferSymmetricEncryption; + + // Store the updated preference + await storage.preferSymmetric.store(preferSymmetricEncryption); + + // If disabling, clear the symmetric key (we'll keep using asymmetric with existing key ID) + if (!preferSymmetricEncryption) { + symmetricKey = null; + } + + // Reset key state + accelerationKeyId = null; + + debugLog('API', `Symmetric encryption set to ${preferSymmetricEncryption}`); + return preferSymmetricEncryption; +} + +export function isSymmetricEncryptionEnabled(): boolean { + return preferSymmetricEncryption; +} + +export async function register(userData: { username: string; password: string }) { + const response = await apiClient.post('/register', userData); + return response.data; +} + +export async function login(credentials: { username: string; password: string }) { + debugLog('API', 'Login attempt', { username: credentials.username }); + + // Ensure hardware key is ready for login + await initHardwareKey(); + + // Get hardware public key + const hwPubKey = await exportPublicKey(hardwareKey!.publicKey); + const hwKeyType = hardwareKey!.publicKey.algorithm.name.toLowerCase(); + + debugLog('API', 'Hardware key prepared', { + keyType: hwKeyType, + publicKeyLength: hwPubKey.length + }); + + // Setup request with hardware key headers + const response = await apiClient.post( + '/login', + credentials, + { + headers: { + 'x-rpc-sec-bound-token-hw-pub': hwPubKey, + 'x-rpc-sec-bound-token-hw-pub-type': hwKeyType, + } + } + ); + + // Store the auth token + await storage.authToken.store(response.data.token); + + // Clear any existing acceleration keys when logging in + accelerationKey = null; + accelerationKeyId = null; + ecdhAccelerationKey = null; + symmetricKey = null; + + debugLog('API', 'Login successful'); + return response.data; +} + +export async function isAuthenticated(): Promise { + debugLog('API', 'Checking authentication status'); + try { + const token = await storage.authToken.load(); + if (!token) return false; + + // Make an authenticated request to verify the token is valid + const response = await authenticatedRequest('get', '/authenticated'); + debugLog('API', `Authentication status: ${response.authenticated}`); + return response.authenticated; + } catch (error) { + debugLog('API', 'Authentication check failed', error); + console.debug('Authentication check failed:', error); + return false; + } +} + +export function logout(): void { + debugLog('API', 'Logging out, clearing all keys and tokens'); + Promise.all([ + storage.authToken.delete(), + storage.hardwareKey.delete(), + ]).catch(console.error); + + // Clear all sensitive data from memory + hardwareKey = null; + accelerationKey = null; + accelerationKeyId = null; + ecdhAccelerationKey = null; + symmetricKey = null; +} + +// Initialize the service on module load +init().catch(error => { + debugLog('Init', 'Service initialization failed', error); + console.error(error); +}); + +// Add window unload handler to clear sensitive keys from memory +if (typeof window !== 'undefined') { + window.addEventListener('beforeunload', () => { + ecdhAccelerationKey = null; + symmetricKey = null; + }); +} \ No newline at end of file diff --git a/hw-sign-browser/tailwind.config.js b/hw-sign-browser/tailwind.config.js new file mode 100644 index 0000000..3db46c0 --- /dev/null +++ b/hw-sign-browser/tailwind.config.js @@ -0,0 +1,9 @@ +/** @type {import('tailwindcss').Config} */ +export default { + content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"], + darkMode: 'class', + theme: { + extend: {}, + }, + plugins: [], +}; diff --git a/hw-sign-browser/tsconfig.app.json b/hw-sign-browser/tsconfig.app.json new file mode 100644 index 0000000..913b8f2 --- /dev/null +++ b/hw-sign-browser/tsconfig.app.json @@ -0,0 +1,12 @@ +{ + "extends": "@vue/tsconfig/tsconfig.dom.json", + "include": ["env.d.ts", "src/**/*", "src/**/*.vue"], + "exclude": ["src/**/__tests__/*"], + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + + "paths": { + "@/*": ["./src/*"] + } + } +} diff --git a/hw-sign-browser/tsconfig.json b/hw-sign-browser/tsconfig.json new file mode 100644 index 0000000..66b5e57 --- /dev/null +++ b/hw-sign-browser/tsconfig.json @@ -0,0 +1,11 @@ +{ + "files": [], + "references": [ + { + "path": "./tsconfig.node.json" + }, + { + "path": "./tsconfig.app.json" + } + ] +} diff --git a/hw-sign-browser/tsconfig.node.json b/hw-sign-browser/tsconfig.node.json new file mode 100644 index 0000000..a83dfc9 --- /dev/null +++ b/hw-sign-browser/tsconfig.node.json @@ -0,0 +1,19 @@ +{ + "extends": "@tsconfig/node22/tsconfig.json", + "include": [ + "vite.config.*", + "vitest.config.*", + "cypress.config.*", + "nightwatch.conf.*", + "playwright.config.*", + "eslint.config.*" + ], + "compilerOptions": { + "noEmit": true, + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + + "module": "ESNext", + "moduleResolution": "Bundler", + "types": ["node"] + } +} diff --git a/hw-sign-browser/vite.config.ts b/hw-sign-browser/vite.config.ts new file mode 100644 index 0000000..4217010 --- /dev/null +++ b/hw-sign-browser/vite.config.ts @@ -0,0 +1,18 @@ +import { fileURLToPath, URL } from 'node:url' + +import { defineConfig } from 'vite' +import vue from '@vitejs/plugin-vue' +import vueDevTools from 'vite-plugin-vue-devtools' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [ + vue(), + vueDevTools(), + ], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + }, + }, +}) diff --git a/hw-sign-go/go.mod b/hw-sign-go/go.mod new file mode 100644 index 0000000..b34c67c --- /dev/null +++ b/hw-sign-go/go.mod @@ -0,0 +1,7 @@ +module hw-sign-go + +go 1.24.1 + +require ( + github.com/patrickmn/go-cache v2.1.0+incompatible +) diff --git a/hw-sign-go/go.sum b/hw-sign-go/go.sum new file mode 100644 index 0000000..56af5f3 --- /dev/null +++ b/hw-sign-go/go.sum @@ -0,0 +1,6 @@ +github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc= +github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ= diff --git a/hw-sign-go/main.go b/hw-sign-go/main.go new file mode 100644 index 0000000..dcb05f3 --- /dev/null +++ b/hw-sign-go/main.go @@ -0,0 +1,1819 @@ +package main + +import ( + "bytes" + "crypto" + "crypto/ecdh" + "crypto/ecdsa" + "crypto/ed25519" + "crypto/elliptic" + "crypto/hmac" + "crypto/rand" + "crypto/rsa" + "crypto/sha1" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/binary" + "encoding/json" + "errors" + "fmt" + "log" + "math/big" + "net/http" + "strings" + "time" + + "github.com/patrickmn/go-cache" +) + +// Key type definitions +type KeyType string + +const ( + KeyTypeEd25519 KeyType = "ed25519" + KeyTypeECDSA KeyType = "ecdsa-p256" + KeyTypeRSAPSS KeyType = "rsa-2048-pss" + KeyTypeECDH KeyType = "ecdh-p256" +) + +// Unified key structures for better organization +type PublicKeyInfo struct { + Key []byte + Type KeyType +} + +type UnifiedKeyInfo struct { + PublicKey []byte // Public key for asymmetric crypto + KeyType KeyType // Type of key (ecdsa, rsa-2048, ed25519) + SymmetricKey []byte // AES-256 key for symmetric encryption (if available) + ServerPrivKey interface{} // Server's private key for ECDH (if applicable) + HwKey interface{} +} + +// In-memory caches with consistent expiration times +const ( + defaultCacheExpiry = 3 * time.Hour + cleanupInterval = 10 * time.Minute +) + +var ( + usersCache = cache.New(defaultCacheExpiry, cleanupInterval) // Cache for user data + accelKeys = cache.New(defaultCacheExpiry, cleanupInterval) // Cache for unified acceleration keys + tokensCache = cache.New(defaultCacheExpiry, cleanupInterval) // Cache for tokens and associated hardware keys + challengeCache = cache.New(5*time.Minute, time.Minute) // Cache for attestation challenges (shorter expiry) +) + +// TPM policy constants (from TPM20.cpp) +var ( + defaultUserPolicy = []byte{ + 0x8f, 0xcd, 0x21, 0x69, 0xab, 0x92, 0x69, 0x4e, + 0x0c, 0x63, 0x3f, 0x1a, 0xb7, 0x72, 0x84, 0x2b, + 0x82, 0x41, 0xbb, 0xc2, 0x02, 0x88, 0x98, 0x1f, + 0xc7, 0xac, 0x1e, 0xdd, 0xc1, 0xfd, 0xdb, 0x0e, + } + adminObjectChangeAuthPolicy = []byte{ + 0xe5, 0x29, 0xf5, 0xd6, 0x11, 0x28, 0x72, 0x95, + 0x4e, 0x8e, 0xd6, 0x60, 0x51, 0x17, 0xb7, 0x57, + 0xe2, 0x37, 0xc6, 0xe1, 0x95, 0x13, 0xa9, 0x49, + 0xfe, 0xe1, 0xf2, 0x04, 0xc4, 0x58, 0x02, 0x3a, + } + adminCertifyPolicy = []byte{ + 0xaf, 0x2c, 0xa5, 0x69, 0x69, 0x9c, 0x43, 0x6a, + 0x21, 0x00, 0x6f, 0x1c, 0xb8, 0xa2, 0x75, 0x6c, + 0x98, 0xbc, 0x1c, 0x76, 0x5a, 0x35, 0x59, 0xc5, + 0xfe, 0x1c, 0x3f, 0x5e, 0x72, 0x28, 0xa7, 0xe7, + } + adminCertifyPolicyNoPin = []byte{ + 0x04, 0x8e, 0x9a, 0x3a, 0xce, 0x08, 0x58, 0x3f, + 0x79, 0xf3, 0x44, 0xff, 0x78, 0x5b, 0xbe, 0xa9, + 0xf0, 0x7a, 0xc7, 0xfa, 0x33, 0x25, 0xb3, 0xd4, + 0x9a, 0x21, 0xdd, 0x51, 0x94, 0xc6, 0x58, 0x50, + } + adminActivateCredentialPolicy = []byte{ + 0xc4, 0x13, 0xa8, 0x47, 0xb1, 0x11, 0x12, 0xb1, + 0xcb, 0xdd, 0xd4, 0xec, 0xa4, 0xda, 0xaa, 0x15, + 0xa1, 0x85, 0x2c, 0x1c, 0x3b, 0xba, 0x57, 0x46, + 0x1d, 0x25, 0x76, 0x05, 0xf3, 0xd5, 0xaf, 0x53, + } +) + +// TPM constants +const ( + TPM_CC_PolicyPCR = 0x0000017F + TPM_CC_PolicyOR = 0x00000171 + TPM_ALG_SHA1 = 0x0004 + TPM_ALG_SHA256 = 0x000B + AVAILABLE_PLATFORM_PCRS = 24 +) + +// Custom logger for debugging +func debugLog(step string, format string, v ...interface{}) { + message := fmt.Sprintf(format, v...) + log.Printf("[DEBUG] %s: %s", step, message) +} + +// Helper function to read big-endian 16-bit value and following data +func readBigEndian2B(data []byte, cursor *int) (uint16, []byte, error) { + if len(data) < *cursor+2 { + return 0, nil, errors.New("insufficient data for 2B size") + } + + size := binary.BigEndian.Uint16(data[*cursor : *cursor+2]) + *cursor += 2 + + if len(data) < *cursor+int(size) { + return 0, nil, errors.New("insufficient data for 2B content") + } + + content := data[*cursor : *cursor+int(size)] + *cursor += int(size) + + return size, content, nil +} + +// Calculate user policy with PCR data +func calculateUserPolicyWithPCRs(pcrTable []byte, pcrMask uint32, pcrAlgId uint16, keyBlobPcrDigest []byte) ([]byte, error) { + var digestSize int + if pcrAlgId == TPM_ALG_SHA256 { + digestSize = 32 + } else if pcrAlgId == TPM_ALG_SHA1 { + digestSize = 20 + } else { + return nil, fmt.Errorf("unsupported PCR algorithm: 0x%04X", pcrAlgId) + } + + // Build PCR composite from selected PCRs + var pcrComposite []byte + for n := 0; n < AVAILABLE_PLATFORM_PCRS; n++ { + if (pcrMask & (1 << n)) != 0 { + start := n * digestSize + end := start + digestSize + if len(pcrTable) < end { + return nil, fmt.Errorf("insufficient PCR data for PCR %d", n) + } + pcrComposite = append(pcrComposite, pcrTable[start:end]...) + } + } + + // Calculate PCR composite digest using SHA256 (determined by policy, not PCR bank algorithm) + h := sha256.New() + h.Write(pcrComposite) + pcrCompositeDigest := h.Sum(nil) + + // Verify PCR composite digest matches key blob + if !bytes.Equal(keyBlobPcrDigest, pcrCompositeDigest) { + return nil, errors.New("PCR composite digest mismatch") + } + + // Build policy digest buffer for PCR policy calculation + policyDigestBuffer := make([]byte, 0, 32+4+4+2+1+3+32) + + // Add default user policy + policyDigestBuffer = append(policyDigestBuffer, defaultUserPolicy...) + + // Add TPM_CC_PolicyPCR + tpmCcBytes := make([]byte, 4) + binary.BigEndian.PutUint32(tpmCcBytes, TPM_CC_PolicyPCR) + policyDigestBuffer = append(policyDigestBuffer, tpmCcBytes...) + + // Add TPML_PCR_SELECTION.count (1) + countBytes := make([]byte, 4) + binary.BigEndian.PutUint32(countBytes, 1) + policyDigestBuffer = append(policyDigestBuffer, countBytes...) + + // Add TPML_PCR_SELECTION.TPMS_PCR_SELECTION.hash + algBytes := make([]byte, 2) + binary.BigEndian.PutUint16(algBytes, pcrAlgId) + policyDigestBuffer = append(policyDigestBuffer, algBytes...) + + // Add TPML_PCR_SELECTION.TPMS_PCR_SELECTION.sizeofSelect (3) + policyDigestBuffer = append(policyDigestBuffer, 0x03) + + // Add TPML_PCR_SELECTION.TPMS_PCR_SELECTION.Select (3 bytes) + pcrSelectBytes := make([]byte, 3) + pcrSelectBytes[0] = byte(pcrMask & 0xFF) + pcrSelectBytes[1] = byte((pcrMask >> 8) & 0xFF) + pcrSelectBytes[2] = byte((pcrMask >> 16) & 0xFF) + policyDigestBuffer = append(policyDigestBuffer, pcrSelectBytes...) + + // Add PCR digest + policyDigestBuffer = append(policyDigestBuffer, pcrCompositeDigest...) + + // Calculate final policy digest using SHA256 + h = sha256.New() + h.Write(policyDigestBuffer) + return h.Sum(nil), nil +} + +// Attestation structures +type AttestationRequest struct { + Attestation string `json:"attestation"` + AIKPublicKey string `json:"aik_public_key"` + PCRValues string `json:"pcr_values"` + KeyType string `json:"key_type"` + Nonce string `json:"nonce,omitempty"` +} + +type ChallengeResponse struct { + Nonce string `json:"nonce"` +} + +// ============ Crypto Utility Functions ============ + +// Generate cryptographically secure random string +func generateRandomString(n int) (string, error) { + b := make([]byte, n) + if _, err := rand.Read(b); err != nil { + return "", err + } + return base64.StdEncoding.EncodeToString(b), nil +} + +// Parse public key from base64 encoded string based on key type +func parsePublicKey(keyData string, keyType string) (interface{}, error) { + debugLog("parsePublicKey", "Parsing %s key, length: %d", keyType, len(keyData)) + decoded, err := base64.StdEncoding.DecodeString(keyData) + if err != nil { + return nil, fmt.Errorf("failed to decode key: %w", err) + } + + // Normalize key type to lowercase + keyType = strings.ToLower(keyType) + + switch keyType { + case string(KeyTypeEd25519): + return parseEd25519PublicKey(decoded) + + case string(KeyTypeECDSA): + return parseECDSAPublicKey(decoded) + + case string(KeyTypeRSAPSS): + return parseRSAPublicKey(decoded) + + case string(KeyTypeECDH): + return parseECDHPublicKey(decoded) + } + + return nil, errors.New("unsupported key type") +} + +func parseEd25519PublicKey(decoded []byte) (interface{}, error) { + if len(decoded) != ed25519.PublicKeySize { + return nil, errors.New("invalid Ed25519 key size") + } + return ed25519.PublicKey(decoded), nil +} + +func parseECDSAPublicKey(decoded []byte) (interface{}, error) { + // Try uncompressed point format first + if len(decoded) == 65 && decoded[0] == 0x04 { + return parseRawECDSAPublicKeyX962(decoded) + } + + // Otherwise try PKIX format + key, err := x509.ParsePKIXPublicKey(decoded) + if err != nil { + return nil, fmt.Errorf("failed to parse ECDSA public key: %w", err) + } + + if ecKey, ok := key.(*ecdsa.PublicKey); ok { + return ecKey, nil + } + return nil, errors.New("key is not ECDSA") +} + +func parseRSAPublicKey(decoded []byte) (interface{}, error) { + key, err := x509.ParsePKIXPublicKey(decoded) + if err != nil { + return nil, fmt.Errorf("failed to parse RSA public key: %w", err) + } + if rsaKey, ok := key.(*rsa.PublicKey); ok { + return rsaKey, nil + } + return nil, errors.New("key is not RSA") +} + +func parseECDHPublicKey(decoded []byte) (interface{}, error) { + curve := ecdh.P256() + + // Try to handle the key directly first + pubKey, err := curve.NewPublicKey(decoded) + if err == nil { + return pubKey, nil + } + + // Try uncompressed point format + if len(decoded) == 65 && decoded[0] == 0x04 { + x := new(big.Int).SetBytes(decoded[1:33]) + y := new(big.Int).SetBytes(decoded[33:65]) + + if !elliptic.P256().IsOnCurve(x, y) { + return nil, fmt.Errorf("point is not on P-256 curve") + } + + rawKey := elliptic.Marshal(elliptic.P256(), x, y) + return curve.NewPublicKey(rawKey) + } + + // Try PKIX format + key, err := x509.ParsePKIXPublicKey(decoded) + if err == nil { + if ecKey, ok := key.(*ecdsa.PublicKey); ok && ecKey.Curve == elliptic.P256() { + rawKey := elliptic.Marshal(ecKey.Curve, ecKey.X, ecKey.Y) + return curve.NewPublicKey(rawKey) + } + } + + return nil, fmt.Errorf("invalid or unsupported ECDH key format") +} + +// Parse raw ECDSA public key in X9.62 uncompressed point format +func parseRawECDSAPublicKeyX962(data []byte) (*ecdsa.PublicKey, error) { + if len(data) != 65 || data[0] != 0x04 { + return nil, fmt.Errorf("invalid EC public key format") + } + + x := new(big.Int).SetBytes(data[1:33]) + y := new(big.Int).SetBytes(data[33:65]) + + pubKey := &ecdsa.PublicKey{ + Curve: elliptic.P256(), // Assuming P-256 + X: x, + Y: y, + } + return pubKey, nil +} + +// Verify a signature using the appropriate algorithm based on key type +func verifySignature(publicKey interface{}, data []byte, signature []byte) bool { + hash := sha256.Sum256(data) + + switch key := publicKey.(type) { + case ed25519.PublicKey: + return ed25519.Verify(key, data, signature) + + case *ecdsa.PublicKey: + // Try ASN.1 signature first + if ecdsa.VerifyASN1(key, hash[:], signature) { + return true + } + // Fallback to raw r||s format + if len(signature) == 64 { + r := new(big.Int).SetBytes(signature[:32]) + s := new(big.Int).SetBytes(signature[32:]) + return ecdsa.Verify(key, hash[:], r, s) + } + return false + + case *rsa.PublicKey: + opts := &rsa.PSSOptions{ + SaltLength: rsa.PSSSaltLengthAuto, + Hash: crypto.SHA256, + } + err := rsa.VerifyPSS(key, crypto.SHA256, hash[:], signature, opts) + return err == nil + + default: + return false + } +} + +// Generate a new ECDH key pair +func generateECDHKeyPair() (*ecdh.PrivateKey, error) { + curve := ecdh.P256() + return curve.GenerateKey(rand.Reader) +} + +// ============ AES Encryption Functions ============ + +// Validate request with HMAC +func validateHMACRequest(symmetricKey []byte, data, sig string) error { + debugLog("HMAC", "Validating HMAC for data (%d chars)", len(data)) + if sig == "" { + return errors.New("missing HMAC signature") + } + + // Log the input for debugging + log.Printf("HMAC debug - data: %s, sig: %s", data, sig) + + // Compute HMAC using SHA-256 + mac := hmac.New(sha256.New, symmetricKey) + mac.Write([]byte(data)) + expectedHMAC := mac.Sum(nil) + expectedBase64 := base64.StdEncoding.EncodeToString(expectedHMAC) + + // Debug info + log.Printf("HMAC debug - computed base64: %s", expectedBase64) + + // Decode the received signature + sigBytes, err := base64.StdEncoding.DecodeString(sig) + if err != nil { + return fmt.Errorf("invalid HMAC format: %w", err) + } + + // Compare both ways for debugging + log.Printf("HMAC debug - bytes equal: %v", bytes.Equal(sigBytes, expectedHMAC)) + log.Printf("HMAC debug - base64 equal: %v", sig == expectedBase64) + + // Compare the HMACs + if !bytes.Equal(sigBytes, expectedHMAC) { + // Return more information for debugging + return fmt.Errorf("HMAC mismatch: expected %s, got %s", expectedBase64, sig) + } + + return nil +} + +// Compute shared secret from ECDH key exchange +func computeSharedSecret(privateKey *ecdh.PrivateKey, publicKey *ecdh.PublicKey) ([]byte, error) { + debugLog("ECDH", "Computing shared secret between keys") + sharedSecret, err := privateKey.ECDH(publicKey) + if err != nil { + return nil, err + } + + // Log for debugging + log.Printf("HMAC debug - derived key hash: %s", base64.StdEncoding.EncodeToString(sharedSecret[:])) + + // The derived secret should be 32 bytes for P-256 curve + return sharedSecret[:], nil +} + +// ============ HTTP Helper Functions ============ + +// Add CORS headers to response +func setCORSHeaders(w http.ResponseWriter) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Methods", "GET, POST, OPTIONS") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization, x-rpc-sec-bound-token-hw-pub, x-rpc-sec-bound-token-hw-pub-type, x-rpc-sec-bound-token-accel-pub, x-rpc-sec-bound-token-accel-pub-type, x-rpc-sec-bound-token-accel-pub-sig, x-rpc-sec-bound-token-data, x-rpc-sec-bound-token-data-sig, x-rpc-sec-bound-token-accel-pub-id") + w.Header().Set("Access-Control-Expose-Headers", "x-rpc-sec-bound-token-accel-pub-id, x-rpc-sec-bound-token-accel-pub") +} + +// Send error response with CORS headers +func errorResponse(w http.ResponseWriter, message string, status int) { + setCORSHeaders(w) + http.Error(w, message, status) +} + +// Send authentication success response +func sendAuthenticationSuccess(w http.ResponseWriter) { + setCORSHeaders(w) + w.WriteHeader(http.StatusOK) + json.NewEncoder(w).Encode(map[string]bool{"authenticated": true}) +} + +// Verify signed data with proper error handling +func verifySignedData(key interface{}, data string, signature string) error { + sigDecoded, err := base64.StdEncoding.DecodeString(signature) + if err != nil { + return fmt.Errorf("invalid signature format: %w", err) + } + + if !verifySignature(key, []byte(data), sigDecoded) { + return errors.New("invalid signature") + } + + return nil +} + +// Parse and validate key with proper error handling +func parseAndValidateKey(keyData string, keyType string, keyDesc string) (interface{}, error) { + if keyData == "" || keyType == "" { + return nil, fmt.Errorf("missing %s or type", keyDesc) + } + + key, err := parsePublicKey(keyData, keyType) + if err != nil { + return nil, fmt.Errorf("invalid %s: %w", keyDesc, err) + } + + return key, nil +} + +// ============ HTTP Handlers ============ + +// Register new user +func registerHandler(w http.ResponseWriter, r *http.Request) { + debugLog("registerHandler", "Received registration request from %s", r.RemoteAddr) + setCORSHeaders(w) + if r.Method == "OPTIONS" { + w.WriteHeader(http.StatusOK) + return + } + + var userData struct { + Username string `json:"username"` + Password string `json:"password"` + } + + if err := json.NewDecoder(r.Body).Decode(&userData); err != nil { + errorResponse(w, "Invalid request body", http.StatusBadRequest) + return + } + + // Store user data + usersCache.Set(userData.Username, userData, cache.DefaultExpiration) + + log.Printf("Registered user: %s", userData.Username) + + w.WriteHeader(http.StatusCreated) + json.NewEncoder(w).Encode(map[string]string{"message": "User registered successfully"}) +} + +// Login and get auth token +func loginHandler(w http.ResponseWriter, r *http.Request) { + debugLog("loginHandler", "Received login request from %s", r.RemoteAddr) + setCORSHeaders(w) + if r.Method == "OPTIONS" { + w.WriteHeader(http.StatusOK) + return + } + + var credentials struct { + Username string `json:"username"` + Password string `json:"password"` + } + + if err := json.NewDecoder(r.Body).Decode(&credentials); err != nil { + errorResponse(w, "Invalid request body", http.StatusBadRequest) + return + } + + // Get and validate hardware public key + hwPubKey := r.Header.Get("x-rpc-sec-bound-token-hw-pub") + hwPubType := r.Header.Get("x-rpc-sec-bound-token-hw-pub-type") + + if hwPubKey == "" || hwPubType == "" { + errorResponse(w, "Missing hardware public key or type", http.StatusBadRequest) + return + } + + // Parse and validate hardware public key format + _, err := parsePublicKey(hwPubKey, hwPubType) + if err != nil { + errorResponse(w, fmt.Sprintf("Invalid hardware public key: %v", err), http.StatusBadRequest) + return + } + + // Verify user credentials + userData, found := usersCache.Get(credentials.Username) + if !found || userData.(struct { + Username string `json:"username"` + Password string `json:"password"` + }).Password != credentials.Password { + errorResponse(w, "Invalid username or password", http.StatusUnauthorized) + return + } + + // Generate and store token + token, err := generateRandomString(32) + if err != nil { + errorResponse(w, "Failed to generate token", http.StatusInternalServerError) + return + } + + tokensCache.Set(token, PublicKeyInfo{ + Key: []byte(hwPubKey), + Type: KeyType(strings.ToLower(hwPubType)), + }, cache.DefaultExpiration) + + log.Printf("User logged in: %s with key type: %s", credentials.Username, hwPubType) + + w.WriteHeader(http.StatusOK) + json.NewEncoder(w).Encode(map[string]string{"token": token}) +} + +// ============ Enhanced Crypto Utility Functions ============ + +// Verify ECDSA signature and then use the same key for ECDH key exchange +func verifyDataWithCliPubECDSA(clientPubKeyData string, data string, signature string) (*ecdsa.PublicKey, error) { + debugLog("verifyDataWithCliPubECDSA", "Processing dual-purpose P-256 key, data: %s", data) + + // First parse as ECDSA public key for signature verification + ecdsaKey, err := parsePublicKeyAsECDSAAndCheckCurveForECDH(clientPubKeyData) + if err != nil { + return nil, fmt.Errorf("failed to parse ECDSA key: %w", err) + } + + // Verify the data signature using ECDSA + if err := verifyECDSASignature(ecdsaKey, data, signature); err != nil { + return nil, fmt.Errorf("ECDSA signature verification failed: %w", err) + } + + debugLog("verifyDataWithCliPubECDSA", "ECDSA signature verified successfully") + return ecdsaKey, nil +} + +// Parse ECDSA public key specifically for dual ECDSA/ECDH usage +func parsePublicKeyAsECDSAAndCheckCurveForECDH(keyData string) (*ecdsa.PublicKey, error) { + decoded, err := base64.StdEncoding.DecodeString(keyData) + if err != nil { + return nil, fmt.Errorf("failed to decode key: %w", err) + } + + // Try uncompressed point format first (0x04 prefix) + if len(decoded) == 65 && decoded[0] == 0x04 { + return parseRawECDSAPublicKeyX962(decoded) + } + + // Try PKIX format + key, err := x509.ParsePKIXPublicKey(decoded) + if err != nil { + return nil, fmt.Errorf("failed to parse PKIX public key: %w", err) + } + + ecdsaKey, ok := key.(*ecdsa.PublicKey) + if !ok { + return nil, errors.New("key is not ECDSA") + } + + // Ensure it's P-256 curve for dual usage + if ecdsaKey.Curve != elliptic.P256() { + return nil, errors.New("key must use P-256 curve for dual ECDSA/ECDH usage") + } + + return ecdsaKey, nil +} + +// Verify ECDSA signature specifically +func verifyECDSASignature(publicKey *ecdsa.PublicKey, data string, signature string) error { + sigBytes, err := base64.StdEncoding.DecodeString(signature) + if err != nil { + return fmt.Errorf("invalid signature format: %w", err) + } + + hash := sha256.Sum256([]byte(data)) + + // Try ASN.1 signature format first + if ecdsa.VerifyASN1(publicKey, hash[:], sigBytes) { + return nil + } + + // Try raw r||s format (64 bytes for P-256) + if len(sigBytes) == 64 { + r := new(big.Int).SetBytes(sigBytes[:32]) + s := new(big.Int).SetBytes(sigBytes[32:]) + if ecdsa.Verify(publicKey, hash[:], r, s) { + return nil + } + } + + return errors.New("signature verification failed") +} + +// Convert ECDSA public key to ECDH public key for key exchange +func convertECDSAToECDH(ecdsaKey *ecdsa.PublicKey) (*ecdh.PublicKey, error) { + debugLog("convertECDSAToECDH", "Converting ECDSA P-256 key to ECDH format") + + if ecdsaKey.Curve != elliptic.P256() { + return nil, errors.New("only P-256 curve supported for ECDSA to ECDH conversion") + } + + // Marshal the ECDSA public key to uncompressed point format + rawKey := elliptic.Marshal(ecdsaKey.Curve, ecdsaKey.X, ecdsaKey.Y) + + // Create ECDH public key from the marshaled data + curve := ecdh.P256() + ecdhKey, err := curve.NewPublicKey(rawKey) + if err != nil { + return nil, fmt.Errorf("failed to create ECDH key: %w", err) + } + + return ecdhKey, nil +} + +// Perform ECDH key exchange and return shared secret +func performECDHKeyExchange(serverPrivKey *ecdh.PrivateKey, clientECDHKey *ecdh.PublicKey) ([]byte, error) { + debugLog("performECDHKeyExchange", "Performing ECDH key exchange with client's P-256 key") + + // Compute shared secret + sharedSecret, err := computeSharedSecret(serverPrivKey, clientECDHKey) + if err != nil { + return nil, fmt.Errorf("ECDH computation failed: %w", err) + } + + debugLog("performECDHKeyExchange", "ECDH key exchange completed, shared secret length: %d", len(sharedSecret)) + return sharedSecret, nil +} + +// Handle acceleration key registration with enhanced dual-purpose ECDSA/ECDH support +func verifyAccelKeyRegistrationRequest(w http.ResponseWriter, r *http.Request, hwKeyInfo PublicKeyInfo) error { + debugLog("verifyAccelKeyRegistration", "Processing acceleration key registration, hw key type: %s", hwKeyInfo.Type) + + // Get request headers + accelPub := r.Header.Get("x-rpc-sec-bound-token-accel-pub") + accelPubType := r.Header.Get("x-rpc-sec-bound-token-accel-pub-type") + accelPubSig := r.Header.Get("x-rpc-sec-bound-token-accel-pub-sig") + data := r.Header.Get("x-rpc-sec-bound-token-data") + dataSig := r.Header.Get("x-rpc-sec-bound-token-data-sig") + + if accelPub == "" || accelPubType == "" || accelPubSig == "" { + errorResponse(w, "Missing acceleration key or signature", http.StatusBadRequest) + return errors.New("missing acceleration key or signature") + } + + // Parse hardware key for verification + hwKey, err := parseAndValidateKey(string(hwKeyInfo.Key), string(hwKeyInfo.Type), "hardware key") + if err != nil { + errorResponse(w, err.Error(), http.StatusUnauthorized) + return err + } + + // Verify acceleration key is signed by hardware key + if err := verifySignedData(hwKey, accelPub, accelPubSig); err != nil { + errorResponse(w, fmt.Sprintf("hardware key verification failed: %v", err), http.StatusUnauthorized) + return err + } + + // Generate key ID + accelKeyId, err := generateRandomString(16) + if err != nil { + errorResponse(w, "Failed to generate key ID", http.StatusInternalServerError) + return err + } + + // Create unified key info + unifiedKey := UnifiedKeyInfo{ + PublicKey: []byte(accelPub), + KeyType: KeyType(strings.ToLower(accelPubType)), + } + + // Handle ECDH case with dual-purpose ECDSA/ECDH key + if strings.ToLower(accelPubType) == string(KeyTypeECDH) { + if err := performDualPurposeECDHExchange(w, accelPub, data, dataSig, &unifiedKey); err != nil { + errorResponse(w, err.Error(), http.StatusBadRequest) + return err + } + } else { + // Handle regular asymmetric key case + if err := validateAsymmetricRequest(unifiedKey, data, dataSig); err != nil { + errorResponse(w, err.Error(), http.StatusUnauthorized) + return err + } + } + + // Store the unified key + accelKeys.Set(accelKeyId, unifiedKey, cache.DefaultExpiration) + w.Header().Set("x-rpc-sec-bound-token-accel-pub-id", accelKeyId) + + debugLog("verifyAccelKeyRegistration", "Acceleration key registered with ID: %s", accelKeyId) + return nil +} + +// Setup ECDH exchange with dual-purpose ECDSA/ECDH key +func performDualPurposeECDHExchange(w http.ResponseWriter, accelPub string, data string, dataSig string, unifiedKey *UnifiedKeyInfo) error { + debugLog("performDualPurposeECDHExchange", "Setting up dual-purpose ECDSA/ECDH exchange") + + if data == "" || dataSig == "" { + return errors.New("missing data or signature for ECDH initial verification") + } + + // Step 1: Verify ECDSA signature of data, and convert the key to ECDH public key, must be SECG secp256r1 / X9.62 prime256v1 curve. + clientECDSAPub, err := verifyDataWithCliPubECDSA(accelPub, data, dataSig) + if err != nil { + return fmt.Errorf("dual-purpose key verification failed: %v", err) + } + + // Convert client's ECDSA key to ECDH format + clientECDHPub, err := convertECDSAToECDH(clientECDSAPub) + if err != nil { + return fmt.Errorf("failed to convert client key to ECDH: %w", err) + } + + // Step 2: Generate server's Random ECDH key pair + serverECDHPriv, err := generateECDHKeyPair() + if err != nil { + return fmt.Errorf("failed to generate server ECDH key: %v", err) + } + + // Step 3: Perform ECDH key exchange + sharedSecret, err := performECDHKeyExchange(serverECDHPriv, clientECDHPub) + if err != nil { + return fmt.Errorf("ECDH key exchange failed: %v", err) + } + + // Step 4: Return server's public key to client + serverPubKeyBytes, _ := x509.MarshalPKIXPublicKey(serverECDHPriv.PublicKey()) + serverPubKeyBase64 := base64.StdEncoding.EncodeToString(serverPubKeyBytes) + w.Header().Set("x-rpc-sec-bound-token-accel-pub", serverPubKeyBase64) + + // Step 5: Store the results in unified key info + unifiedKey.SymmetricKey = sharedSecret + unifiedKey.ServerPrivKey = serverECDHPriv + + debugLog("performDualPurposeECDHExchange", "Dual-purpose ECDH exchange completed successfully") + return nil +} + +// Verify authenticated requests +func verifyRequest(w http.ResponseWriter, r *http.Request, keyInfo UnifiedKeyInfo) error { + debugLog("verifyRequest", "Verifying request, key type: %s, has symmetric key: %v", keyInfo.KeyType, keyInfo.SymmetricKey != nil) + + // Get data and signature from request + data := r.Header.Get("x-rpc-sec-bound-token-data") + dataSig := r.Header.Get("x-rpc-sec-bound-token-data-sig") + + debugLog("verifyRequest", "Request data: %s, signature length: %d", data, len(dataSig)) + + // Special case for ECDH initial requests + if keyInfo.KeyType == KeyTypeECDH && keyInfo.HwKey != nil { + // This is an initial ECDH request that should be verified with hardware key + hwKey := keyInfo.HwKey + + // Verify that we have the data and signature + if data == "" || dataSig == "" { + errorResponse(w, "missing data or signature for verification", http.StatusUnauthorized) + return errors.New("missing data or signature for verification") + } + + // Verify the data signature using the hardware key + if err := verifySignedData(hwKey, data, dataSig); err != nil { + errorResponse(w, fmt.Sprintf("failed to verify data signature: %v", err), http.StatusUnauthorized) + return err + } + + log.Printf("ECDH initial auth successful with hardware key: %s", data) + return nil + } + + if dataSig != "" && keyInfo.SymmetricKey != nil { + debugLog("verifyRequest", "Using HMAC validation with symmetric key, length: %d", len(keyInfo.SymmetricKey)) + // Handle HMAC case + if err := validateHMACRequest(keyInfo.SymmetricKey, data, dataSig); err != nil { + log.Printf("HMAC validation failed: %v", err) + errorResponse(w, err.Error(), http.StatusUnauthorized) + return err + } + log.Printf("HMAC auth successful: %s", data) + } else { + debugLog("verifyRequest", "Using asymmetric signature validation") + // Handle asymmetric signature case + if err := validateAsymmetricRequest(keyInfo, data, dataSig); err != nil { + errorResponse(w, err.Error(), http.StatusUnauthorized) + return err + } + log.Printf("Asymmetric auth successful: %s", data) + } + + // Authentication succeeded + return nil +} + +// Validate request with asymmetric signature +func validateAsymmetricRequest(keyInfo UnifiedKeyInfo, data, dataSig string) error { + debugLog("asymmetricValidation", "Validating asymmetric signature, key type: %s", keyInfo.KeyType) + if data == "" || dataSig == "" { + return errors.New("missing required headers for asymmetric verification") + } + + // Parse and validate acceleration public key + accelKey, err := parseAndValidateKey(string(keyInfo.PublicKey), string(keyInfo.KeyType), "acceleration key") + if err != nil { + return err + } + + // Verify request is signed by acceleration key + if err := verifySignedData(accelKey, data, dataSig); err != nil { + return err + } + + return nil +} + +// Handle request using an existing key +func verifyExistingKeyRequest(w http.ResponseWriter, r *http.Request) error { + accelKeyId := r.Header.Get("x-rpc-sec-bound-token-accel-pub-id") + debugLog("verifyExistingKey", "Verifying request with existing key ID: %s", accelKeyId) + if accelKeyId == "" { + errorResponse(w, "Missing acceleration key ID", http.StatusBadRequest) + return errors.New("missing acceleration key ID") + } + + // Get the key info + keyInfoValue, found := accelKeys.Get(accelKeyId) + if !found { + errorResponse(w, "Invalid acceleration key ID", http.StatusUnauthorized) + return errors.New("invalid acceleration key ID") + } + unifiedKey := keyInfoValue.(UnifiedKeyInfo) + + // Validate the request + return verifyRequest(w, r, unifiedKey) +} + +// Main endpoint for all authenticated requests +func authenticatedHandler(w http.ResponseWriter, r *http.Request) { + debugLog("authenticatedHandler", "Received authenticated request from %s, method: %s", r.RemoteAddr, r.Method) + setCORSHeaders(w) + if r.Method == "OPTIONS" { + w.WriteHeader(http.StatusOK) + return + } + + // Validate token + token, err := extractAndValidateToken(r) + if err != nil { + errorResponse(w, err.Error(), http.StatusUnauthorized) + return + } + + // Get hardware key info associated with the token + tokenInfoValue, found := tokensCache.Get(token) + if !found { + errorResponse(w, "Invalid token", http.StatusUnauthorized) + return + } + hwKeyInfo := tokenInfoValue.(PublicKeyInfo) + + // Handle either key registration or regular request + if r.Header.Get("x-rpc-sec-bound-token-accel-pub") != "" { + debugLog("authenticatedHandler", "Request includes new acceleration key") + // This is a new key registration (either asymmetric or ECDH) + err = verifyAccelKeyRegistrationRequest(w, r, hwKeyInfo) + if err != nil { + errorResponse(w, err.Error(), http.StatusBadRequest) + return + } + } else { + debugLog("authenticatedHandler", "Request uses existing key") + // Handle request with existing key + err = verifyExistingKeyRequest(w, r) + if err != nil { + errorResponse(w, err.Error(), http.StatusUnauthorized) + return + } + } + + // If we reach here, the request is authenticated. Run business logic + sendAuthenticationSuccess(w) +} + +// Extract and validate the authorization token +func extractAndValidateToken(r *http.Request) (string, error) { + debugLog("tokenValidation", "Extracting token from Authorization header") + authHeader := r.Header.Get("Authorization") + if !strings.HasPrefix(authHeader, "Bearer ") { + return "", errors.New("invalid authorization header") + } + return strings.TrimPrefix(authHeader, "Bearer "), nil +} + +// Challenge handler - generates nonce for attestation +func challengeHandler(w http.ResponseWriter, r *http.Request) { + debugLog("challengeHandler", "Received challenge request from %s", r.RemoteAddr) + setCORSHeaders(w) + if r.Method == "OPTIONS" { + w.WriteHeader(http.StatusOK) + return + } + + // Extract and validate token + token, err := extractAndValidateToken(r) + if err != nil { + errorResponse(w, err.Error(), http.StatusUnauthorized) + return + } + + // Verify token exists in cache + _, found := tokensCache.Get(token) + if !found { + errorResponse(w, "Invalid token", http.StatusUnauthorized) + return + } + + // Generate a fresh nonce + nonce, err := generateRandomString(32) + if err != nil { + errorResponse(w, "Failed to generate challenge", http.StatusInternalServerError) + return + } + + // Store the nonce with the token for later verification + challengeCache.Set(token+":nonce", nonce, cache.DefaultExpiration) + + log.Printf("Generated attestation challenge for token: %s", token[:8]+"...") + + w.WriteHeader(http.StatusOK) + json.NewEncoder(w).Encode(ChallengeResponse{Nonce: nonce}) +} + +// Validate TPM key attestation structure +func validateTpmKeyAttestation(attestationBytes []byte, aikPubBytes []byte, nonce string) error { + debugLog("validateTpmKeyAttestation", "Validating TPM key attestation, size: %d bytes", len(attestationBytes)) + + // Check minimum size for PCP_KEY_ATTESTATION_BLOB header + if len(attestationBytes) < 24 { // Magic(4) + Platform(4) + HeaderSize(4) + cbKeyAttest(4) + cbSignature(4) + cbKeyBlob(4) + return errors.New("attestation blob too small") + } + + // Parse the PCP_KEY_ATTESTATION_BLOB header + magic := binary.LittleEndian.Uint32(attestationBytes[0:4]) + platform := binary.LittleEndian.Uint32(attestationBytes[4:8]) + headerSize := binary.LittleEndian.Uint32(attestationBytes[8:12]) + cbKeyAttest := binary.LittleEndian.Uint32(attestationBytes[12:16]) + cbSignature := binary.LittleEndian.Uint32(attestationBytes[16:20]) + cbKeyBlob := binary.LittleEndian.Uint32(attestationBytes[20:24]) + + debugLog("validateTpmKeyAttestation", "Magic: 0x%08X, Platform: %d, HeaderSize: %d", magic, platform, headerSize) + debugLog("validateTpmKeyAttestation", "KeyAttest: %d, Signature: %d, KeyBlob: %d", cbKeyAttest, cbSignature, cbKeyBlob) + + // Validate magic number for key attestation + const PCP_KEY_ATTESTATION_MAGIC = 0x4B414453 // 'SDAK' in little endian + if magic != PCP_KEY_ATTESTATION_MAGIC { + return fmt.Errorf("invalid magic number: expected 0x%08X, got 0x%08X", PCP_KEY_ATTESTATION_MAGIC, magic) + } + + // Validate platform type (TPM 1.2 or 2.0) + const PCPTYPE_TPM12 = 0x00000001 + const PCPTYPE_TPM20 = 0x00000002 + if platform != PCPTYPE_TPM12 && platform != PCPTYPE_TPM20 { + return fmt.Errorf("invalid platform type: %d", platform) + } + + // Validate header size + if headerSize < 24 { + return fmt.Errorf("invalid header size: %d", headerSize) + } + + // Check that the blob is large enough to contain all claimed data + expectedSize := headerSize + cbKeyAttest + cbSignature + cbKeyBlob + if uint32(len(attestationBytes)) < expectedSize { + return fmt.Errorf("attestation blob size mismatch: expected at least %d, got %d", expectedSize, len(attestationBytes)) + } + + // Validate AIK public key size (should be reasonable for ECDSA P-256 or RSA) + if len(aikPubBytes) < 64 || len(aikPubBytes) > 2048 { + return fmt.Errorf("invalid AIK public key size: %d", len(aikPubBytes)) + } + + // Additional validation could include: + // - Parsing and validating the TPM2B_ATTEST structure within cbKeyAttest + // - Verifying the signature using the AIK public key + // - Checking nonce inclusion if provided + // For now, we accept the attestation if it has the correct structure + + debugLog("validateTpmKeyAttestation", "TPM key attestation validation passed") + return nil +} + +// Attestation handler - verifies TPM key attestation +func attestationHandler(w http.ResponseWriter, r *http.Request) { + debugLog("attestationHandler", "Received attestation request from %s", r.RemoteAddr) + setCORSHeaders(w) + if r.Method == "OPTIONS" { + w.WriteHeader(http.StatusOK) + return + } + + // Extract and validate token + token, err := extractAndValidateToken(r) + if err != nil { + errorResponse(w, err.Error(), http.StatusUnauthorized) + return + } + + // Verify token exists in cache + _, found := tokensCache.Get(token) + if !found { + errorResponse(w, "Invalid token", http.StatusUnauthorized) + return + } + + // Parse the attestation request + var attestReq AttestationRequest + if err := json.NewDecoder(r.Body).Decode(&attestReq); err != nil { + errorResponse(w, "Invalid request body", http.StatusBadRequest) + return + } + + // Validate required fields + if attestReq.Attestation == "" || attestReq.AIKPublicKey == "" { + errorResponse(w, "Missing attestation or AIK public key", http.StatusBadRequest) + return + } + + // Verify nonce if provided + if attestReq.Nonce != "" { + expectedNonce, found := challengeCache.Get(token + ":nonce") + if !found { + errorResponse(w, "Invalid or expired nonce", http.StatusBadRequest) + return + } + + if expectedNonce.(string) != attestReq.Nonce { + errorResponse(w, "Nonce mismatch", http.StatusBadRequest) + return + } + + // Remove used nonce + challengeCache.Delete(token + ":nonce") + } + + // Decode and validate the TPM attestation structure + attestationBytes, err := base64.StdEncoding.DecodeString(attestReq.Attestation) + if err != nil { + errorResponse(w, "Invalid attestation format", http.StatusBadRequest) + return + } + + aikPubBytes, err := base64.StdEncoding.DecodeString(attestReq.AIKPublicKey) + if err != nil { + errorResponse(w, "Invalid AIK public key format", http.StatusBadRequest) + return + } + + // Validate TPM key attestation structure + if err := validateTmpKeyAttestation(attestationBytes, aikPubBytes, attestReq.Nonce, attestReq.PCRValues); err != nil { + errorResponse(w, fmt.Sprintf("TPM attestation validation failed: %v", err), http.StatusBadRequest) + return + } + + // Log successful attestation with PCR info + pcrInfo := "no PCRs" + if attestReq.PCRValues != "" { + pcrBytes, err := base64.StdEncoding.DecodeString(attestReq.PCRValues) + if err == nil && len(pcrBytes) > 0 { + // Determine PCR format + if len(pcrBytes)%24 == 0 { // 24 PCRs + digestSize := len(pcrBytes) / 24 + if digestSize == 20 { + pcrInfo = fmt.Sprintf("%d SHA1 PCRs", 24) + } else if digestSize == 32 { + pcrInfo = fmt.Sprintf("%d SHA256 PCRs", 24) + } else { + pcrInfo = fmt.Sprintf("%d PCRs (%d bytes each)", 24, digestSize) + } + } else { + pcrInfo = fmt.Sprintf("%d PCR bytes", len(pcrBytes)) + } + } + } + + log.Printf("TPM key attestation successful for token: %s, key type: %s, attestation size: %d bytes, PCRs: %s", + token[:8]+"...", attestReq.KeyType, len(attestationBytes), pcrInfo) + + // Store attestation info with token for future reference + tokensCache.Set(token+":attestation", map[string]interface{}{ + "attestation": attestReq.Attestation, + "aik_public_key": attestReq.AIKPublicKey, + "pcr_values": attestReq.PCRValues, + "key_type": attestReq.KeyType, + "timestamp": time.Now(), + "validated": true, + }, cache.DefaultExpiration) + + w.WriteHeader(http.StatusOK) + json.NewEncoder(w).Encode(map[string]interface{}{ + "status": "success", + "message": "TPM key attestation verified successfully", + "timestamp": time.Now(), + }) +} + +// Enhanced TPM key attestation validation with full cryptographic verification +func validateTmpKeyAttestation(attestationBytes []byte, aikPubBytes []byte, nonce string, pcrValues string) error { + debugLog("validateTmpKeyAttestation", "Validating TPM key attestation with crypto verification, size: %d bytes", len(attestationBytes)) + + // Check minimum size for PCP_KEY_ATTESTATION_BLOB header + if len(attestationBytes) < 24 { // Magic(4) + Platform(4) + HeaderSize(4) + cbKeyAttest(4) + cbSignature(4) + cbKeyBlob(4) + return errors.New("attestation blob too small") + } + + // Parse the PCP_KEY_ATTESTATION_BLOB header + magic := binary.LittleEndian.Uint32(attestationBytes[0:4]) + platform := binary.LittleEndian.Uint32(attestationBytes[4:8]) + headerSize := binary.LittleEndian.Uint32(attestationBytes[8:12]) + cbKeyAttest := binary.LittleEndian.Uint32(attestationBytes[12:16]) + cbSignature := binary.LittleEndian.Uint32(attestationBytes[16:20]) + cbKeyBlob := binary.LittleEndian.Uint32(attestationBytes[20:24]) + + debugLog("validateTmpKeyAttestation", "Magic: 0x%08X, Platform: %d, HeaderSize: %d", magic, platform, headerSize) + debugLog("validateTmpKeyAttestation", "KeyAttest: %d, Signature: %d, KeyBlob: %d", cbKeyAttest, cbSignature, cbKeyBlob) + + // Validate magic number for key attestation + const PCP_KEY_ATTESTATION_MAGIC = 0x5344414B + if magic != PCP_KEY_ATTESTATION_MAGIC { + return fmt.Errorf("invalid magic number: expected 0x%08X, got 0x%08X", PCP_KEY_ATTESTATION_MAGIC, magic) + } + + // Validate platform type (TPM 1.2 or 2.0) + const PCPTYPE_TPM12 = 0x00000001 + const PCPTYPE_TPM20 = 0x00000002 + if platform != PCPTYPE_TPM12 && platform != PCPTYPE_TPM20 { + return fmt.Errorf("invalid platform type: %d", platform) + } + + // Validate header size + if headerSize < 24 { + return fmt.Errorf("invalid header size: %d", headerSize) + } + + // Check that the blob is large enough to contain all claimed data + expectedSize := headerSize + cbKeyAttest + cbSignature + cbKeyBlob + if uint32(len(attestationBytes)) < expectedSize { + return fmt.Errorf("attestation blob size mismatch: expected at least %d, got %d", expectedSize, len(attestationBytes)) + } + + // Extract components from attestation blob + cursor := int(headerSize) + keyAttestData := attestationBytes[cursor : cursor+int(cbKeyAttest)] + cursor += int(cbKeyAttest) + signatureData := attestationBytes[cursor : cursor+int(cbSignature)] + cursor += int(cbSignature) + keyBlobData := attestationBytes[cursor : cursor+int(cbKeyBlob)] + + debugLog("validateTmpKeyAttestation", "Extracted components: KeyAttest=%d, Signature=%d, KeyBlob=%d bytes", + len(keyAttestData), len(signatureData), len(keyBlobData)) + + // Step 1: Parse and validate AIK public key + aikPubKey, err := parseAndValidateAIKPublicKey(aikPubBytes) + if err != nil { + return fmt.Errorf("failed to parse AIK public key: %w", err) + } + + // Step 2: Verify the attestation signature + if err := verifyAttestationSignature(aikPubKey, keyAttestData, signatureData); err != nil { + return fmt.Errorf("attestation signature verification failed: %w", err) + } + + // Step 3: Validate TPM attestation structure and nonce + if err := validateTPMAttestStructure(keyAttestData, nonce, platform); err != nil { + return fmt.Errorf("TPM attest structure validation failed: %w", err) + } + + // Step 4: Validate key blob and policies (based on ValidateKeyAttest20) + if err := validateKeyBlobAndPolicies(keyBlobData, keyAttestData, pcrValues, platform); err != nil { + return fmt.Errorf("key blob validation failed: %w", err) + } + + debugLog("validateTmpKeyAttestation", "TPM key attestation validation passed") + return nil +} + +// Validate key blob and TPM policies (based on ValidateKeyAttest20) +func validateKeyBlobAndPolicies(keyBlobData []byte, keyAttestData []byte, pcrValues string, platform uint32) error { + if platform != 0x00000002 { // Only TPM 2.0 supported for now + debugLog("validateKeyBlobAndPolicies", "Skipping key blob validation for platform %d", platform) + return nil + } + + debugLog("validateKeyBlobAndPolicies", "Validating key blob and policies, blob size: %d", len(keyBlobData)) + + // Parse PCP_KEY_BLOB_WIN8 header + if len(keyBlobData) < 72 { // Minimum size for PCP_KEY_BLOB_WIN8 + return errors.New("key blob too small for header") + } + + cursor := 0 + + // Read header fields + magic := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + if magic != 0x4D504350 { + return fmt.Errorf("invalid key blob magic: 0x%08X", magic) + } + + cbHeader := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + pcpType := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + + if pcpType != 0x00000002 { // PCPTYPE_TPM20 + return fmt.Errorf("invalid PCP type: %d, expected TPM 2.0", pcpType) + } + + if cbHeader < 56 { + return fmt.Errorf("invalid header size: %d", cbHeader) + } + + // Skip to the size fields + cursor = 16 // Skip to cbPublic + cbPublic := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + cbPrivate := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + cbMigrationPublic := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + cbMigrationPrivate := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + cbPolicyDigestList := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + cbPCRBinding := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + cbPCRDigest := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + cbEncryptedSecret := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + cbTpm12HostageBlob := binary.LittleEndian.Uint32(keyBlobData[cursor : cursor+4]) + + debugLog("validateKeyBlobAndPolicies", "Key blob sizes: Public=%d, Private=%d, PolicyDigestList=%d", + cbPublic, cbPrivate, cbPolicyDigestList) + + // Validate total size + expectedSize := cbHeader + cbPublic + cbPrivate + cbMigrationPublic + cbMigrationPrivate + + cbPolicyDigestList + cbPCRBinding + cbPCRDigest + cbEncryptedSecret + cbTpm12HostageBlob + if uint32(len(keyBlobData)) < expectedSize { + return fmt.Errorf("key blob size mismatch: expected %d, got %d", expectedSize, len(keyBlobData)) + } + + // Step 1: Extract and validate key name from attestation + keyNameFromAttest, err := extractKeyNameFromAttestation(keyAttestData) + if err != nil { + return fmt.Errorf("failed to extract key name from attestation: %w", err) + } + + // Step 2: Calculate key name from public key in blob + publicKeyOffset := cbHeader + 2 // Skip size field in TPMT_PUBLIC + if uint32(len(keyBlobData)) < publicKeyOffset+cbPublic-2 { + return errors.New("key blob too small for public key") + } + + keyNameFromBlob, err := calculateKeyNameFromPublic(keyBlobData[publicKeyOffset : publicKeyOffset+cbPublic-2]) + if err != nil { + return fmt.Errorf("failed to calculate key name from public key: %w", err) + } + + // Step 3: Validate key names match + if !bytes.Equal(keyNameFromAttest, keyNameFromBlob) { + return fmt.Errorf("key name mismatch: attestation vs blob") + } + + debugLog("validateKeyBlobAndPolicies", "Key name validation passed") + + // Step 4: Validate policy digests + if err := validatePolicyDigests(keyBlobData, cbHeader, cbPublic, cbPrivate, cbMigrationPublic, + cbMigrationPrivate, cbPolicyDigestList, pcrValues); err != nil { + return fmt.Errorf("policy digest validation failed: %w", err) + } + + debugLog("validateKeyBlobAndPolicies", "Key blob and policy validation passed") + return nil +} + +// Extract key name from TPM attestation data +func extractKeyNameFromAttestation(keyAttestData []byte) ([]byte, error) { + cursor := 0 + + // Skip magic (4 bytes) and type (2 bytes) + cursor += 6 + + // Skip qualifiedSigner + qualifiedSignerSize, newCursor, err := readTPM2BSize(keyAttestData, cursor) + if err != nil { + return nil, err + } + cursor = newCursor + int(qualifiedSignerSize) + + // Skip extraData + extraDataSize, newCursor, err := readTPM2BSize(keyAttestData, cursor) + if err != nil { + return nil, err + } + cursor = newCursor + int(extraDataSize) + + // Skip TPMS_CLOCK_INFO (17 bytes) and firmwareVersion (8 bytes) + cursor += 25 + + // Read key name + nameSize, newCursor, err := readTPM2BSize(keyAttestData, cursor) + if err != nil { + return nil, err + } + cursor = newCursor + + if nameSize == 0 { + return nil, errors.New("empty key name in attestation") + } + + if len(keyAttestData) < cursor+int(nameSize) { + return nil, errors.New("attestation too small for key name") + } + + return keyAttestData[cursor : cursor+int(nameSize)], nil +} + +// Calculate key name from public key (simplified implementation) +func calculateKeyNameFromPublic(publicKeyData []byte) ([]byte, error) { + // This is a simplified implementation + // In a full implementation, you would: + // 1. Parse the TPMT_PUBLIC structure + // 2. Calculate name = Hash(nameAlg || publicArea) + // For now, we'll create a placeholder that matches expected format + + if len(publicKeyData) < 10 { + return nil, errors.New("public key data too small") + } + + // Create a SHA-256 hash of the public key data as a simplified name + hash := sha256.Sum256(publicKeyData) + + // TPM name format: nameAlg (2 bytes) + hash + nameAlg := []byte{0x00, 0x0B} // TPM_ALG_SHA256 + keyName := make([]byte, len(nameAlg)+len(hash)) + copy(keyName, nameAlg) + copy(keyName[len(nameAlg):], hash[:]) + + return keyName, nil +} + +// Validate TPM policy digests (comprehensive implementation based on ValidateKeyAttest20) +func validatePolicyDigests(keyBlobData []byte, cbHeader, cbPublic, cbPrivate, cbMigrationPublic, + cbMigrationPrivate, cbPolicyDigestList uint32, pcrValues string) error { + + // Parse key attributes to determine if key is PCR-bound + cursor := int(cbHeader + 2 + 2 + 2) // Skip size, keytype, nameAlg + if len(keyBlobData) < cursor+4 { + return errors.New("key blob too small for key attributes") + } + keyAttributes := binary.BigEndian.Uint32(keyBlobData[cursor : cursor+4]) + + // Navigate to policy digest list + cursor = int(cbHeader + cbPublic + cbPrivate + cbMigrationPublic + cbMigrationPrivate) + + if len(keyBlobData) < cursor+4 { + return errors.New("key blob too small for policy digest count") + } + + policyDigestCount := binary.BigEndian.Uint32(keyBlobData[cursor : cursor+4]) + cursor += 4 + + debugLog("validatePolicyDigests", "Policy digest count: %d", policyDigestCount) + + // Only non-exportable keys may be attested - must have exactly 4 or 6 policy digests + if policyDigestCount != 4 && policyDigestCount != 6 { + return fmt.Errorf("invalid policy digest count: %d, expected 4 or 6", policyDigestCount) + } + + // Calculate user policy digest reference + var userPolicyDigestReference []byte + + if pcrValues != "" && (keyAttributes&0x00000040) == 0 { // Key is PCR-bound and we have PCR data + // Parse PCR data + pcrBytes, err := base64.StdEncoding.DecodeString(pcrValues) + if err != nil { + return fmt.Errorf("invalid PCR values format: %w", err) + } + + // Get PCR information from key blob + pcrCursor := int(cbHeader + cbPublic + cbPrivate + cbMigrationPublic + cbMigrationPrivate + cbPolicyDigestList) + + if len(keyBlobData) < pcrCursor+3 { + return errors.New("key blob too small for PCR mask") + } + + // Read PCR mask (3 bytes, little-endian) + keyBlobPcrMask := uint32(keyBlobData[pcrCursor]) | + (uint32(keyBlobData[pcrCursor+1]) << 8) | + (uint32(keyBlobData[pcrCursor+2]) << 16) + pcrCursor += 3 + + // Get PCR digest from key blob + pcrDigestSize := 32 // SHA256_DIGEST_SIZE for policy calculation + if len(keyBlobData) < pcrCursor+pcrDigestSize { + return errors.New("key blob too small for PCR digest") + } + keyBlobPcrDigest := keyBlobData[pcrCursor : pcrCursor+pcrDigestSize] + + // Determine PCR algorithm from PCR data size + var pcrAlgId uint16 = TPM_ALG_SHA1 + digestSize := len(pcrBytes) / AVAILABLE_PLATFORM_PCRS + if digestSize == 32 { + pcrAlgId = TPM_ALG_SHA256 + } + + // Calculate user policy with PCRs + userPolicyDigestReference, err = calculateUserPolicyWithPCRs(pcrBytes, keyBlobPcrMask, pcrAlgId, keyBlobPcrDigest) + if err != nil { + return fmt.Errorf("failed to calculate user policy with PCRs: %w", err) + } + } else if (keyAttributes & 0x00000040) != 0 { // userWithAuth - not PCR bound + // Use default user policy + userPolicyDigestReference = make([]byte, len(defaultUserPolicy)) + copy(userPolicyDigestReference, defaultUserPolicy) + } else { + // Key is PCR-bound but caller didn't provide PCR data for validation + // Accept the user policy digest stored in the key blob + policyCursor := int(cbHeader + cbPublic + cbPrivate + cbMigrationPublic + cbMigrationPrivate + 4) + _, userPolicyDigest, err := readBigEndian2B(keyBlobData, &policyCursor) + if err != nil { + return fmt.Errorf("failed to read user policy digest: %w", err) + } + userPolicyDigestReference = userPolicyDigest + } + + // Read and validate each policy digest + policyCursor := int(cbHeader + cbPublic + cbPrivate + cbMigrationPublic + cbMigrationPrivate + 4) + + // Expected policy digests in order + expectedPolicies := [][]byte{ + userPolicyDigestReference, + adminObjectChangeAuthPolicy, + adminCertifyPolicy, + adminActivateCredentialPolicy, + } + + if policyDigestCount == 6 { + expectedPolicies = append(expectedPolicies, + []byte{}, // Empty policy for Duplicate (zero-length) + adminCertifyPolicyNoPin) + } + + // Validate each policy digest + for i := 0; i < int(policyDigestCount); i++ { + digestSize, digest, err := readBigEndian2B(keyBlobData, &policyCursor) + if err != nil { + return fmt.Errorf("failed to read policy digest %d: %w", i, err) + } + + // Special case for empty digest (Windows 10 duplicate policy) + if i == 4 && policyDigestCount == 6 && digestSize == 0 { + debugLog("validatePolicyDigests", "Policy %d: empty digest (duplicate policy)", i) + continue + } + + // Validate digest size and content + if digestSize != 32 && digestSize != 0 { + return fmt.Errorf("invalid policy digest size for policy %d: %d", i, digestSize) + } + + if !bytes.Equal(digest, expectedPolicies[i]) { + return fmt.Errorf("policy digest %d mismatch", i) + } + + debugLog("validatePolicyDigests", "Policy %d: validated successfully", i) + } + + // Calculate and verify the overall policy digest (PolicyOR of all individual policies) + policyOrDigestBuffer := make([]byte, 0, 32+4+5*32) + + // Start with zeros for the old policy hash + policyOrDigestBuffer = append(policyOrDigestBuffer, make([]byte, 32)...) + + // Add TPM_CC_PolicyOR + tpmCcBytes := make([]byte, 4) + binary.BigEndian.PutUint32(tpmCcBytes, TPM_CC_PolicyOR) + policyOrDigestBuffer = append(policyOrDigestBuffer, tpmCcBytes...) + + // Add all policy digests + policyOrDigestBuffer = append(policyOrDigestBuffer, userPolicyDigestReference...) + policyOrDigestBuffer = append(policyOrDigestBuffer, adminObjectChangeAuthPolicy...) + policyOrDigestBuffer = append(policyOrDigestBuffer, adminCertifyPolicy...) + policyOrDigestBuffer = append(policyOrDigestBuffer, adminActivateCredentialPolicy...) + + if policyDigestCount > 4 { + policyOrDigestBuffer = append(policyOrDigestBuffer, adminCertifyPolicyNoPin...) + } + + // Calculate final policy digest + h := sha256.New() + h.Write(policyOrDigestBuffer) + finalPolicyDigest := h.Sum(nil) + + // Verify against the auth policy in the public key + authPolicyCursor := int(cbHeader + 2 + 2 + 2 + 4) // Skip to authPolicy + _, authPolicy, err := readBigEndian2B(keyBlobData, &authPolicyCursor) + if err != nil { + return fmt.Errorf("failed to read auth policy: %w", err) + } + + if !bytes.Equal(authPolicy, finalPolicyDigest) { + return errors.New("final policy digest verification failed") + } + + debugLog("validatePolicyDigests", "All policy digest validation passed") + return nil +} + +// Parse and validate AIK public key (RSA or ECDSA) +func parseAndValidateAIKPublicKey(aikPubBytes []byte) (interface{}, error) { + // Try to parse as PKIX format first + pubKey, err := x509.ParsePKIXPublicKey(aikPubBytes) + if err != nil { + return nil, fmt.Errorf("failed to parse PKIX public key: %w", err) + } + + // Validate key type and size + switch key := pubKey.(type) { + case *rsa.PublicKey: + if key.N.BitLen() < 1024 { + return nil, fmt.Errorf("RSA key too small: %d bits", key.N.BitLen()) + } + return key, nil + case *ecdsa.PublicKey: + if key.Curve != elliptic.P256() { + return nil, fmt.Errorf("unsupported ECDSA curve") + } + return key, nil + default: + return nil, fmt.Errorf("unsupported AIK key type: %T", key) + } +} + +// Verify attestation signature using AIK public key +func verifyAttestationSignature(aikPubKey interface{}, keyAttestData []byte, signatureData []byte) error { + // Calculate SHA-1 hash of the key attestation data (as per TPM spec) + hash := sha1.Sum(keyAttestData) + + switch key := aikPubKey.(type) { + case *rsa.PublicKey: + // Use PKCS#1 v1.5 padding for RSA signature verification + return rsa.VerifyPKCS1v15(key, crypto.SHA1, hash[:], signatureData) + + case *ecdsa.PublicKey: + // For ECDSA, try ASN.1 format first + if ecdsa.VerifyASN1(key, hash[:], signatureData) { + return nil + } + // Try raw r||s format if ASN.1 fails + if len(signatureData) == 64 { + r := new(big.Int).SetBytes(signatureData[:32]) + s := new(big.Int).SetBytes(signatureData[32:]) + if ecdsa.Verify(key, hash[:], r, s) { + return nil + } + } + return errors.New("ECDSA signature verification failed") + + default: + return fmt.Errorf("unsupported key type for signature verification: %T", key) + } +} + +// Validate TPM attestation structure and nonce (enhanced based on ValidateKeyAttest20) +func validateTPMAttestStructure(keyAttestData []byte, nonce string, platform uint32) error { + if len(keyAttestData) < 8 { + return errors.New("key attest data too small") + } + + // For TPM 2.0, perform comprehensive validation + if platform == 0x00000002 { // TPM 2.0 + return validateTPM20AttestStructure(keyAttestData, nonce) + } else if platform == 0x00000001 { // TPM 1.2 + return validateTPM12AttestStructure(keyAttestData, nonce) + } + + return fmt.Errorf("unsupported platform type: %d", platform) +} + +// Validate TPM 2.0 attestation structure (based on ValidateKeyAttest20) +func validateTPM20AttestStructure(keyAttestData []byte, nonce string) error { + debugLog("validateTPM20AttestStructure", "Validating TPM 2.0 attestation structure, size: %d", len(keyAttestData)) + + cursor := 0 + + // Step 1: Read magic number (TPM_GENERATED_VALUE) + if len(keyAttestData) < cursor+4 { + return errors.New("attestation too small for magic number") + } + magic := binary.BigEndian.Uint32(keyAttestData[cursor : cursor+4]) + cursor += 4 + + if magic != 0xff544347 { // TPM_GENERATED_VALUE + return fmt.Errorf("invalid TPM_GENERATED magic: 0x%08X, expected 0xff544347", magic) + } + + // Step 2: Read attestation type + if len(keyAttestData) < cursor+2 { + return errors.New("attestation too small for type field") + } + attestType := binary.BigEndian.Uint16(keyAttestData[cursor : cursor+2]) + cursor += 2 + + if attestType != 0x8017 { // TPM_ST_ATTEST_CERTIFY + return fmt.Errorf("invalid attestation type: 0x%04X, expected 0x8017 (TPM_ST_ATTEST_CERTIFY)", attestType) + } + + // Step 3: Skip qualifiedSigner (TPM2B_NAME) + qualifiedSignerSize, newCursor, err := readTPM2BSize(keyAttestData, cursor) + if err != nil { + return fmt.Errorf("failed to read qualifiedSigner size: %w", err) + } + cursor = newCursor + int(qualifiedSignerSize) + + // Step 4: Read extraData (nonce) - TPM2B_DATA + extraDataSize, newCursor, err := readTPM2BSize(keyAttestData, cursor) + if err != nil { + return fmt.Errorf("failed to read extraData size: %w", err) + } + cursor = newCursor + + var extraData []byte + if extraDataSize > 0 { + if len(keyAttestData) < cursor+int(extraDataSize) { + return errors.New("attestation too small for extraData") + } + extraData = keyAttestData[cursor : cursor+int(extraDataSize)] + } + cursor += int(extraDataSize) + + // Step 5: Skip TPMS_CLOCK_INFO (8 + 1 + 4 + 4 = 17 bytes) + // UINT64 clock, BYTE resetCount, UINT32 restartCount, BYTE safe + if len(keyAttestData) < cursor+17 { + return errors.New("attestation too small for TPMS_CLOCK_INFO") + } + cursor += 17 + + // Step 6: Skip firmwareVersion (8 bytes) + if len(keyAttestData) < cursor+8 { + return errors.New("attestation too small for firmwareVersion") + } + cursor += 8 + + // Step 7: Read name (TPM2B_NAME) - this is the key name + nameSize, newCursor, err := readTPM2BSize(keyAttestData, cursor) + if err != nil { + return fmt.Errorf("failed to read name size: %w", err) + } + cursor = newCursor + + var keyName []byte + if nameSize > 0 { + if len(keyAttestData) < cursor+int(nameSize) { + return errors.New("attestation too small for key name") + } + keyName = keyAttestData[cursor : cursor+int(nameSize)] + } + cursor += int(nameSize) + + // Step 8: Skip qualifiedName (TPM2B_NAME) + qualifiedNameSize, newCursor, err := readTPM2BSize(keyAttestData, cursor) + if err != nil { + return fmt.Errorf("failed to read qualifiedName size: %w", err) + } + cursor = newCursor + int(qualifiedNameSize) + + // Step 9: Ensure that there is no trailing data that has been signed + if cursor != len(keyAttestData) { + return fmt.Errorf("unexpected trailing data in attestation: expected %d bytes, consumed %d", len(keyAttestData), cursor) + } + + // Step 10: Validate nonce if provided (matches C++ logic) + if nonce != "" { + nonceBytes, err := base64.StdEncoding.DecodeString(nonce) + if err != nil { + return fmt.Errorf("invalid nonce format: %w", err) + } + + // Check the nonce if requested - matches C++ condition exactly + if len(nonceBytes) != len(extraData) || !bytes.Equal(extraData, nonceBytes) { + return fmt.Errorf("nonce mismatch: expected %d bytes, got %d bytes in extraData", len(nonceBytes), len(extraData)) + } + + debugLog("validateTPM20AttestStructure", "Nonce validation successful") + } + + // Log key information for debugging + if len(keyName) > 0 { + debugLog("validateTPM20AttestStructure", "Key name: %d bytes, first 16 bytes: %x", len(keyName), keyName[:min(16, len(keyName))]) + } + + debugLog("validateTPM20AttestStructure", "TPM 2.0 attestation structure validation passed") + return nil +} + +// Validate TPM 1.2 attestation structure (simplified) +func validateTPM12AttestStructure(keyAttestData []byte, nonce string) error { + debugLog("validateTPM12AttestStructure", "Validating TPM 1.2 attestation structure, size: %d", len(keyAttestData)) + + // TPM 1.2 has a different structure - this is a simplified validation + // In a full implementation, you would parse the TPM_CERTIFY_INFO structure + + if len(keyAttestData) < 20 { + return errors.New("TPM 1.2 attestation too small") + } + + // Basic validation - just ensure we have reasonable data + debugLog("validateTPM12AttestStructure", "TPM 1.2 attestation structure validation passed (simplified)") + return nil +} + +// Helper function to read TPM2B size field (2 bytes big-endian) +func readTPM2BSize(data []byte, cursor int) (uint16, int, error) { + if len(data) < cursor+2 { + return 0, cursor, errors.New("insufficient data for TPM2B size field") + } + size := binary.BigEndian.Uint16(data[cursor : cursor+2]) + return size, cursor + 2, nil +} + +// Helper function for min operation +func min(a, b int) int { + if a < b { + return a + } + return b +} + +func main() { + http.HandleFunc("/register", registerHandler) + http.HandleFunc("/login", loginHandler) + http.HandleFunc("/authenticated", authenticatedHandler) + + // Experimental + http.HandleFunc("/challenge", challengeHandler) + http.HandleFunc("/attest", attestationHandler) + + debugLog("main", "Server starting on port 28280") + log.Fatal(http.ListenAndServe(":28280", nil)) +} diff --git a/hw-sign-go/main_test.go b/hw-sign-go/main_test.go new file mode 100644 index 0000000..13d23fa --- /dev/null +++ b/hw-sign-go/main_test.go @@ -0,0 +1,470 @@ +package main + +import ( + "crypto/ecdh" + "crypto/ecdsa" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + "crypto/sha256" + "crypto/x509" + "encoding/base64" + "encoding/hex" + "fmt" + "testing" + "time" +) + +// Test data structures +type TestData struct { + Timestamp string + RandHex string + Combined string +} + +// Helper function to generate P-256 key pair (used for both hardware and acceleration keys) +func generateP256KeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey, error) { + privKey, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + return nil, nil, err + } + return privKey, &privKey.PublicKey, nil +} + +// Helper function to generate test data +func generateTestData() *TestData { + timestamp := fmt.Sprintf("%d", time.Now().UnixNano()) + randBytes := make([]byte, 16) + rand.Read(randBytes) + randHex := hex.EncodeToString(randBytes) + + return &TestData{ + Timestamp: timestamp, + RandHex: randHex, + Combined: timestamp + "-" + randHex, + } +} + +// Single comprehensive benchmark test for the complete cryptographic workflow +func BenchmarkCompleteWorkflow(b *testing.B) { + b.Logf("Starting comprehensive cryptographic workflow benchmark") + + for i := 0; i < b.N; i++ { + // Step 1: Prepare keys - create hw key pair (ecdsa-p256) + hwPriv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + b.Fatal("Failed to generate hardware key pair:", err) + } + hwPub := &hwPriv.PublicKey + + // Step 1: Create accel key pair (P-256 for both signing and ECDH) + accelPriv, accelPub, err := generateP256KeyPair() + if err != nil { + b.Fatal("Failed to generate acceleration key pair:", err) + } + + // Step 2: Sign accel pub by hw priv + accelPubBytes := elliptic.Marshal(elliptic.P256(), accelPub.X, accelPub.Y) + r, s, err := ecdsa.Sign(rand.Reader, hwPriv, accelPubBytes[:]) + if err != nil { + b.Fatal("Failed to sign acceleration public key:", err) + } + + // Step 3: Sign data (timestamp-randhex) by accel priv + testData := generateTestData() + dataHash := sha256.Sum256([]byte(testData.Combined)) + dataR, dataS, err := ecdsa.Sign(rand.Reader, accelPriv, dataHash[:]) + if err != nil { + b.Fatal("Failed to sign test data:", err) + } + + // Step 4: Server verify accel pub by hw pub + if !ecdsa.Verify(hwPub, accelPubBytes[:], r, s) { + b.Fatal("Failed to verify acceleration public key signature") + } + + // Step 5: Server verify data sig by accel pub + if !ecdsa.Verify(accelPub, dataHash[:], dataR, dataS) { + b.Fatal("Failed to verify data signature") + } + + // Step 6: Create server ecdh-p256 key pair and do key exchange with accel pub + // Convert to ECDH format + accelPubECDHBytes := elliptic.Marshal(elliptic.P256(), accelPub.X, accelPub.Y) + curve := ecdh.P256() + clientECDHPub, err := curve.NewPublicKey(accelPubECDHBytes) + if err != nil { + b.Fatal("Failed to create client ECDH public key:", err) + } + + // Generate server ECDH key pair + serverECDHPriv, err := curve.GenerateKey(rand.Reader) + if err != nil { + b.Fatal("Failed to generate server ECDH key pair:", err) + } + + // Perform key exchange + sharedSecret, err := serverECDHPriv.ECDH(clientECDHPub) + if err != nil { + b.Fatal("Failed to perform ECDH key exchange:", err) + } + + // Verify we got a valid shared secret + if len(sharedSecret) == 0 { + b.Fatal("Empty shared secret from ECDH") + } + + // Log progress every 100 iterations for longer benchmarks + if (i+1)%100 == 0 { + b.Logf("Completed %d iterations successfully", i+1) + } + } +} + +// Single comprehensive test for the complete cryptographic workflow +func TestCompleteWorkflow(t *testing.T) { + t.Logf("Starting comprehensive cryptographic workflow test") + + // Step 1: Prepare keys - create hw key pair (ecdsa-p256) + t.Log("Step 1: Generating hardware key pair (ECDSA P-256)") + hwPriv, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatal("Failed to generate hardware key pair:", err) + } + hwPub := &hwPriv.PublicKey + t.Logf("Hardware P-256 public key: %s", base64.StdEncoding.EncodeToString(elliptic.Marshal(elliptic.P256(), hwPub.X, hwPub.Y))) + + // Step 1: Create accel key pair (P-256 for both signing and ECDH) + t.Log("Step 1: Generating acceleration key pair (P-256)") + accelPriv, accelPub, err := generateP256KeyPair() + if err != nil { + t.Fatal("Failed to generate acceleration key pair:", err) + } + t.Logf("Acceleration P-256 public key: %s", base64.StdEncoding.EncodeToString(elliptic.Marshal(elliptic.P256(), accelPub.X, accelPub.Y))) + + // Step 2: Sign accel pub by hw priv + t.Log("Step 2: Signing acceleration public key with hardware private key") + accelPubBytes := elliptic.Marshal(elliptic.P256(), accelPub.X, accelPub.Y) + accelPubHash := sha256.Sum256(accelPubBytes) + r, s, err := ecdsa.Sign(rand.Reader, hwPriv, accelPubHash[:]) + if err != nil { + t.Fatal("Failed to sign acceleration public key:", err) + } + t.Logf("Acceleration public key signature: r=%s", r.String()) + + // Step 3: Sign data (timestamp-randhex) by accel priv + t.Log("Step 3: Generating test data and signing with acceleration private key") + testData := generateTestData() + t.Logf("Test data: %s", testData.Combined) + dataHash := sha256.Sum256([]byte(testData.Combined)) + dataR, dataS, err := ecdsa.Sign(rand.Reader, accelPriv, dataHash[:]) + if err != nil { + t.Fatal("Failed to sign test data:", err) + } + t.Logf("Data signature created successfully") + + // Step 4: Server verify accel pub by hw pub + t.Log("Step 4: Server verifying acceleration public key signature") + if !ecdsa.Verify(hwPub, accelPubHash[:], r, s) { + t.Fatal("Failed to verify acceleration public key signature") + } + t.Log("✓ Acceleration public key signature verified successfully") + + // Step 5: Server verify data sig by accel pub + t.Log("Step 5: Server verifying data signature") + if !ecdsa.Verify(accelPub, dataHash[:], dataR, dataS) { + t.Fatal("Failed to verify data signature") + } + t.Log("✓ Data signature verified successfully") + + // Step 6: Create server ecdh-p256 key pair and do key exchange with accel pub + t.Log("Step 6: Performing ECDH key exchange") + + // Convert to ECDH format + accelPubECDHBytes := elliptic.Marshal(elliptic.P256(), accelPub.X, accelPub.Y) + curve := ecdh.P256() + clientECDHPub, err := curve.NewPublicKey(accelPubECDHBytes) + if err != nil { + t.Fatal("Failed to create client ECDH public key:", err) + } + + // Generate server ECDH key pair + serverECDHPriv, err := curve.GenerateKey(rand.Reader) + if err != nil { + t.Fatal("Failed to generate server ECDH key pair:", err) + } + + serverECDHPub, _ := x509.MarshalPKIXPublicKey(serverECDHPriv.PublicKey()) + t.Logf("Server ECDH public key: %s", base64.StdEncoding.EncodeToString(serverECDHPub)) + + // Perform key exchange + sharedSecret, err := serverECDHPriv.ECDH(clientECDHPub) + if err != nil { + t.Fatal("Failed to perform ECDH key exchange:", err) + } + + // Verify we got a valid shared secret + if len(sharedSecret) == 0 { + t.Fatal("Empty shared secret from ECDH") + } + t.Logf("✓ ECDH key exchange successful! Shared secret length: %d bytes", len(sharedSecret)) + t.Logf("Shared secret: %s", base64.StdEncoding.EncodeToString(sharedSecret)) + + t.Log("🎉 Complete cryptographic workflow test passed successfully!") +} + +// Performance comparison test +func TestPerformanceComparison(t *testing.T) { + const iterations = 100 + + t.Run("P256Operations", func(t *testing.T) { + // Time key generation + start := time.Now() + for i := 0; i < iterations; i++ { + _, err := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + if err != nil { + t.Fatal(err) + } + } + keyGenDuration := time.Since(start) + + // Time signing operations + hwPriv, _ := ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + testData := []byte("performance test data") + hash := sha256.Sum256(testData) + + start = time.Now() + for i := 0; i < iterations; i++ { + _, _, err := ecdsa.Sign(rand.Reader, hwPriv, hash[:]) + if err != nil { + t.Fatal(err) + } + } + signDuration := time.Since(start) + + // Time verification operations + r, s, _ := ecdsa.Sign(rand.Reader, hwPriv, hash[:]) + start = time.Now() + for i := 0; i < iterations; i++ { + if !ecdsa.Verify(&hwPriv.PublicKey, hash[:], r, s) { + t.Fatal("verification failed") + } + } + verifyDuration := time.Since(start) + + // Time ECDH operations + curve := ecdh.P256() + start = time.Now() + for i := 0; i < iterations; i++ { + priv1, _ := curve.GenerateKey(rand.Reader) + priv2, _ := curve.GenerateKey(rand.Reader) + _, err := priv1.ECDH(priv2.PublicKey()) + if err != nil { + t.Fatal(err) + } + } + ecdhDuration := time.Since(start) + + // Report results + t.Logf("P-256 Performance Results (%d iterations):", iterations) + t.Logf("Key generation: %v (avg: %v)", keyGenDuration, keyGenDuration/iterations) + t.Logf("Signing: %v (avg: %v)", signDuration, signDuration/iterations) + t.Logf("Verification: %v (avg: %v)", verifyDuration, verifyDuration/iterations) + t.Logf("ECDH: %v (avg: %v)", ecdhDuration, ecdhDuration/iterations) + }) +} + +// Test ECDSA P-256 signature verification with provided test data +func TestECDSAP256SignatureVerification(t *testing.T) { + t.Log("Testing ECDSA P-256 signature verification with provided test data") + + // Test data sets + testCases := []struct { + name string + publicKeyB64 string + plaintextB64 string + signatures []string + }{ + { + name: "Windows", + publicKeyB64: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEs7QlaLpB0jw6DQvyLyDtOqzvrrjHvrKqAnys6qgGyqozpku3tS/gwvcKNBDifyr05UYHYAcLzyLNJ57XYkPPiw==", + plaintextB64: "1234567890==", + signatures: []string{ + "YLvs+xya4PZU2/jz8saWk/tPlja4B9mkz6iDAHf1OfsMZDhtThpP5JMCtJociPp/sZGHq/4+LF5ndR4DYeCD6A==", + "Mvm0l6My9Cz8wXea8XFuRTNqYpDQuu+1qNzJyyoOI/WFwYsm/782HyHC4OOanZYtCtK2yUuFEUhvrHC8UA37rA==", + "1BYuwr05K8BC9YYScWwUSrQac71cmnj8so8Auukt2XiNm6o5R/ZauVdlzdCovLu9Y1EFYtfM4Ij0wSatXqMOcA==", + "YFfguSt6i6zUZwiRGKfJeFoDeDa6ZZ2Iknx0NUBNjyX054MJFr/IolsyDUefv+206y8VRk+3vPFcdJBre3K76Q==", + }, + }, + { + name: "macOS", + publicKeyB64: "BJQ+7eXZcgPnI5P73nGlsgn3RCY1yLEhdA3KJNnrUbniC0LaSlUtMpaBhzeQjgRYZYi4wPSVfLJZ9T8Ao5CRai8=", + plaintextB64: "1234567890==", + signatures: []string{ + "MEUCIQDfWzCdfE50ZM/HsfO55PHIgqR5C+jg1WiwK1HVHLlSRQIgDnG2Xxhr4S+SWlHNWHgzaxeMVV02xjiLMlh6qAJFwJ0=", + "MEUCIHQMI9V89fSU9leOGQLr7cCTY56Vuc44OkxpLVWZUmojAiEAtcrJp7E50Id6SdEqFVtstjUp+rpZSpu3Vzhgwff94+E=", + "MEUCIFzPM6VC8fzEEX5wcq8D+LOQirjg1lDq7qqbo+i0P+dMAiEA4Spe3bGJdyTUGumjhc/Qosh9TDQnRkWQ9c0S2GwEFbA=", + }, + }, + { + name: "Test3", + publicKeyB64: "BGD4KpyqndHf5CTpAlZXTubZXaaoqac4LJ0QNUlS8rWjOwh8frmZTsAD1C6ps5iB5aZt5lc/X8LGgMu0334plGg=", + plaintextB64: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEigUJp7M4QumQ7r+xgsQqgNCsxFVaOz30EslGdi+lmN0DcX7RKAHCldU96JRj4A/AKxYOeN/Fb7VdVb7Wy1w3dg==", + signatures: []string{ + "MEYCIQDA5DNoHDj5vX6pvtxRcu8HJnB4sDE7tMvOkKz+F8roGAIhAPzSWhOtE4sT3nCF7rcH0SQXmGWwHbCgplOOnnQh+EmP", + }, + }, + } + + for _, testCase := range testCases { + t.Logf("Testing %s", testCase.name) + + // Parse the public key + t.Logf("Step 1: Parsing ECDSA P-256 public key for %s", testCase.name) + + // Handle different key formats + var publicKey interface{} + var err error + + // Try parsing as standard PKIX first + publicKey, err = parsePublicKey(testCase.publicKeyB64, "ecdsa-p256") + if err != nil { + // If PKIX parsing fails, try raw point format (second test case) + t.Errorf("PKIX parsing failed, trying raw point format: %v", err) + return + } + + ecdsaKey, ok := publicKey.(*ecdsa.PublicKey) + if !ok { + t.Fatal("Parsed key is not ECDSA") + } + + // Verify the curve + if ecdsaKey.Curve != elliptic.P256() { + t.Fatal("Key is not P-256 curve") + } + t.Logf("✓ Successfully parsed ECDSA P-256 public key for %s", testCase.name) + + // Test signature verification + t.Logf("Step 2: Testing signature verification for %s", testCase.name) + successCount := 0 + + for i, sigB64 := range testCase.signatures { + t.Logf("Testing signature %d: %s", i+1, sigB64) + + // Test using the main verifySignature function + sigBytes, err := base64.StdEncoding.DecodeString(sigB64) + if err != nil { + t.Errorf("Signature %d: Failed to decode signature: %v", i+1, err) + continue + } + + // Test using the main verifySignature function + plainBytes, err := base64.StdEncoding.DecodeString(testCase.plaintextB64) + if err != nil { + t.Errorf("Signature %d: Failed to decode plaintextB64: %v", i+1, err) + continue + } + + // Verify using the main verifySignature function + isValid := verifySignature(ecdsaKey, plainBytes, sigBytes) + if isValid { + t.Logf("✓ Signature %d verified successfully using verifySignature()", i+1) + successCount++ + } else { + t.Logf("✗ Signature %d failed verification using verifySignature()", i+1) + } + } + + t.Logf("Verification complete for %s: %d/%d signatures verified successfully", testCase.name, successCount, len(testCase.signatures)) + + if successCount == 0 { + t.Errorf("No signatures were successfully verified for %s - this may indicate a format issue", testCase.name) + } + t.Log("---") + } +} + +// Test RSA-2048 PSS signature verification with provided test data +func TestRSA2048PSSSignatureVerification(t *testing.T) { + t.Log("Testing RSA-2048 PSS signature verification with provided test data") + + // Test data sets + testCases := []struct { + name string + publicKeyB64 string + plaintextB64 string + signatures []string + }{ + { + name: "Windows", + publicKeyB64: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3n0ussUHvZhH1nBZiWEka3OL6OFo7P+jXn+oaOkG+mloxG7JMmnp943z/z5rWvUNN6kZz2ZZeQ+k+ezBZKKvvI+n4ZP5IkgJ/I1nPJzRLKb79OgZATm4Bo/hhQIDdmcsHid7Ajmh+9PoqUwOcX/pZ6FFdSvw/cQc2SB38b5ghpCx3dpUrAfZUV1U3eC1uUr7KiyRm8Dj1hPg4ri9jJhqB4ktr0FjLF43kUlBmZzoNsKq9WcxukF/aLAAgYBBC/d0/FIBRemAgLWJWNm5j45aE0dmKFLfoz2hH4TG4mXKNljbc6O0dQUnM+xMkmhC5FrAXOo3YtZw8ooaVeALPjBCWwIDAQAB", + plaintextB64: "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEiH3HbpFLTj27XqObpHeJKXW6j3TTwhX2o2LAheAmtBQU/Qgn/4DTeMlRh0tweqFno1QLhQ2Nu4QlpqmsiegscQ==", + signatures: []string{ + "eKpBcP5DFWEMONxKk8iAyb5pabBppZVgBBT2Ftm9OmtQkh+bCPLGJM6ILVi6Tg3VafbBFPjwNERXSwfXbUsiP6ca8ijXKp7aWYdBu4gtRVbzoj6gr47jo3A38cMbfcm7AEpQfboovT6f0wUPXfnN2vEocprJM8vZ/BC3fmjNL8R5m3+QRY+y9b3Mu8zCr/rTLw8aflz7b7r2Nb+a2kkFLgdk1tgJTz+/gUTU/N+txVDyjFcdhWLY18p96D0PDVCgvYXIFstbF+VVZVSTAOSlg1QCP/JCEgMWrt1/cLimLr8hFXv0kAL2x4/V7C6KkZk7Z7BFxQbP76lpXtp5rTJnZw==", + }, + }, + } + + for _, testCase := range testCases { + t.Logf("Testing %s", testCase.name) + + // Parse the public key + t.Logf("Step 1: Parsing RSA-2048 PSS public key for %s", testCase.name) + + // Handle different key formats + var publicKey interface{} + var err error + + // Try parsing as standard PKIX first + publicKey, err = parsePublicKey(testCase.publicKeyB64, "rsa-2048-pss") + if err != nil { + // If PKIX parsing fails, try raw point format (second test case) + t.Errorf("PKIX parsing failed, trying raw point format: %v", err) + return + } + + rsaKey, ok := publicKey.(*rsa.PublicKey) + if !ok { + t.Fatal("Parsed key is not RSA") + } + + // Test signature verification + t.Logf("Step 2: Testing signature verification for %s", testCase.name) + successCount := 0 + + for i, sigB64 := range testCase.signatures { + t.Logf("Testing signature %d: %s", i+1, sigB64) + + // Test using the main verifySignature function + sigBytes, err := base64.StdEncoding.DecodeString(sigB64) + if err != nil { + t.Errorf("Signature %d: Failed to decode signature: %v", i+1, err) + continue + } + + // Test using the main verifySignature function + plainBytes, err := base64.StdEncoding.DecodeString(testCase.plaintextB64) + if err != nil { + t.Errorf("Signature %d: Failed to decode plaintextB64: %v", i+1, err) + continue + } + + // Verify using the main verifySignature function + isValid := verifySignature(rsaKey, plainBytes, sigBytes) + if isValid { + t.Logf("✓ Signature %d verified successfully using verifySignature()", i+1) + successCount++ + } else { + t.Logf("✗ Signature %d failed verification using verifySignature()", i+1) + } + } + + t.Logf("Verification complete for %s: %d/%d signatures verified successfully", testCase.name, successCount, len(testCase.signatures)) + + if successCount == 0 { + t.Errorf("No signatures were successfully verified for %s - this may indicate a format issue", testCase.name) + } + t.Log("---") + } +} diff --git a/hw-sign-test/hw_sign_mock.py b/hw-sign-test/hw_sign_mock.py new file mode 100644 index 0000000..107eca9 --- /dev/null +++ b/hw-sign-test/hw_sign_mock.py @@ -0,0 +1,543 @@ +#!/usr/bin/env python3 + +import base64 +import json +import os +import time +import hmac +import hashlib +from dataclasses import dataclass, field, asdict +from typing import Dict, List, Optional, Any, Tuple +import secrets +import uuid + +# For cryptographic operations +from cryptography.hazmat.primitives import hashes, serialization +from cryptography.hazmat.primitives.asymmetric import ec, utils +from cryptography.hazmat.primitives.kdf.hkdf import HKDF +from cryptography.hazmat.backends import default_backend + + +@dataclass +class KeyConfig: + """Configuration for key storage.""" + file_path: str = "hw_sign_keys.json" + hardware_key_type: str = "ecdsa-p256" # Options: ecdsa-p256, ed25519, rsa-2048 + accel_key_type: str = "ecdh-p256" # Options: ecdh-p256, ecdsa-p256, rsa-2048 + + +@dataclass +class KeyPair: + """Represents a key pair with additional metadata.""" + id: str + key_type: str + created_at: int + private_key: Optional[str] = None # Base64 encoded private key + public_key: Optional[str] = None # Base64 encoded public key + + +@dataclass +class SharedSecret: + """Represents a shared secret derived from ECDH.""" + id: str + secret: str # Base64 encoded shared secret + client_pub_key: str # Client's public key used in derivation + server_pub_key: str # Server's public key used in derivation + created_at: int + expires_at: Optional[int] = None + + +@dataclass +class KeyStorage: + """Storage for all keys and shared secrets.""" + hardware_keys: List[KeyPair] = field(default_factory=list) + accel_keys: List[KeyPair] = field(default_factory=list) + shared_secrets: List[SharedSecret] = field(default_factory=list) + + +class HwSignMock: + """Mock implementation of hardware-bound signing.""" + + def __init__(self, config: KeyConfig = None): + """Initialize with optional configuration.""" + self.config = config or KeyConfig() + self.storage = self._load_storage() + self.current_hw_key: Optional[KeyPair] = None + self.current_accel_key: Optional[KeyPair] = None + self.current_shared_secret: Optional[SharedSecret] = None + + # Initialize keys if none exist + if not self.storage.hardware_keys: + self._generate_hardware_key() + + # Set current hardware key + self.current_hw_key = self.storage.hardware_keys[-1] + + print(f"Initialized HW Sign Mock with {len(self.storage.hardware_keys)} hardware keys") + + def _load_storage(self) -> KeyStorage: + """Load key storage from file or create new storage.""" + try: + if os.path.exists(self.config.file_path): + with open(self.config.file_path, 'r') as f: + data = json.load(f) + storage = KeyStorage( + hardware_keys=[KeyPair(**k) for k in data.get('hardware_keys', [])], + accel_keys=[KeyPair(**k) for k in data.get('accel_keys', [])], + shared_secrets=[SharedSecret(**s) for s in data.get('shared_secrets', [])] + ) + print(f"Loaded {len(storage.hardware_keys)} hardware keys from {self.config.file_path}") + return storage + except Exception as e: + print(f"Error loading key storage: {e}") + + # Return empty storage if file doesn't exist or has errors + return KeyStorage() + + def _save_storage(self): + """Save key storage to file.""" + # Convert to dictionary + data = { + "hardware_keys": [asdict(k) for k in self.storage.hardware_keys], + "accel_keys": [asdict(k) for k in self.storage.accel_keys], + "shared_secrets": [asdict(s) for s in self.storage.shared_secrets] + } + + # Save to file + with open(self.config.file_path, 'w') as f: + json.dump(data, f, indent=2) + + print(f"Saved key storage to {self.config.file_path}") + + def _generate_hardware_key(self) -> KeyPair: + """Generate a new hardware key pair.""" + key_id = str(uuid.uuid4()) + created_at = int(time.time()) + + # Generate EC key pair + if self.config.hardware_key_type == "ecdsa-p256": + private_key = ec.generate_private_key( + ec.SECP256R1(), # P-256 curve + default_backend() + ) + + # Serialize keys + private_bytes = private_key.private_bytes( + encoding=serialization.Encoding.DER, + format=serialization.PrivateFormat.PKCS8, + encryption_algorithm=serialization.NoEncryption() + ) + + public_bytes = private_key.public_key().public_bytes( + encoding=serialization.Encoding.DER, + format=serialization.PublicFormat.SubjectPublicKeyInfo + ) + else: + raise ValueError(f"Unsupported hardware key type: {self.config.hardware_key_type}") + + # Create key pair + key_pair = KeyPair( + id=key_id, + key_type=self.config.hardware_key_type, + created_at=created_at, + private_key=base64.b64encode(private_bytes).decode('utf-8'), + public_key=base64.b64encode(public_bytes).decode('utf-8') + ) + + # Add to storage + self.storage.hardware_keys.append(key_pair) + self._save_storage() + + print(f"Generated new hardware key of type {self.config.hardware_key_type} with ID {key_id}") + return key_pair + + def _generate_accel_key(self) -> KeyPair: + """Generate a new acceleration key pair.""" + key_id = str(uuid.uuid4()) + created_at = int(time.time()) + + # Generate EC key pair for ECDH + if self.config.accel_key_type == "ecdh-p256": + private_key = ec.generate_private_key( + ec.SECP256R1(), # P-256 curve + default_backend() + ) + + # Serialize keys + private_bytes = private_key.private_bytes( + encoding=serialization.Encoding.DER, + format=serialization.PrivateFormat.PKCS8, + encryption_algorithm=serialization.NoEncryption() + ) + + public_bytes = private_key.public_key().public_bytes( + encoding=serialization.Encoding.DER, + format=serialization.PublicFormat.SubjectPublicKeyInfo + ) + else: + raise ValueError(f"Unsupported acceleration key type: {self.config.accel_key_type}") + + # Create key pair + key_pair = KeyPair( + id=key_id, + key_type=self.config.accel_key_type, + created_at=created_at, + private_key=base64.b64encode(private_bytes).decode('utf-8'), + public_key=base64.b64encode(public_bytes).decode('utf-8') + ) + + # Add to storage + self.storage.accel_keys.append(key_pair) + self._save_storage() + + print(f"Generated new acceleration key of type {self.config.accel_key_type} with ID {key_id}") + return key_pair + + def _load_private_key(self, key_pair: KeyPair): + """Load private key from key pair.""" + if not key_pair or not key_pair.private_key: + raise ValueError("Invalid key pair") + + private_bytes = base64.b64decode(key_pair.private_key) + + if key_pair.key_type == "ecdsa-p256" or key_pair.key_type == "ecdh-p256": + return serialization.load_der_private_key( + private_bytes, + password=None, + backend=default_backend() + ) + else: + raise ValueError(f"Unsupported key type: {key_pair.key_type}") + + def _load_public_key(self, base64_key: str, key_type: str = "ecdsa-p256"): + """Load public key from base64 encoded string.""" + public_bytes = base64.b64decode(base64_key) + + if key_type == "ecdsa-p256" or key_type == "ecdh-p256": + return serialization.load_der_public_key( + public_bytes, + backend=default_backend() + ) + else: + raise ValueError(f"Unsupported key type: {key_type}") + + def sign_with_hardware_key(self, data: str) -> str: + """Sign data with hardware key using ECDSA.""" + if not self.current_hw_key: + raise ValueError("No hardware key available") + + private_key = self._load_private_key(self.current_hw_key) + + if self.current_hw_key.key_type == "ecdsa-p256": + # Sign using ECDSA + signature = private_key.sign( + data.encode('utf-8'), + ec.ECDSA(hashes.SHA256()) + ) + return base64.b64encode(signature).decode('utf-8') + else: + raise ValueError(f"Unsupported key type for signing: {self.current_hw_key.key_type}") + + def sign_with_accel_key(self, data: str) -> str: + """ + Sign data with acceleration key. + If a shared secret exists, use HMAC-SHA256, otherwise use ECDSA. + """ + if self.current_shared_secret: + # Use HMAC with shared secret + return self._sign_hmac(data, self.current_shared_secret.secret) + + # No shared secret, generate a new acceleration key if needed + if not self.current_accel_key: + self.current_accel_key = self._generate_accel_key() + + private_key = self._load_private_key(self.current_accel_key) + + if self.current_accel_key.key_type == "ecdh-p256": + # Sign using ECDSA (same operation as P-256 ECDSA) + signature = private_key.sign( + data.encode('utf-8'), + ec.ECDSA(hashes.SHA256()) + ) + return base64.b64encode(signature).decode('utf-8') + else: + raise ValueError(f"Unsupported key type for signing: {self.current_accel_key.key_type}") + + def _sign_hmac(self, data: str, secret_base64: str) -> str: + """Sign data using HMAC-SHA256 with the shared secret.""" + secret_bytes = base64.b64decode(secret_base64) + + # Create HMAC + h = hmac.new(secret_bytes, data.encode('utf-8'), hashlib.sha256) + return base64.b64encode(h.digest()).decode('utf-8') + + def get_hardware_public_key(self) -> Tuple[str, str]: + """Get the current hardware public key and its type.""" + if not self.current_hw_key: + self.current_hw_key = self._generate_hardware_key() + + return self.current_hw_key.public_key, self.current_hw_key.key_type + + def get_accel_public_key(self) -> Tuple[str, str]: + """Get the current acceleration public key and its type.""" + if not self.current_accel_key: + self.current_accel_key = self._generate_accel_key() + + return self.current_accel_key.public_key, self.current_accel_key.key_type + + def get_signed_accel_key(self) -> Tuple[str, str, str]: + """ + Get the acceleration public key, its type, and a signature of the public key + using the hardware key. + """ + if not self.current_accel_key: + self.current_accel_key = self._generate_accel_key() + + # Sign the acceleration public key with the hardware key + signature = self.sign_with_hardware_key(self.current_accel_key.public_key) + + return ( + self.current_accel_key.public_key, + self.current_accel_key.key_type, + signature + ) + + def set_server_public_key(self, server_pub_key: str, key_id: str = None) -> str: + """ + Use the server's public key to establish a shared secret via ECDH. + Returns the ID of the established shared secret. + """ + if not self.current_accel_key: + self.current_accel_key = self._generate_accel_key() + + # Load the client's private key + client_private_key = self._load_private_key(self.current_accel_key) + + # Load the server's public key + try: + server_public_key = self._load_public_key(server_pub_key, "ecdh-p256") + + # Perform key exchange + shared_key = client_private_key.exchange(ec.ECDH(), server_public_key) + + # Derive final shared secret using HKDF + shared_secret = HKDF( + algorithm=hashes.SHA256(), + length=32, + salt=None, + info=b'hw-sign-ecdh', + backend=default_backend() + ).derive(shared_key) + + # Create shared secret entry + secret_id = key_id or str(uuid.uuid4()) + shared_secret_entry = SharedSecret( + id=secret_id, + secret=base64.b64encode(shared_secret).decode('utf-8'), + client_pub_key=self.current_accel_key.public_key, + server_pub_key=server_pub_key, + created_at=int(time.time()), + expires_at=int(time.time()) + 3600 # 1 hour expiry + ) + + # Add to storage + self.storage.shared_secrets.append(shared_secret_entry) + self._save_storage() + + # Set as current shared secret + self.current_shared_secret = shared_secret_entry + + print(f"ECDH key exchange completed successfully. Secret ID: {secret_id}") + return secret_id + + except Exception as e: + print(f"Error during ECDH key exchange: {e}") + raise + + def generate_request_data(self) -> str: + """Generate request data in the format: Timestamp-RandomHex.""" + timestamp = str(int(time.time())) + random_hex = secrets.token_hex(16) # 32 bytes of hex + return f"{timestamp}-{random_hex}" + + +class TestClient: + """Client for testing the hardware-bound authentication.""" + + def __init__(self, base_url: str = "http://localhost:28280"): + self.base_url = base_url + self.hw_sign = HwSignMock() + self.auth_token = None + self.accel_key_id = None + + print(f"Initialized test client with base URL: {base_url}") + + def test_register(self, username: str, password: str) -> bool: + """Test user registration.""" + print("\n=== Testing Registration (Simulated) ===") + print(f"Username: {username}") + print(f"Password: {password}") + + # Simulate successful registration + print("✓ Registration successful!") + return True + + def test_login(self, username: str, password: str) -> bool: + """Test login with hardware key binding.""" + print("\n=== Testing Login (Simulated) ===") + print(f"Username: {username}") + print(f"Password: {password}") + + # Get hardware public key + hw_pub_key, hw_pub_type = self.hw_sign.get_hardware_public_key() + + print(f"Hardware public key (first 50 chars): {hw_pub_key[:50]}...") + print(f"Hardware key type: {hw_pub_type}") + + # Simulate successful login + self.auth_token = f"mock_token_{secrets.token_hex(8)}" + print(f"✓ Login successful! Token: {self.auth_token[:20]}...") + return True + + def test_authenticated(self) -> bool: + """ + Test authenticated request. + First request registers a new ECDH acceleration key. + Subsequent requests use the established shared secret. + """ + print("\n=== Testing Authenticated Request ===") + + if not self.auth_token: + print("✗ No auth token available!") + return False + + # Generate request timestamp + timestamp = self.hw_sign.generate_request_data() + print(f"Request timestamp: {timestamp}") + + # Build request headers + headers = { + "Authorization": f"Bearer {self.auth_token}", + "x-rpc-sec-bound-token-data": timestamp + } + + if not self.accel_key_id: + # First authenticated request - register ECDH acceleration key + print("Registering new ECDH acceleration key...") + + # Get acceleration key and sign it with hardware key + accel_pub, accel_pub_type, accel_pub_sig = self.hw_sign.get_signed_accel_key() + + # Sign the request data with acceleration key + data_sig = self.hw_sign.sign_with_accel_key(timestamp) + + # Add headers + headers.update({ + "x-rpc-sec-bound-token-accel-pub": accel_pub, + "x-rpc-sec-bound-token-accel-pub-type": accel_pub_type, + "x-rpc-sec-bound-token-accel-pub-sig": accel_pub_sig, + "x-rpc-sec-bound-token-data-sig": data_sig + }) + + print(f"Acceleration public key (first 50 chars): {accel_pub[:50]}...") + print(f"Acceleration key type: {accel_pub_type}") + print(f"Accel pub signature (first 20 chars): {accel_pub_sig[:20]}...") + print(f"Data signature (first 20 chars): {data_sig[:20]}...") + + # Simulate server response + self.accel_key_id = f"accel_{secrets.token_hex(8)}" + server_pub_key = self._simulate_server_response() + + # Establish shared secret + if server_pub_key: + self.hw_sign.set_server_public_key(server_pub_key, self.accel_key_id) + print(f"Received acceleration key ID: {self.accel_key_id}") + print(f"Received server ECDH public key: {server_pub_key[:30]}...") + print("Shared secret established for HMAC authentication") + + else: + # Subsequent requests - use HMAC with shared secret + print(f"Using existing acceleration key ID with HMAC: {self.accel_key_id}") + + # Sign data using HMAC with shared secret + data_sig = self.hw_sign.sign_with_accel_key(timestamp) + + # Add headers + headers.update({ + "x-rpc-sec-bound-token-accel-pub-id": self.accel_key_id, + "x-rpc-sec-bound-token-data-sig": data_sig + }) + + print(f"HMAC signature (first 20 chars): {data_sig[:20]}...") + + # Simulate successful request + print("✓ Authenticated request successful!") + return True + + def _simulate_server_response(self) -> str: + """Simulate server response with a new ECDH public key.""" + # Generate a mock server key + mock_server = HwSignMock() + server_pub_key, _ = mock_server.get_accel_public_key() + return server_pub_key + + def run_full_test(self): + """Run a full test sequence.""" + print("=====================================") + print("Hardware-Bound Authentication Test") + print("ECDSA Hardware Key + ECDH Accel Key") + print("=====================================") + + username = f"testuser_{int(time.time())}" + password = "testpass123" + + # Test 1: Register + register_success = self.test_register(username, password) + + # Test 2: Login with ECDSA hardware key + login_success = False + if register_success: + login_success = self.test_login(username, password) + + # Test 3: Authenticated request (first time - register ECDH accel key) + auth_success1 = False + if login_success: + auth_success1 = self.test_authenticated() + + # Test 4: Authenticated request (second time - use existing ECDH key) + auth_success2 = False + if auth_success1: + print("\n=== Testing Second Authenticated Request ===") + auth_success2 = self.test_authenticated() + + # Test 5: Third authenticated request to verify ECDH key persistence + auth_success3 = False + if auth_success2: + print("\n=== Testing Third Authenticated Request ===") + auth_success3 = self.test_authenticated() + + # Summary + print("\n=====================================") + print("Test Results Summary:") + print("=====================================") + print(f"Registration: {'✓ PASS' if register_success else '✗ FAIL'}") + print(f"Login (ECDSA HW key): {'✓ PASS' if login_success else '✗ FAIL'}") + print(f"Auth (new ECDH key): {'✓ PASS' if auth_success1 else '✗ FAIL'}") + print(f"Auth (existing ECDH): {'✓ PASS' if auth_success2 else '✗ FAIL'}") + print(f"Auth (ECDH persistent): {'✓ PASS' if auth_success3 else '✗ FAIL'}") + + all_passed = register_success and login_success and auth_success1 and auth_success2 and auth_success3 + print(f"\nOverall Result: {'✓ ALL TESTS PASSED' if all_passed else '✗ SOME TESTS FAILED'}") + + if all_passed: + print("\n🎉 Congratulations! All hardware-bound authentication tests passed!") + print("✓ ECDSA hardware key authentication works") + print("✓ ECDH acceleration key exchange works") + print("✓ Key persistence and reuse works") + + print("=====================================") + + +if __name__ == "__main__": + client = TestClient() + client.run_full_test() \ No newline at end of file diff --git a/hw-sign-win/.gitignore b/hw-sign-win/.gitignore new file mode 100644 index 0000000..0bd97b1 --- /dev/null +++ b/hw-sign-win/.gitignore @@ -0,0 +1 @@ +cmake-*/ diff --git a/hw-sign-win/CMakeLists.txt b/hw-sign-win/CMakeLists.txt new file mode 100644 index 0000000..3cdfe03 --- /dev/null +++ b/hw-sign-win/CMakeLists.txt @@ -0,0 +1,43 @@ +cmake_minimum_required(VERSION 3.15) +project(hw_sign_win) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +# Include vcpkg toolchain +set(CMAKE_TOOLCHAIN_FILE "${CMAKE_SOURCE_DIR}/vcpkg/scripts/buildsystems/vcpkg.cmake") + +# Find dependencies +find_package(cpr CONFIG REQUIRED) +find_package(nlohmann_json CONFIG REQUIRED) +find_package(OpenSSL REQUIRED) + +# Use pre-built TpmAtt library from TSS.MSR submodule +add_library(TpmAtt SHARED IMPORTED) + +# Set properties for imported library +set_target_properties(TpmAtt PROPERTIES + IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/TSS.MSR/PCPTool.v11/x64/Debug/TpmAtt.dll" + IMPORTED_IMPLIB "${CMAKE_CURRENT_SOURCE_DIR}/TSS.MSR/PCPTool.v11/x64/Debug/TpmAtt.lib" + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/TSS.MSR/PCPTool.v11/inc" +) + +# Add main executable +add_executable(hw_sign_win main.cpp) + +# Copy the DLL to the output directory +add_custom_command(TARGET hw_sign_win POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_SOURCE_DIR}/TSS.MSR/PCPTool.v11/x64/Debug/TpmAtt.dll" + $ +) + +# Link libraries to main executable +target_link_libraries(hw_sign_win PRIVATE + cpr::cpr + nlohmann_json::nlohmann_json + bcrypt + OpenSSL::SSL + OpenSSL::Crypto + TpmAtt # Link the TpmAtt library +) \ No newline at end of file diff --git a/hw-sign-win/main.cpp b/hw-sign-win/main.cpp new file mode 100644 index 0000000..37eac38 --- /dev/null +++ b/hw-sign-win/main.cpp @@ -0,0 +1,1426 @@ +#define NOMINMAX + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "TpmAtt.h" + +#pragma comment(lib, "ncrypt.lib") +#pragma comment(lib, "bcrypt.lib") +#pragma comment(lib, "crypt32.lib") +#pragma comment(lib, "TpmAtt.lib") + +enum class HardwareKeyType { + ECDSA_P256, + RSA_2048_PSS +}; + +class UnifiedCryptoHelper { +private: + NCRYPT_PROV_HANDLE hProvider_ = NULL; + NCRYPT_KEY_HANDLE hHardwareKey_ = NULL; + NCRYPT_KEY_HANDLE hAIKKey_ = NULL; + EC_KEY *accelEcdhKey_ = nullptr; + std::vector sharedSecret_; + HardwareKeyType hwKeyType_; + std::string keyTypeString_; + std::wstring aikName_; + +public: + UnifiedCryptoHelper(HardwareKeyType keyType = HardwareKeyType::ECDSA_P256) : hwKeyType_(keyType) { + // Initialize OpenSSL + ERR_load_crypto_strings(); + OpenSSL_add_all_algorithms(); + + // Initialize NCrypt for hardware key + SECURITY_STATUS status; + + // Open the default key storage provider + status = NCryptOpenStorageProvider(&hProvider_, MS_PLATFORM_KEY_STORAGE_PROVIDER, 0); + if (FAILED(status)) { + throw std::runtime_error("Failed to open NCrypt storage provider"); + } + + // Generate hardware key based on type + if (hwKeyType_ == HardwareKeyType::RSA_2048_PSS) { + generateRSAHardwareKey(); + keyTypeString_ = "rsa-2048-pss"; + } else { + generateECDSAHardwareKey(); + keyTypeString_ = "ecdsa-p256"; + } + + // Generate ECDH P-256 key using OpenSSL for acceleration + accelEcdhKey_ = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + if (!accelEcdhKey_ || !EC_KEY_generate_key(accelEcdhKey_)) { + throw std::runtime_error("Failed to generate ECDH acceleration key"); + } + + std::cout << "Generated " << keyTypeString_ << + " hardware key (NCrypt) and ECDH P-256 acceleration key (OpenSSL)" << std::endl; + } + + ~UnifiedCryptoHelper() { + if (hAIKKey_) { + NCryptDeleteKey(hAIKKey_, 0); + NCryptFreeObject(hAIKKey_); + } + if (hHardwareKey_) { + NCryptDeleteKey(hHardwareKey_, 0); + NCryptFreeObject(hHardwareKey_); + } + if (hProvider_) { + NCryptFreeObject(hProvider_); + } + if (accelEcdhKey_) { + EC_KEY_free(accelEcdhKey_); + } + } + +private: + std::wstring getHardwareKeyProperty(std::wstring name, std::string type) { + SECURITY_STATUS status; + DWORD cbResult = 0; + status = NCryptGetProperty(hHardwareKey_, name.data(), + NULL, cbResult, &cbResult, 0); + if (FAILED(status)) { + return L"N/A"; + } + + std::vector w; + w.resize(cbResult); + status = NCryptGetProperty(hHardwareKey_, name.data(), + (PBYTE) w.data(), cbResult, &cbResult, 0); + if (FAILED(status)) { + throw std::runtime_error("Failed to get property value"); + } + + if (type == "string") { + return (WCHAR *) w.data(); + } + + if (type == "bool") { + return w[0] == 0 ? L"false" : L"true"; + } + + if (type == "int") { + return std::to_wstring(*(DWORD *) w.data()); + } + + if (type == "binary") { + std::wstring result = L"0x"; + for (BYTE byte: w) { + result += std::format(L"{:02X}", byte); + } + return result; + } + } + + void printHardwareKeyProperties() { + std::pair all_properties[] = { + {NCRYPT_ALGORITHM_PROPERTY, "string"}, + {NCRYPT_LENGTH_PROPERTY, "string"}, + {NCRYPT_BLOCK_LENGTH_PROPERTY, "string"}, + {NCRYPT_ECC_CURVE_NAME_PROPERTY, "string"}, + {NCRYPT_PCP_PLATFORM_TYPE_PROPERTY, "string"}, + {NCRYPT_PCP_KEYATTESTATION_PROPERTY, "string"}, + {NCRYPT_PCP_EKPUB_PROPERTY, "string"}, + {NCRYPT_PCP_EKCERT_PROPERTY, "string"}, + {NCRYPT_PCP_EKNVCERT_PROPERTY, "string"}, + {NCRYPT_PCP_PCRTABLE_PROPERTY, "string"}, + {NCRYPT_PCP_SESSIONID_PROPERTY, "string"}, + {NCRYPT_PCP_EXPORT_ALLOWED_PROPERTY, "bool"}, + {NCRYPT_PCP_TPM_VERSION_PROPERTY, "string"}, + {NCRYPT_PCP_TPM_FW_VERSION_PROPERTY, "string"}, + {NCRYPT_PCP_TPM_MANUFACTURER_ID_PROPERTY, "string"}, + {NCRYPT_PCP_TPM2BNAME_PROPERTY, "binary"}, + {NCRYPT_PCP_PLATFORMHANDLE_PROPERTY, "binary"}, + {NCRYPT_PCP_PROVIDERHANDLE_PROPERTY, "binary"}, + }; + + for (const auto &[name, type]: all_properties) { + std::wstring value = getHardwareKeyProperty(name, type); + std::wcout << L"Property " << name << L": " << value << std::endl; + } + } + + void printAIKProperties() { + std::wcout << L"\n--- AIK Properties ---" << std::endl; + + std::pair aik_properties[] = { + {NCRYPT_ALGORITHM_PROPERTY, "string"}, + {NCRYPT_LENGTH_PROPERTY, "string"}, + {NCRYPT_KEY_USAGE_PROPERTY, "int"}, + {NCRYPT_PCP_PLATFORM_TYPE_PROPERTY, "string"}, + {NCRYPT_PCP_TPM_VERSION_PROPERTY, "string"}, + }; + + for (const auto &[name, type]: aik_properties) { + std::wstring value = getAIKProperty(name, type); + std::wcout << L"AIK " << name << L": " << value << std::endl; + } + std::wcout << L"--- End AIK Properties ---\n" << std::endl; + } + + std::wstring getAIKProperty(std::wstring name, std::string type) { + SECURITY_STATUS status; + DWORD cbResult = 0; + status = NCryptGetProperty(hAIKKey_, name.data(), + NULL, cbResult, &cbResult, 0); + if (FAILED(status)) { + return L"N/A"; + } + + std::vector w; + w.resize(cbResult); + status = NCryptGetProperty(hAIKKey_, name.data(), + (PBYTE) w.data(), cbResult, &cbResult, 0); + if (FAILED(status)) { + return L"Error"; + } + + if (type == "string") { + return (WCHAR *) w.data(); + } + + if (type == "bool") { + return w[0] == 0 ? L"false" : L"true"; + } + + if (type == "int") { + return std::to_wstring(*(DWORD *) w.data()); + } + + if (type == "binary") { + std::wstring result = L"0x"; + for (BYTE byte: w) { + result += std::format(L"{:02X}", byte); + } + return result; + } + + return L"Unknown"; + } + + std::string getRealPCRValues() { + std::cout << "Retrieving PCR values from TPM..." << std::endl; + + HRESULT hr = S_OK; + NCRYPT_PROV_HANDLE hProv = NULL; + BYTE pcrTable[TPM_AVAILABLE_PLATFORM_PCRS * MAX_DIGEST_SIZE] = {0}; + DWORD cbPcrTable = sizeof(pcrTable); + DWORD digestSize = SHA1_DIGEST_SIZE; + + try { + // Open the platform crypto provider + hr = HRESULT_FROM_WIN32(NCryptOpenStorageProvider( + &hProv, + MS_PLATFORM_CRYPTO_PROVIDER, + 0)); + + if (FAILED(hr)) { + throw std::runtime_error("Failed to open platform crypto provider: " + std::to_string(hr)); + } + + // Get PCR table from TPM + hr = HRESULT_FROM_WIN32(NCryptGetProperty(hProv, + NCRYPT_PCP_PCRTABLE_PROPERTY, + pcrTable, + sizeof(pcrTable), + &cbPcrTable, + 0)); + + if (FAILED(hr)) { + throw std::runtime_error("Failed to get PCR table: " + std::to_string(hr)); + } + + // Determine digest size based on returned data + if ((cbPcrTable / TPM_AVAILABLE_PLATFORM_PCRS) == SHA256_DIGEST_SIZE) { + digestSize = SHA256_DIGEST_SIZE; + std::cout << "Using SHA256 PCRs (" << digestSize << " bytes per PCR)" << std::endl; + } else { + std::cout << "Using SHA1 PCRs (" << digestSize << " bytes per PCR)" << std::endl; + } + + std::cout << "Retrieved " << cbPcrTable << " bytes of PCR data for " << TPM_AVAILABLE_PLATFORM_PCRS << + " PCRs" << std::endl; + + // Debug: Print first few PCRs + std::cout << "Sample PCR values:" << std::endl; + for (UINT32 n = 0; n < std::min(4U, (UINT32)TPM_AVAILABLE_PLATFORM_PCRS); n++) { + std::cout << " PCR[" << n << "]: "; + for (UINT32 m = 0; m < std::min(8Ul, digestSize); m++) { + std::cout << std::format("{:02x}", pcrTable[n * digestSize + m]); + } + std::cout << "..." << std::endl; + } + + // Convert to base64 + std::vector pcrData(pcrTable, pcrTable + cbPcrTable); + std::string result = base64Encode(pcrData); + + // Cleanup + if (hProv) { + NCryptFreeObject(hProv); + } + + return result; + } catch (...) { + // Cleanup on error + if (hProv) { + NCryptFreeObject(hProv); + } + throw; + } + } + + void generateECDSAHardwareKey() { + std::wstring hwKeyName = L"HwSignTestECDSA_" + std::to_wstring(std::time(nullptr)); + SECURITY_STATUS status = NCryptCreatePersistedKey( + hProvider_, + &hHardwareKey_, + BCRYPT_ECDSA_P256_ALGORITHM, + hwKeyName.c_str(), + 0, + NCRYPT_OVERWRITE_KEY_FLAG + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to create ECDSA hardware key"); + } + + // Finalize the key + status = NCryptFinalizeKey(hHardwareKey_, 0); + if (FAILED(status)) { + NCryptFreeObject(hHardwareKey_); + throw std::runtime_error("Failed to finalize ECDSA hardware key"); + } + + printHardwareKeyProperties(); + } + + void generateRSAHardwareKey() { + std::wstring hwKeyName = L"HwSignTestRSA_" + std::to_wstring(std::time(nullptr)); + SECURITY_STATUS status = NCryptCreatePersistedKey( + hProvider_, + &hHardwareKey_, + BCRYPT_RSA_ALGORITHM, + hwKeyName.c_str(), + 0, + NCRYPT_OVERWRITE_KEY_FLAG + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to create RSA hardware key"); + } + + // Set key length to 2048 bits + DWORD keyLength = 2048; + status = NCryptSetProperty( + hHardwareKey_, + NCRYPT_LENGTH_PROPERTY, + (PBYTE) &keyLength, + sizeof(keyLength), + 0 + ); + + if (FAILED(status)) { + NCryptFreeObject(hHardwareKey_); + throw std::runtime_error("Failed to set RSA key length"); + } + + // Finalize the key + status = NCryptFinalizeKey(hHardwareKey_, 0); + if (FAILED(status)) { + NCryptFreeObject(hHardwareKey_); + throw std::runtime_error("Failed to finalize RSA hardware key"); + } + } + +public: + struct AttestationData { + std::string attestation; + std::string aikPublicKey; + std::string pcrValues; + std::string keyType; + }; + + std::string base64Encode(const std::vector &data) { + BIO *bio = BIO_new(BIO_s_mem()); + BIO *b64 = BIO_new(BIO_f_base64()); + BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); + bio = BIO_push(b64, bio); + + BIO_write(bio, data.data(), data.size()); + BIO_flush(bio); + + BUF_MEM *bufferPtr; + BIO_get_mem_ptr(bio, &bufferPtr); + + std::string result(bufferPtr->data, bufferPtr->length); + BIO_free_all(bio); + + return result; + } + + std::vector base64Decode(const std::string &input) { + BIO *bio = BIO_new_mem_buf(input.data(), input.length()); + BIO *b64 = BIO_new(BIO_f_base64()); + BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL); + bio = BIO_push(b64, bio); + + std::vector result(input.length()); + int decodedLength = BIO_read(bio, result.data(), input.length()); + BIO_free_all(bio); + + result.resize(decodedLength); + return result; + } + + std::string exportHardwarePublicKey() { + DWORD cbResult = 0; + SECURITY_STATUS status; + + // First, export the key + status = NCryptExportKey( + hHardwareKey_, + NULL, + BCRYPT_PUBLIC_KEY_BLOB, + NULL, + NULL, + 0, + &cbResult, + 0 + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to get public key size"); + } + + std::vector keyBlob(cbResult); + status = NCryptExportKey( + hHardwareKey_, + NULL, + BCRYPT_PUBLIC_KEY_BLOB, + NULL, + keyBlob.data(), + cbResult, + &cbResult, + 0 + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to export public key"); + } + + // Convert to standard format based on key type + if (hwKeyType_ == HardwareKeyType::ECDSA_P256) { + return convertECDSAKeyToPKIX(keyBlob); + } else { + return convertRSAKeyToPKIX(keyBlob); + } + } + +private: + std::string convertECDSAKeyToPKIX(std::vector &keyBlob) { + // BCrypt ECC public key blob structure + BCRYPT_ECCKEY_BLOB *eccBlob = (BCRYPT_ECCKEY_BLOB *) keyBlob.data(); + + // Extract X and Y coordinates + BYTE *x = keyBlob.data() + sizeof(BCRYPT_ECCKEY_BLOB); + BYTE *y = x + eccBlob->cbKey; + + // Create OpenSSL EC_KEY + EC_KEY *ecKey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + if (!ecKey) { + throw std::runtime_error("Failed to create EC_KEY"); + } + + // Create EC_POINT from coordinates + const EC_GROUP *group = EC_KEY_get0_group(ecKey); + EC_POINT *point = EC_POINT_new(group); + BIGNUM *bn_x = BN_bin2bn(x, eccBlob->cbKey, NULL); + BIGNUM *bn_y = BN_bin2bn(y, eccBlob->cbKey, NULL); + + if (!EC_POINT_set_affine_coordinates_GFp(group, point, bn_x, bn_y, NULL)) { + BN_free(bn_x); + BN_free(bn_y); + EC_POINT_free(point); + EC_KEY_free(ecKey); + throw std::runtime_error("Failed to set EC point coordinates"); + } + + EC_KEY_set_public_key(ecKey, point); + + // Convert to EVP_PKEY + EVP_PKEY *pkey = EVP_PKEY_new(); + EVP_PKEY_set1_EC_KEY(pkey, ecKey); + + // Export to PKIX format + BIO *bio = BIO_new(BIO_s_mem()); + i2d_PUBKEY_bio(bio, pkey); + + BUF_MEM *bufferPtr; + BIO_get_mem_ptr(bio, &bufferPtr); + std::vector pkixKey(bufferPtr->data, bufferPtr->data + bufferPtr->length); + + // Cleanup + BN_free(bn_x); + BN_free(bn_y); + EC_POINT_free(point); + EC_KEY_free(ecKey); + EVP_PKEY_free(pkey); + BIO_free(bio); + + return base64Encode(pkixKey); + } + + std::string convertRSAKeyToPKIX(std::vector &keyBlob) { + // BCrypt RSA public key blob structure + BCRYPT_RSAKEY_BLOB *rsaBlob = (BCRYPT_RSAKEY_BLOB *) keyBlob.data(); + + // Extract modulus and exponent + BYTE *exponent = keyBlob.data() + sizeof(BCRYPT_RSAKEY_BLOB); + BYTE *modulus = exponent + rsaBlob->cbPublicExp; + + // Create OpenSSL RSA key + RSA *rsaKey = RSA_new(); + BIGNUM *n = BN_bin2bn(modulus, rsaBlob->cbModulus, NULL); + BIGNUM *e = BN_bin2bn(exponent, rsaBlob->cbPublicExp, NULL); + + if (!RSA_set0_key(rsaKey, n, e, NULL)) { + BN_free(n); + BN_free(e); + RSA_free(rsaKey); + throw std::runtime_error("Failed to set RSA key components"); + } + + // Convert to EVP_PKEY + EVP_PKEY *pkey = EVP_PKEY_new(); + EVP_PKEY_set1_RSA(pkey, rsaKey); + + // Export to PKIX format + BIO *bio = BIO_new(BIO_s_mem()); + i2d_PUBKEY_bio(bio, pkey); + + BUF_MEM *bufferPtr; + BIO_get_mem_ptr(bio, &bufferPtr); + std::vector pkixKey(bufferPtr->data, bufferPtr->data + bufferPtr->length); + + // Cleanup + RSA_free(rsaKey); + EVP_PKEY_free(pkey); + BIO_free(bio); + + return base64Encode(pkixKey); + } + +public: + std::string exportAccelPublicKeyPKIX() { + // Create EVP_PKEY from EC_KEY + EVP_PKEY *pkey = EVP_PKEY_new(); + if (!pkey || !EVP_PKEY_set1_EC_KEY(pkey, accelEcdhKey_)) { + throw std::runtime_error("Failed to create EVP_PKEY for accel key"); + } + + // Export to PKIX format + BIO *bio = BIO_new(BIO_s_mem()); + if (!i2d_PUBKEY_bio(bio, pkey)) { + BIO_free(bio); + EVP_PKEY_free(pkey); + throw std::runtime_error("Failed to export acceleration public key"); + } + + BUF_MEM *bufferPtr; + BIO_get_mem_ptr(bio, &bufferPtr); + + std::vector keyData(bufferPtr->data, bufferPtr->data + bufferPtr->length); + + BIO_free(bio); + EVP_PKEY_free(pkey); + + return base64Encode(keyData); + } + + std::string signDataWithHardwareKey(const std::string &data) { + // Hash the data with SHA-256 using OpenSSL + unsigned char hash[SHA256_DIGEST_LENGTH]; + SHA256(reinterpret_cast(data.c_str()), data.length(), hash); + + DWORD cbSignature = 0; + SECURITY_STATUS status; + + if (hwKeyType_ == HardwareKeyType::RSA_2048_PSS) { + // Sign with RSA-PSS using NCrypt + BCRYPT_PSS_PADDING_INFO paddingInfo = {0}; + paddingInfo.pszAlgId = BCRYPT_SHA256_ALGORITHM; + paddingInfo.cbSalt = 32; + + status = NCryptSignHash( + hHardwareKey_, + &paddingInfo, + hash, + SHA256_DIGEST_LENGTH, + NULL, + 0, + &cbSignature, + BCRYPT_PAD_PSS + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to get RSA signature size"); + } + + std::vector signature(cbSignature); + + status = NCryptSignHash( + hHardwareKey_, + &paddingInfo, + hash, + SHA256_DIGEST_LENGTH, + signature.data(), + cbSignature, + &cbSignature, + BCRYPT_PAD_PSS + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to sign data with RSA hardware key"); + } + + return base64Encode(signature); + } else { + // Sign with ECDSA using NCrypt + status = NCryptSignHash( + hHardwareKey_, + NULL, + hash, + SHA256_DIGEST_LENGTH, + NULL, + 0, + &cbSignature, + 0 + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to get ECDSA signature size"); + } + + std::vector signature(cbSignature); + + status = NCryptSignHash( + hHardwareKey_, + NULL, + hash, + SHA256_DIGEST_LENGTH, + signature.data(), + cbSignature, + &cbSignature, + 0 + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to sign data with ECDSA hardware key"); + } + + return base64Encode(signature); + } + } + + std::string signDataWithAccelKey(const std::string &data) { + if (sharedSecret_.empty()) { + // No shared secret yet, use ECDSA signing with OpenSSL + unsigned char hash[SHA256_DIGEST_LENGTH]; + SHA256(reinterpret_cast(data.c_str()), data.length(), hash); + + unsigned char signature[256]; + unsigned int sigLen; + + if (!ECDSA_sign(0, hash, SHA256_DIGEST_LENGTH, signature, &sigLen, accelEcdhKey_)) { + throw std::runtime_error("Failed to sign data with acceleration key"); + } + + std::vector sigVec(signature, signature + sigLen); + return base64Encode(sigVec); + } else { + // Use HMAC-SHA256 with shared secret + return computeHMAC(data, sharedSecret_); + } + } + + std::string computeHMAC(const std::string &data, const std::vector &key) { + unsigned char result[EVP_MAX_MD_SIZE]; + unsigned int result_len; + + HMAC(EVP_sha256(), key.data(), key.size(), + reinterpret_cast(data.c_str()), data.length(), + result, &result_len); + + std::vector hmacVec(result, result + result_len); + return base64Encode(hmacVec); + } + + void setSharedSecret(const std::string &serverPubKeyBase64) { + try { + std::cout << "Setting up ECDH shared secret..." << std::endl; + + // Decode server's public key from base64 + std::vector serverPubKeyBytes = base64Decode(serverPubKeyBase64); + std::cout << "Decoded server public key, length: " << serverPubKeyBytes.size() << " bytes" << std::endl; + + // Create BIO from server's public key bytes + BIO *bio = BIO_new_mem_buf(serverPubKeyBytes.data(), static_cast(serverPubKeyBytes.size())); + if (!bio) { + throw std::runtime_error("Failed to create BIO from server public key"); + } + + // Try to parse as PKIX format first + EVP_PKEY *serverPubKey = d2i_PUBKEY_bio(bio, nullptr); + BIO_free(bio); + + if (!serverPubKey) { + // If PKIX parsing failed, try raw uncompressed point format + if (serverPubKeyBytes.size() == 65 && serverPubKeyBytes[0] == 0x04) { + std::cout << "Trying raw uncompressed point format..." << std::endl; + serverPubKey = createEVPKeyFromRawPoint(serverPubKeyBytes); + } else { + throw std::runtime_error("Failed to parse server public key in any known format"); + } + } + + if (!serverPubKey) { + throw std::runtime_error("Failed to create server EVP_PKEY"); + } + + // Convert our ECDH key to EVP_PKEY format + EVP_PKEY *clientPrivKey = EVP_PKEY_new(); + if (!clientPrivKey || !EVP_PKEY_set1_EC_KEY(clientPrivKey, accelEcdhKey_)) { + EVP_PKEY_free(serverPubKey); + if (clientPrivKey) EVP_PKEY_free(clientPrivKey); + throw std::runtime_error("Failed to convert client ECDH key to EVP_PKEY"); + } + + // Perform ECDH key derivation + sharedSecret_ = performECDHKeyDerivation(clientPrivKey, serverPubKey); + + // Cleanup + EVP_PKEY_free(serverPubKey); + EVP_PKEY_free(clientPrivKey); + + std::cout << "✓ ECDH shared secret established successfully, length: " << sharedSecret_.size() << " bytes" + << std::endl; + } catch (const std::exception &e) { + sharedSecret_.clear(); + throw std::runtime_error(std::string("ECDH key exchange failed: ") + e.what()); + } + } + + std::string getHardwareKeyType() const { + return keyTypeString_; + } + + std::string getAccelKeyType() const { + return "ecdh-p256"; + } + + AttestationData getHardwareKeyAttestation(const std::string &nonce = "") { + std::cout << "\n=== Generating Hardware Key Attestation using TpmAtt ===" << std::endl; + + AttestationData result; + SECURITY_STATUS status; + HRESULT hr; + + try { + // Step 1: Create an AIK (Attestation Identity Key) + aikName_ = L"HwSignAIK_" + std::to_wstring(std::time(nullptr)); + + status = NCryptCreatePersistedKey( + hProvider_, + &hAIKKey_, + BCRYPT_RSA_ALGORITHM, + aikName_.c_str(), + 0, + NCRYPT_OVERWRITE_KEY_FLAG + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to create AIK: " + std::to_string(status)); + } + + // Mark as AIK for signing and attestation + DWORD keyUsage = NCRYPT_ALLOW_SIGNING_FLAG; + status = NCryptSetProperty( + hAIKKey_, + NCRYPT_KEY_USAGE_PROPERTY, + (PBYTE) &keyUsage, + sizeof(keyUsage), + 0 + ); + + if (FAILED(status)) { + NCryptDeleteKey(hAIKKey_, 0); + throw std::runtime_error("Failed to set AIK usage: " + std::to_string(status)); + } + + DWORD dwKeyUsage = NCRYPT_PCP_IDENTITY_KEY; + if (FAILED(hr = HRESULT_FROM_WIN32(NCryptSetProperty( + hAIKKey_, + NCRYPT_PCP_KEY_USAGE_POLICY_PROPERTY, + (PBYTE)&dwKeyUsage, + sizeof(dwKeyUsage), + 0)))) { + throw std::runtime_error("Failed to set AIK usage: " + std::to_string(status)); + } + + // Finalize the AIK + status = NCryptFinalizeKey(hAIKKey_, 0); + if (FAILED(status)) { + NCryptDeleteKey(hAIKKey_, 0); + throw std::runtime_error("Failed to finalize AIK: " + std::to_string(status)); + } + + std::cout << "✓ Created RSA-2048 AIK: " << std::string(aikName_.begin(), aikName_.end()) << std::endl; + + // Print AIK properties for debugging + try { + printAIKProperties(); + } catch (...) { + std::cout << "Warning: Could not print AIK properties" << std::endl; + } + + // Step 2: Export AIK public key + DWORD cbAIKPub = 0; + status = NCryptExportKey( + hAIKKey_, + NULL, + BCRYPT_PUBLIC_KEY_BLOB, + NULL, + NULL, + 0, + &cbAIKPub, + 0 + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to get AIK public key size"); + } + + std::vector aikPubBlob(cbAIKPub); + status = NCryptExportKey( + hAIKKey_, + NULL, + BCRYPT_PUBLIC_KEY_BLOB, + NULL, + aikPubBlob.data(), + cbAIKPub, + &cbAIKPub, + 0 + ); + + if (FAILED(status)) { + throw std::runtime_error("Failed to export AIK public key"); + } + + // Convert to PKIX format + result.aikPublicKey = convertRSAKeyToPKIX(aikPubBlob); + std::cout << "✓ Exported AIK public key" << std::endl; + + // Step 3: Use TpmAttGenerateKeyAttestation to generate real TPM attestation + std::vector nonceBytes; + PBYTE pbNonce = nullptr; + UINT32 cbNonce = 0; + + if (!nonce.empty()) { + nonceBytes = base64Decode(nonce); + pbNonce = nonceBytes.data(); + cbNonce = static_cast(nonceBytes.size()); + std::cout << "Using nonce of size: " << cbNonce << " bytes" << std::endl; + } + + // Verify both keys are on the same provider + std::cout << "Verifying keys are on the same provider..." << std::endl; + std::cout << "Hardware key handle: " << std::hex << hHardwareKey_ << std::dec << std::endl; + std::cout << "AIK handle: " << std::hex << hAIKKey_ << std::dec << std::endl; + std::cout << "Provider handle: " << std::hex << hProvider_ << std::dec << std::endl; + + // First call to get required buffer size + UINT32 cbAttestation = 0; + std::cout << "Calling TpmAttGenerateKeyAttestation to get buffer size..." << std::endl; + + hr = TpmAttGenerateKeyAttestation( + hAIKKey_, // AIK handle + hHardwareKey_, // Hardware key to attest + pbNonce, // Optional nonce + cbNonce, // Nonce size + nullptr, // Output buffer (null to get size) + 0, // Buffer size + &cbAttestation // Required size + ); + + std::cout << "TpmAttGenerateKeyAttestation result: 0x" << std::hex << hr << std::dec << std::endl; + + if (hr != HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER) && FAILED(hr)) { + std::string errorMsg = "Failed to get attestation buffer size: 0x" + + std::to_string(hr) + " (" + std::to_string(hr) + ")"; + + // Check for specific TPM error codes + if ((hr & 0x0000FFFF) == 0x0000001D) { + // TPM_RC_SCHEME + errorMsg += " - TPM_RC_SCHEME: The signing scheme is not supported by the TPM"; + } else if ((hr & 0x0000FFFF) == 0x00000143) { + // TPM_RC_KEY + errorMsg += " - TPM_RC_KEY: Key handle references a key that is not suitable for the operation"; + } else if ((hr & 0x0000FFFF) == 0x00000184) { + // TPM_RC_ATTRIBUTES + errorMsg += " - TPM_RC_ATTRIBUTES: Key attributes are not compatible with the operation"; + } + + throw std::runtime_error(errorMsg); + } + + std::cout << "Required attestation buffer size: " << cbAttestation << " bytes" << std::endl; + + // Second call to generate actual attestation + std::vector attestationBlob(cbAttestation); + hr = TpmAttGenerateKeyAttestation( + hAIKKey_, // AIK handle + hHardwareKey_, // Hardware key to attest + pbNonce, // Optional nonce + cbNonce, // Nonce size + attestationBlob.data(), // Output buffer + cbAttestation, // Buffer size + &cbAttestation // Actual size used + ); + + if (FAILED(hr)) { + throw std::runtime_error("Failed to generate key attestation: " + std::to_string(hr)); + } + + // Resize to actual used size + attestationBlob.resize(cbAttestation); + + result.attestation = base64Encode(attestationBlob); + result.keyType = keyTypeString_; + + // Get real PCR values from TPM + try { + result.pcrValues = getRealPCRValues(); + std::cout << "✓ Retrieved real PCR values from TPM" << std::endl; + } catch (const std::exception &e) { + std::cout << "Warning: Could not get real PCR values: " << e.what() << std::endl; + // Fallback to empty PCR values if platform access fails + result.pcrValues = ""; + } + + std::cout << "✓ Generated TPM key attestation using TmpAtt library" << std::endl; + std::cout << " Attestation size: " << cbAttestation << " bytes" << std::endl; + std::cout << " Key type: " << result.keyType << std::endl; + + return result; + } catch (const std::exception &e) { + if (hAIKKey_) { + NCryptDeleteKey(hAIKKey_, 0); + NCryptFreeObject(hAIKKey_); + hAIKKey_ = NULL; + } + throw; + } + } + +private: + EVP_PKEY *createEVPKeyFromRawPoint(const std::vector &rawPoint) { + if (rawPoint.size() != 65 || rawPoint[0] != 0x04) { + return nullptr; + } + + // Create EC_KEY for P-256 curve + EC_KEY *ecKey = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); + if (!ecKey) { + return nullptr; + } + + // Create point from raw coordinates + const EC_GROUP *group = EC_KEY_get0_group(ecKey); + EC_POINT *point = EC_POINT_new(group); + if (!point) { + EC_KEY_free(ecKey); + return nullptr; + } + + // Set point from uncompressed format + if (!EC_POINT_oct2point(group, point, rawPoint.data(), rawPoint.size(), nullptr)) { + EC_POINT_free(point); + EC_KEY_free(ecKey); + return nullptr; + } + + // Set the public key point + if (!EC_KEY_set_public_key(ecKey, point)) { + EC_POINT_free(point); + EC_KEY_free(ecKey); + return nullptr; + } + + // Convert to EVP_PKEY + EVP_PKEY *pkey = EVP_PKEY_new(); + if (!pkey || !EVP_PKEY_set1_EC_KEY(pkey, ecKey)) { + if (pkey) EVP_PKEY_free(pkey); + EC_POINT_free(point); + EC_KEY_free(ecKey); + return nullptr; + } + + // Cleanup intermediate objects + EC_POINT_free(point); + EC_KEY_free(ecKey); + + return pkey; + } + + std::vector performECDHKeyDerivation(EVP_PKEY *clientPrivKey, EVP_PKEY *serverPubKey) { + // Create derivation context + EVP_PKEY_CTX *ctx = EVP_PKEY_CTX_new(clientPrivKey, nullptr); + if (!ctx) { + throw std::runtime_error("Failed to create ECDH context"); + } + + // Initialize derivation + if (EVP_PKEY_derive_init(ctx) <= 0) { + EVP_PKEY_CTX_free(ctx); + throw std::runtime_error("Failed to initialize ECDH derivation"); + } + + // Set peer key + if (EVP_PKEY_derive_set_peer(ctx, serverPubKey) <= 0) { + EVP_PKEY_CTX_free(ctx); + throw std::runtime_error("Failed to set ECDH peer key"); + } + + // Get shared secret length + size_t secretLen = 0; + if (EVP_PKEY_derive(ctx, nullptr, &secretLen) <= 0) { + EVP_PKEY_CTX_free(ctx); + throw std::runtime_error("Failed to get ECDH secret length"); + } + + // Derive shared secret + std::vector secret(secretLen); + if (EVP_PKEY_derive(ctx, secret.data(), &secretLen) <= 0) { + EVP_PKEY_CTX_free(ctx); + throw std::runtime_error("Failed to derive ECDH shared secret"); + } + + // Cleanup and resize to actual length + EVP_PKEY_CTX_free(ctx); + secret.resize(secretLen); + + std::cout << "ECDH derivation completed, secret length: " << secretLen << " bytes" << std::endl; + return secret; + } +}; + +class TestClient { +private: + std::string baseUrl_ = "http://localhost:28280"; + std::string authToken_; + std::string accelKeyId_; + std::unique_ptr crypto_; + HardwareKeyType keyType_; + +public: + TestClient(HardwareKeyType keyType = HardwareKeyType::ECDSA_P256) : keyType_(keyType) { + crypto_ = std::make_unique(keyType); + std::cout << "Initialized test client with base URL: " << baseUrl_ << std::endl; + } + + bool testRegister(const std::string &username, const std::string &password) { + std::cout << "\n=== Testing Registration ===" << std::endl; + std::cout << "Username: " << username << std::endl; + std::cout << "Password: " << password << std::endl; + + try { + nlohmann::json payload = { + {"username", username}, + {"password", password} + }; + + auto response = cpr::Post( + cpr::Url{baseUrl_ + "/register"}, + cpr::Body{payload.dump()}, + cpr::Header{{"Content-Type", "application/json"}} + ); + + std::cout << "Response status: " << response.status_code << std::endl; + std::cout << "Response body: " << response.text << std::endl; + + if (response.status_code == 201) { + std::cout << "✓ Registration successful!" << std::endl; + return true; + } else { + std::cout << "✗ Registration failed!" << std::endl; + return false; + } + } catch (const std::exception &e) { + std::cout << "✗ Registration error: " << e.what() << std::endl; + return false; + } + } + + bool testLogin(const std::string &username, const std::string &password) { + std::cout << "\n=== Testing Login ===" << std::endl; + std::cout << "Username: " << username << std::endl; + std::cout << "Password: " << password << std::endl; + + try { + nlohmann::json payload = { + {"username", username}, + {"password", password} + }; + + std::string hwPubKey = crypto_->exportHardwarePublicKey(); + std::string hwPubType = crypto_->getHardwareKeyType(); + + std::cout << "Hardware public key (first 50 chars): " << hwPubKey.substr(0, 50) << "..." << std::endl; + std::cout << "Hardware key type: " << hwPubType << std::endl; + + auto response = cpr::Post( + cpr::Url{baseUrl_ + "/login"}, + cpr::Body{payload.dump()}, + cpr::Header{ + {"Content-Type", "application/json"}, + {"x-rpc-sec-bound-token-hw-pub", hwPubKey}, + {"x-rpc-sec-bound-token-hw-pub-type", hwPubType} + } + ); + + std::cout << "Response status: " << response.status_code << std::endl; + std::cout << "Response body: " << response.text << std::endl; + + if (response.status_code == 200) { + auto respJson = nlohmann::json::parse(response.text); + if (respJson.contains("token")) { + authToken_ = respJson["token"]; + std::cout << "✓ Login successful! Token: " << authToken_.substr(0, 20) << "..." << std::endl; + return true; + } + } + + std::cout << "✗ Login failed!" << std::endl; + return false; + } catch (const std::exception &e) { + std::cout << "✗ Login error: " << e.what() << std::endl; + return false; + } + } + + bool testAuthenticated(bool generateAttestation = false) { + std::cout << "\n=== Testing Authenticated Request" << (generateAttestation ? " with Attestation" : "") << " ===" + << std::endl; + + if (authToken_.empty()) { + std::cout << "✗ No auth token available!" << std::endl; + return false; + } + + try { + // Generate timestamp and random hex using OpenSSL + std::string timestamp = std::to_string(std::time(nullptr)); + + // Generate 32 bytes of random data using OpenSSL + unsigned char randomBytes[32]; + if (!RAND_bytes(randomBytes, 32)) { + throw std::runtime_error("Failed to generate random bytes"); + } + + // Convert to hex string + std::stringstream hexStream; + hexStream << std::hex << std::setfill('0'); + for (int i = 0; i < 32; i++) { + hexStream << std::setw(2) << static_cast(randomBytes[i]); + } + std::string randomHex = hexStream.str(); + + // Format request data + std::string requestData = timestamp + "-" + randomHex; + std::cout << "Request data: " << timestamp << "-" << randomHex.substr(0, 16) << "..." << std::endl; + + cpr::Header requestHeaders; + requestHeaders["Authorization"] = "Bearer " + authToken_; + requestHeaders["x-rpc-sec-bound-token-data"] = requestData; + + if (accelKeyId_.empty()) { + // First authenticated request - register ECDH acceleration key + std::cout << "Registering new ECDH acceleration key..." << std::endl; + + std::string accelPub = crypto_->exportAccelPublicKeyPKIX(); + std::string accelPubType = crypto_->getAccelKeyType(); + std::string accelPubSig = crypto_->signDataWithHardwareKey(accelPub); + std::string dataSig = crypto_->signDataWithAccelKey(requestData); + + requestHeaders["x-rpc-sec-bound-token-accel-pub"] = accelPub; + requestHeaders["x-rpc-sec-bound-token-accel-pub-type"] = accelPubType; + requestHeaders["x-rpc-sec-bound-token-accel-pub-sig"] = accelPubSig; + requestHeaders["x-rpc-sec-bound-token-data-sig"] = dataSig; + + std::cout << "Acceleration public key (first 50 chars): " << accelPub.substr(0, 50) << "..." << + std::endl; + std::cout << "Acceleration key type: " << accelPubType << std::endl; + std::cout << "Accel pub signature (first 20 chars): " << accelPubSig.substr(0, 20) << "..." << + std::endl; + std::cout << "Data signature (first 20 chars): " << dataSig.substr(0, 20) << "..." << std::endl; + } else { + // Subsequent requests - use HMAC with shared secret + std::cout << "Using existing acceleration key ID with HMAC: " << accelKeyId_ << std::endl; + + std::string dataSig = crypto_->signDataWithAccelKey(requestData); + requestHeaders["x-rpc-sec-bound-token-accel-pub-id"] = accelKeyId_; + requestHeaders["x-rpc-sec-bound-token-data-sig"] = dataSig; + + std::cout << "HMAC signature (first 20 chars): " << dataSig.substr(0, 20) << "..." << std::endl; + } + + auto response = cpr::Get( + cpr::Url{baseUrl_ + "/authenticated"}, + requestHeaders + ); + + std::cout << "Response status: " << response.status_code << std::endl; + std::cout << "Response body: " << response.text << std::endl; + + // Check for acceleration key ID in response headers + auto it = response.header.find("x-rpc-sec-bound-token-accel-pub-id"); + if (it != response.header.end()) { + accelKeyId_ = it->second; + std::cout << "Received acceleration key ID: " << accelKeyId_ << std::endl; + } + + // Check for server's ECDH public key in response headers + auto serverPubIt = response.header.find("x-rpc-sec-bound-token-accel-pub"); + if (serverPubIt != response.header.end()) { + std::cout << "Received server ECDH public key (first 30 chars): " + << serverPubIt->second.substr(0, 30) << "..." << std::endl; + + // Establish shared secret for future HMAC operations + crypto_->setSharedSecret(serverPubIt->second); + std::cout << "Shared secret established for HMAC authentication" << std::endl; + } + + if (response.status_code == 200) { + std::cout << "✓ Authenticated request successful!" << std::endl; + return true; + } else { + std::cout << "✗ Authenticated request failed!" << std::endl; + return false; + } + } catch (const std::exception &e) { + std::cout << "✗ Authenticated request error: " << e.what() << std::endl; + return false; + } + } + + bool testAttestation() { + std::cout << "\n=== Testing Hardware Key Attestation ===" << std::endl; + + if (authToken_.empty()) { + std::cout << "✗ No auth token available!" << std::endl; + return false; + } + + try { + // First, get a challenge nonce from the server + auto challengeResponse = cpr::Get( + cpr::Url{baseUrl_ + "/challenge"}, + cpr::Header{{"Authorization", "Bearer " + authToken_}} + ); + + if (challengeResponse.status_code != 200) { + std::cout << "✗ Failed to get challenge: " << challengeResponse.status_code << std::endl; + return false; + } + + auto challengeJson = nlohmann::json::parse(challengeResponse.text); + std::string nonce = challengeJson["nonce"]; + std::cout << "Received challenge nonce: " << nonce.substr(0, 20) << "..." << std::endl; + + // Generate attestation for the hardware key + auto attestationData = crypto_->getHardwareKeyAttestation(nonce); + + // Send attestation to server + nlohmann::json attestPayload = { + {"attestation", attestationData.attestation}, + {"aik_public_key", attestationData.aikPublicKey}, + {"pcr_values", attestationData.pcrValues}, + {"key_type", attestationData.keyType}, + {"nonce", nonce} + }; + + auto attestResponse = cpr::Post( + cpr::Url{baseUrl_ + "/attest"}, + cpr::Body{attestPayload.dump()}, + cpr::Header{ + {"Content-Type", "application/json"}, + {"Authorization", "Bearer " + authToken_} + } + ); + + std::cout << "Attestation response status: " << attestResponse.status_code << std::endl; + std::cout << "Attestation response body: " << attestResponse.text << std::endl; + + if (attestResponse.status_code == 200) { + std::cout << "✓ Hardware key attestation successful!" << std::endl; + return true; + } else { + std::cout << "✗ Hardware key attestation failed!" << std::endl; + return false; + } + } catch (const std::exception &e) { + std::cout << "✗ Attestation error: " << e.what() << std::endl; + return false; + } + } + + void runFullTest() { + std::string keyTypeStr = (keyType_ == HardwareKeyType::RSA_2048_PSS) ? "RSA-2048-PSS" : "ECDSA-P256"; + + std::cout << "==========================================" << std::endl; + std::cout << "Hardware-Bound Authentication Test" << std::endl; + std::cout << keyTypeStr << " Hardware Key + ECDH-P256 Accel Key" << std::endl; + std::cout << "Using NCrypt (Hardware) + OpenSSL (ECDH)" << std::endl; + std::cout << "==========================================" << std::endl; + + std::string username = "testuser_" + keyTypeStr + "_" + std::to_string(std::time(nullptr)); + std::string password = "testpass123"; + + // Test 1: Register + bool registerSuccess = testRegister(username, password); + + // Test 2: Login with hardware key + bool loginSuccess = false; + if (registerSuccess) { + loginSuccess = testLogin(username, password); + } + + // Test 3: Authenticated request (first time - register ECDH accel key) + bool authSuccess1 = false; + if (loginSuccess) { + authSuccess1 = testAuthenticated(); + } + + // Test 4: Authenticated request (second time - use existing ECDH key) + bool authSuccess2 = false; + if (authSuccess1) { + std::cout << "\n=== Testing Second Authenticated Request ===" << std::endl; + authSuccess2 = testAuthenticated(); + } + + // Test 5: Third authenticated request to verify ECDH key persistence + bool authSuccess3 = false; + if (authSuccess2) { + std::cout << "\n=== Testing Third Authenticated Request ===" << std::endl; + authSuccess3 = testAuthenticated(); + } + + // Test 6: Hardware key attestation + bool attestSuccess = false; + if (authSuccess3) { + attestSuccess = testAttestation(); + } + + // Summary + std::cout << "\n==========================================" << std::endl; + std::cout << "Test Results Summary:" << std::endl; + std::cout << "==========================================" << std::endl; + std::cout << "Registration: " << (registerSuccess ? "✓ PASS" : "✗ FAIL") << std::endl; + std::cout << "Login (" << keyTypeStr << " HW): " << (loginSuccess ? "✓ PASS" : "✗ FAIL") << std::endl; + std::cout << "Auth (new ECDH key): " << (authSuccess1 ? "✓ PASS" : "✗ FAIL") << std::endl; + std::cout << "Auth (existing ECDH): " << (authSuccess2 ? "✓ PASS" : "✗ FAIL") << std::endl; + std::cout << "Auth (ECDH persistent): " << (authSuccess3 ? "✓ PASS" : "✗ FAIL") << std::endl; + std::cout << "HW Key Attestation: " << (attestSuccess ? "✓ PASS" : "✗ FAIL") << std::endl; + + bool allPassed = registerSuccess && loginSuccess && authSuccess1 && authSuccess2 && authSuccess3 && + attestSuccess; + std::cout << "\nOverall Result: " << (allPassed ? "✓ ALL TESTS PASSED" : "✗ SOME TESTS FAILED") << + std::endl; + + if (allPassed) { + std::cout << "\n🎉 Congratulations! All hardware-bound authentication tests passed!" << std::endl; + std::cout << "✓ " << keyTypeStr << " hardware key authentication works (NCrypt)" << std::endl; + std::cout << "✓ ECDH-P256 acceleration key exchange works (OpenSSL)" << std::endl; + std::cout << "✓ Key persistence and reuse works" << std::endl; + std::cout << "✓ Hardware key attestation with AIK works" << std::endl; + std::cout << "✓ Hybrid NCrypt/OpenSSL integration successful" << std::endl; + } + + std::cout << "==========================================" << std::endl; + } +}; + +int main(int argc, char *argv[]) { + try { + std::cout << "Starting hardware-bound authentication test..." << std::endl; + + // Default to testing both key types + bool testECDSA = true; + bool testRSA = true; + + // Parse command line arguments + if (argc > 1) { + std::string arg = argv[1]; + if (arg == "ecdsa") { + testRSA = false; + } else if (arg == "rsa") { + testECDSA = false; + } else if (arg == "both") { + // Test both (default) + } else { + std::cout << "Usage: " << argv[0] << " [ecdsa|rsa|both]" << std::endl; + return 1; + } + } + + // Run tests based on selection + if (testECDSA) { + std::cout << "\nTesting with ECDSA-P256 hardware key..." << std::endl; + TestClient clientECDSA(HardwareKeyType::ECDSA_P256); + clientECDSA.runFullTest(); + } + + if (testRSA) { + if (testECDSA) { + std::cout << "\n\n"; + } + std::cout << "Testing with RSA-2048-PSS hardware key..." << std::endl; + TestClient clientRSA(HardwareKeyType::RSA_2048_PSS); + clientRSA.runFullTest(); + } + + std::cout << "\nAll tests completed." << std::endl; + return 0; + } catch (const std::exception &e) { + std::cerr << "Fatal error: " << e.what() << std::endl; + return 1; + } +} diff --git a/hw-sign-win/preload.cmake b/hw-sign-win/preload.cmake new file mode 100644 index 0000000..c285204 --- /dev/null +++ b/hw-sign-win/preload.cmake @@ -0,0 +1 @@ +set(CMAKE_TOOLCHAIN_FILE "$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" CACHE STRING "Vcpkg toolchain file") \ No newline at end of file diff --git a/hw-sign-win/vcpkg.json b/hw-sign-win/vcpkg.json new file mode 100644 index 0000000..ad67d11 --- /dev/null +++ b/hw-sign-win/vcpkg.json @@ -0,0 +1,9 @@ +{ + "name": "hw-sign-win", + "version": "1.0.0", + "dependencies": [ + "cpr", + "nlohmann-json", + "openssl" + ] +} \ No newline at end of file