diff --git a/include/wwfcCommon.h b/include/wwfcCommon.h index 10a6565..da34a3f 100644 --- a/include/wwfcCommon.h +++ b/include/wwfcCommon.h @@ -28,10 +28,10 @@ typedef double f64; #ifndef WWFC_DOMAIN -# ifdef USE_TEST_DOMAIN -# define WWFC_DOMAIN "nwfc.wiinoma.com" // Points to localhost -# else +# ifdef PROD # define WWFC_DOMAIN "wiilink24.com" +# else +# define WWFC_DOMAIN "nwfc.wiinoma.com" // Points to localhost # endif #endif diff --git a/include/wwfcPayloadPublicKey.hpp b/include/wwfcPayloadPublicKey.hpp index aedf80a..19b7c74 100644 --- a/include/wwfcPayloadPublicKey.hpp +++ b/include/wwfcPayloadPublicKey.hpp @@ -3,6 +3,9 @@ namespace wwfc { +#ifdef PROD + +// Production payload key constexpr unsigned char PayloadPublicKey[] = { 0x7d, 0x18, 0x2b, 0x27, 0x9c, 0xab, 0x6b, 0x69, 0x40, 0x8d, 0x11, 0xb7, 0x5e, 0x76, 0xb2, 0xda, 0xa6, 0x18, 0xa1, 0x0e, 0x5d, 0x5f, 0xf3, 0xc9, @@ -49,4 +52,55 @@ constexpr unsigned char PayloadPublicKey[] = { 0x78, 0x86, 0xc1, 0x70, 0x36, 0x0c, 0xe0, 0xee, 0x24, 0xfe, 0x0f, 0xf3, }; -} +#else + +// Development payload key +constexpr unsigned char PayloadPublicKey[] = { + 0x3f, 0x32, 0xeb, 0x87, 0xb9, 0x75, 0x15, 0xc9, 0x60, 0x17, 0x7c, 0xcf, + 0x52, 0x18, 0x36, 0x66, 0x8e, 0xe9, 0x26, 0xe8, 0x58, 0x1f, 0xff, 0x84, + 0xca, 0x63, 0x63, 0x9f, 0x4f, 0xa5, 0x77, 0x41, 0xe4, 0x4e, 0x5c, 0x49, + 0xb7, 0x54, 0x15, 0xf5, 0x74, 0x70, 0xbc, 0xf4, 0xce, 0x5e, 0x66, 0x78, + 0xf1, 0xe5, 0xfe, 0x3a, 0x98, 0x18, 0xbd, 0x8f, 0x9a, 0xb7, 0x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0x84, 0xaf, 0x7a, 0x35, 0x85, 0x26, 0xb4, 0xfc, 0x58, 0x2f, 0x89, + 0x2a, 0x97, 0xc8, 0x49, 0xb3, 0x61, 0xbd, 0xf5, 0xda, 0xe9, 0x87, 0x9b, + 0xea, 0x5c, 0x4c, 0x15, 0x19, 0x1f, 0x76, 0x0c, 0x01, 0x6f, 0x32, 0x80, + 0x73, 0xd1, 0xc4, 0x4a, 0x87, 0x32, 0x1e, 0xd6, 0xdf, 0xd9, 0x0a, 0x27, + 0x66, 0xb2, 0x74, 0xc1, 0xca, 0xae, 0x16, 0xca, 0x17, 0x66, 0x09, 0xe9, + 0x37, 0xca, 0x20, 0xfe, 0xa2, 0xa6, 0x7b, 0x2c, 0xd9, 0x6d, 0x91, 0x26, + 0xe6, 0x61, 0xdd, 0xbb, 0x11, 0x18, 0x7c, 0xfb, 0x8f, 0x43, 0x71, 0x6b, + 0x6a, 0xa2, 0x0a, 0xd3, 0xc6, 0x98, 0x94, 0xd8, 0x63, 0xb0, 0x49, 0xf5, +}; + +#endif + +} // namespace wwfc diff --git a/misc/private-key-dev.pem b/misc/private-key-dev.pem new file mode 100644 index 0000000..659c6a1 --- /dev/null +++ b/misc/private-key-dev.pem @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDl5w1oP2Q3Lvxa +G2Q4+FFVMLzNPtXU9h3vhcKxrj1b6b3jBJH4S4I1nQAuio1l39yoMqy84HYsRYPA +S3500m+6HsZ0Tc4+2Qli2p5f0t7aSLSI7z1abA2Kvi/kOcdYctLc1oBnwIKMYyZt +l+Bt0j2ekPfFzvhCkO7ivMDKUUvW0xzfRNblHlUAadkCfYySkuDz0LX+5MiYVUBg +BjQPCa8330scZ/tizw6BL/5dAWmIhj4OwGgGQQ6nRJV+uIusQxjzwM7xfIAAgZq3 +UpmYGL2P8eX+Os5eZnh0cLz0t1QV9eROXElPpXdBymNjn1gf/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h2t/7kAPVywOZ7I26EFMgA2ovyyFAoGAPuH7YNA+QZ0CklkCVdFW +kK3tcKrj7OD0wg+f0jWhLJBFllz7kSxrx74gNVvEdAtgekdDuq2Dcr8ZaD1TpnpN +7heXaUYXJQpGwGB2dqnC3TiwFiTxzqnLD4dhMpPt/Q8DQC+JZ9O3qy0oALX0GIkn +vQOkiErau2+0+ZsaB1IRRZ4= +-----END PRIVATE KEY----- diff --git a/stage1/make-stage1.py b/stage1/make-stage1.py index 89a28ce..9b236b2 100644 --- a/stage1/make-stage1.py +++ b/stage1/make-stage1.py @@ -20,11 +20,11 @@ except: pass -ccflags = "-Os -std=c++20 -fno-rtti -ffreestanding -nodefaultlibs -nostdlib -fno-unwind-tables -fno-exceptions -fmerge-all-constants -ffunction-sections -fdata-sections -fshort-enums -nodefaultlibs -nostdlib -lgcc -Wl,--gc-sections " +ccflags = "-g -Os -std=c++20 -fno-rtti -ffreestanding -nodefaultlibs -nostdlib -fno-unwind-tables -fno-exceptions -fmerge-all-constants -ffunction-sections -fdata-sections -fshort-enums -nodefaultlibs -nostdlib -lgcc -Wl,--gc-sections -n " ccflags += "-I" + os.path.join("..", "include") -subprocess.run([path_cc, "wwfcStage1.cpp"] + ccflags.split(" ") + ["-S", "-o" + os.path.join(path_build, "build.s")] + extra_build_flags).check_returncode() +subprocess.run([path_cc, "wwfcStage1.cpp"] + ccflags.split(" ") + ["-S", "-o" + os.path.join(path_build, "stage1.s")] + extra_build_flags).check_returncode() -subprocess.run([path_cc, os.path.join(path_build, "build.s")] + ccflags.split(" ") + ['-o' + os.path.join(path_build, "build.elf"), "-Tstage1.ld"]).check_returncode() +subprocess.run([path_cc, os.path.join(path_build, "stage1.s")] + ccflags.split(" ") + ['-o' + os.path.join(path_build, "stage1.elf"), "-Tstage1.ld"]).check_returncode() -subprocess.run([path_objcopy, os.path.join(path_build, "build.elf"), os.path.join(path_build, "stage1.bin"), "-O", "binary"]).check_returncode() +subprocess.run([path_objcopy, os.path.join(path_build, "stage1.elf"), os.path.join(path_build, "stage1.bin"), "-O", "binary"]).check_returncode()