Line 285:
Line 285:
|-
|-
| 5a || u32 load_module(const char* path) || Load the specified IOS module and run it (can only be called from UID 0, which is kernel or ES) || 0 on success, negative for error
| 5a || u32 load_module(const char* path) || Load the specified IOS module and run it (can only be called from UID 0, which is kernel or ES) || 0 on success, negative for error
−
|-
−
! ENUMS !! KEY_USAGE !! KEY_TYPE !! KEY_IDS
−
|-
−
| || crypto || aes || ECC Private Key
−
|-
−
| || signature || hmac || Console ID
−
|-
−
| || ECC Pair || 2048b Certificate || NAND AES Key
−
|-
−
| || Informative || 4096b Certificate || NAND HMAC
−
|-
−
| || || ECC || Common Key
−
|-
−
| || || Console ID || PRNG Seed
−
|-
−
| || || [[Hardware/SEEPROM|SEEPROM]] Counter || SD Key
−
|-
−
| || || || Boot2 Version
−
|-
−
| || || || ?
−
|-
−
| || || || ?
−
|-
−
| || || || [[Hardware/SEEPROM|SEEPROM]] NAND Generation
−
|-
−
| || || || Korean Common Key
|-
|-
| 5b || IOSCError IOSC_CreateObject(u32* key_handle, IOSCObjectType type, IOSCObjectSubType subtype); || create a new keyring entry || 0 on success, negative for error
| 5b || IOSCError IOSC_CreateObject(u32* key_handle, IOSCObjectType type, IOSCObjectSubType subtype); || create a new keyring entry || 0 on success, negative for error
Line 397:
Line 371:
|-
|-
| 4 || write(const char *string) || Prints a null-terminated debug message. || none.
| 4 || write(const char *string) || Prints a null-terminated debug message. || none.
+
|}
+
+
== IOSC built-in key handles ==
+
The above crypto commands use key/crypto object handles. These handles can be either from IOSC_CreateObject(which can then be initialized with IOSC_ImportSecretKey in the case of AES), or a built-in handle. The available built-in handles/ids are listed below.
+
+
Names starting with IOSC are official names which were found in the GPLed parts of IOS.
+
+
{|border=1 class="wikitable"
+
|+ List of syscalls in IOS
+
|-
+
! ID !! Internal name !! Description
+
|-
+
| 0 || IOSC_DEV_SIGNING_KEY_HANDLE || ECC-233 private key (source: xyzzy)
+
|-
+
| 1 || IOSC_DEV_ID_HANDLE || Console ID
+
|-
+
| 2 || IOSC_FS_ENC_HANDLE || NAND AES-128 key
+
|-
+
| 3 || IOSC_FS_MAC_HANDLE || NAND HMAC
+
|-
+
| 4 || IOSC_COMMON_ENC_HANDLE || Common key
+
|-
+
| 5 || IOSC_BACKUP_ENC_HANDLE || PRNG seed (source: xyzzy)
+
|-
+
| 6 || IOSC_APP_ENC_HANDLE || SD AES-128 key (source: xyzzy)
+
|-
+
| 0xfffffff || IOSC_ROOT_KEY_HANDLE || Unknown
+
|-
+
| 7 || IOSC_BOOTOSVER_HANDLE || Unknown -- boot2 version?
+
|-
+
| 8 || IOSC_CACRLVER_HANDLE || Unknown
+
|-
+
| 9 || IOSC_SIGNERCRLVER_HANDLE || Unknown
+
|-
+
| 10 || IOSC_FSVER_HANDLE || Unknown -- [[Hardware/SEEPROM|SEEPROM]] NAND generation?
+
|-
+
| 11 || IOSC_COMMON2_ENC_HANDLE || Korean common key
+
|-
|}
|}