Changes

977 bytes added ,  22:17, 25 February 2017
Add official syscall names according to GPLed parts of IOSC (somehow ES got included as a Linux GPL kernel module, lol: https://github.com/iversonjimmy/acer_cloud_wifi_copy/blob/master/sw_x/es_core/kernel/linux/esc.c#L245)
Line 309: Line 309:  
|  || || || Korean Common Key
 
|  || || || Korean Common Key
 
|-
 
|-
| 5b || int create_key(int *keyid, KEY_USAGE usage, KEY_TYPE type) || 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
 
|-
 
|-
| 5c || int IOSC_DeleteObject(int keyid) || Remove a keyring entry || 0 on success, negative for error
+
| 5c || IOSCError IOSC_DeleteObject(int key_handle) || Remove a keyring entry || 0 on success, negative for error
 
|-
 
|-
| 5d || int initialize_key(int *keyid, u32, int decryption_keyid, u32, u32, void *iv, void *crypted_key) || Sets the contents of a key || 0 on success, negative for error
+
| 5d || IOSCError IOSC_ImportSecretKey(IOSCSecretKeyHandle importedHandle, IOSCSecretKeyHandle verifyHandle, IOSCSecretKeyHandle decryptHandle, IOSCSecretKeySecurity flag, u8 * signbuffer, u8 * ivData, u8 * keybuffer); || Sets the contents of a key || 0 on success, negative for error
 
|-
 
|-
 
| 5e || keyring_deallocate_entry(int index) || || 0 on success, negative for error
 
| 5e || keyring_deallocate_entry(int index) || || 0 on success, negative for error
 
|-
 
|-
| 5f || int set_sig_data(const void *data, const u32 *userdata, int keyid) || Sets the contents of a signature. data length should match the signature type, user_data is optional 4 bytes that can be attached || 0 on success, negative for error
+
| 5f || IOSCError IOSC_ImportPublicKey(u8 * publicKeyData, u8 * exponent, IOSCPublicKeyHandle publicKeyHandle); || Sets the contents of a signature. data length should match the signature type, user_data is optional 4 bytes that can be attached || 0 on success, negative for error
 
|-
 
|-
| 60 || int get_sig_info(void *data, u32 *userdata, int keyid) || Gets the contents of a signature || 0 on success, negative for error
+
| 60 || IOSCError IOSC_ExportPublicKey(u8 * publicKeyData, u8 * exponent, IOSCPublicKeyHandle publicKeyHandle); || Gets the contents of a signature || 0 on success, negative for error
 
|-
 
|-
| 61 || int calc_ecdh_shared_secret(int self_ecc_keyid, int sender_ecc_public_keyid, int dest_keyid) || Generates a new AES crypto key from an ecdh shared secret calculated from a sender's ECC key and our own ECC key || 0 on success, negative for error
+
| 61 || IOSCError IOSC_ComputeSharedKey(IOSCSecretKeyHandle privateHandle, IOSCPublicKeyHandle publicHandle, IOSCSecretKeyHandle sharedHandle); || Generates a new AES crypto key from an ecdh shared secret calculated from a sender's ECC key and our own ECC key || 0 on success, negative for error
 
|-
 
|-
| 62 || int set_4byte_key(int keyid, const u32 *data) || || 0 on success, negative for error
+
| 62 || IOSCError IOSC_SetData(IOSCDataHandle dataHandle, u32 value); || || 0 on success, negative for error
 
|-
 
|-
| 63 || int get_4byte_key(int keyid, u32 *data) || Fetch 4 bytes of userdata from the key || 0 on success (userdata in data), negative for error
+
| 63 || IOSCError IOSC_GetData(IOSCDataHandle dataHandle, u32 * value); || Fetch 4 bytes of userdata from the key || 0 on success (userdata in data), negative for error
 
|-
 
|-
| 64 || int get_key_size(int keyid, u32 *size) || Return the key's size in size[0] || 0 on success, negative for error
+
| 64 || IOSCError IOSC_GetKeySize(u32 * keySize, IOSCKeyHandle handle);|| Return the key's size in size[0] || 0 on success, negative for error
 
|-
 
|-
 
| 65 || int get_key_userdata_size(int keyid, u32 *size) || Return the key's userdata size in size[0] || 0 on success, negative for error
 
| 65 || int get_key_userdata_size(int keyid, u32 *size) || Return the key's userdata size in size[0] || 0 on success, negative for error
Line 333: Line 333:  
| 66 || int IOSC_GenerateHashAsync(void *SHACarry, const void *data, u32 length, u32 SHAMode, void *hash, int queueid, ipcmessage *message) || Calculate SHA1 hash of data, send message to queueid with result || 0 on success
 
| 66 || int IOSC_GenerateHashAsync(void *SHACarry, const void *data, u32 length, u32 SHAMode, void *hash, int queueid, ipcmessage *message) || Calculate SHA1 hash of data, send message to queueid with result || 0 on success
 
|-
 
|-
| 67 || int IOSC_GenerateHash(void *SHACarry, const void *data, u32 length, u32 SHAMode, void *hash) || Synchronous implementation of IOSC_GenerateHashAsync || 0 on success
+
| 67 || IOSCError IOSC_GenerateHash(u8 * context, u8 * inputData, u32 inputSize, u32 chainingFlag, u8 * hashData); || Synchronous implementation of IOSC_GenerateHashAsync || 0 on success
 
|-
 
|-
 
| 68 || int IOSC_EncryptAsync(int keyid, void *iv, const void *in, int len, void *out, int queueid, ipcmessage *message) || AES-encrypt len bytes from in using keyid and iv (which gets updated) and write to out. Send message to queueid with result || 0 on success
 
| 68 || int IOSC_EncryptAsync(int keyid, void *iv, const void *in, int len, void *out, int queueid, ipcmessage *message) || AES-encrypt len bytes from in using keyid and iv (which gets updated) and write to out. Send message to queueid with result || 0 on success
 
|-
 
|-
| 69 || int IOSC_Encrypt(int keyid, void *iv, const void *in, int len, void *out) || Synchronous implementation of IOSC_EncryptAsync || 0 on success
+
| 69 || IOSCError IOSC_Encrypt(IOSCSecretKeyHandle encryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData); || Synchronous implementation of IOSC_EncryptAsync || 0 on success
 
|-
 
|-
 
| 6a || int IOSC_DecryptAsync(int keyid, void *iv, const void *in, int len, void *out, int queueid, ipcmessage *message) || AES-decrypt len bytes from in using keyid and iv (which gets updated) and write to out. Send message to queueid with result || 0 on success
 
| 6a || int IOSC_DecryptAsync(int keyid, void *iv, const void *in, int len, void *out, int queueid, ipcmessage *message) || AES-decrypt len bytes from in using keyid and iv (which gets updated) and write to out. Send message to queueid with result || 0 on success
 
|-
 
|-
| 6b || int IOSC_Decrypt(int keyid, void *iv, const void *in, int len, void *out) || Synchronous implementation of IOSC_DecryptAsync || 0 on success
+
| 6b || IOSCError IOSC_Decrypt(IOSCSecretKeyHandle decryptHandle, u8 * ivData, u8 * inputData, u32 inputSize, u8 * outputData); || Synchronous implementation of IOSC_DecryptAsync || 0 on success
 
|-
 
|-
| 6c || int check_sig(const void *hash, int hash_length, int signer_keyid, const void *sig) || || 0 on success
+
| 6c || IOSCError IOSC_VerifyPublicKeySign(u8 * inputData, u32 inputSize, IOSCPublicKeyHandle publicHandle, u8 * signData); || || 0 on success
 
|-
 
|-
| 6d || int hmac || || 0 on success
+
| 6d || IOSCError IOSC_GenerateBlockMAC(u8 * context, u8 * inputData, u32 inputSize, u8 * customData, u32 customDataSize, IOSCSecretKeyHandle signerHandle, u32 chainingFlag, u8 * signData); || || 0 on success
 
|-
 
|-
| 6e || int hmac_async || || 0 on success
+
| 6e || int hmac_async || Async version of IOSC_GenerateBlockMAC || 0 on success
 
|-
 
|-
| 6f || int validate_cert(void *cert, int signer_keyid, int dest_keyid) || || 0 on success
+
| 6f || IOSCError IOSC_ImportCertificate(u8 * certData, IOSCPublicKeyHandle signerHandle, IOSCPublicKeyHandle publicKeyHandle); || || 0 on success
 
|-
 
|-
| 70 || int get_ng_cert(void *cert) || Write 0x180 bytes of NG certificate to cert || 0 on success
+
| 70 || IOSCError IOSC_GetDeviceCertificate(IOSCEccSignedCert * certificate); || Write 0x180 bytes of NG certificate to cert || 0 on success
 
|-
 
|-
| 71 || int set_key_permissions(int keyid, u32 mask) || Allow the PIDs set in mask to use this key || 0 on success
+
| 71 || IOSCError IOSC_SetOwnership(u32 handle, u32 users); || Allow the PIDs set in mask to use this key || 0 on success
 
|-
 
|-
| 72 || int get_key_permissions(int keyid, u32 *mask) || Get a mask of the PIDs allowed to use this key || 0 on success
+
| 72 || IOSCError IOSC_GetOwnership(u32 handle, u32 * users); || Get a mask of the PIDs allowed to use this key || 0 on success
 
|-
 
|-
| 73 || int get_random_data(void *data, u32 size) || Write size bytes of random data to data || 0 on success
+
| 73 || IOSCError IOSC_GenerateRand(u8 * randBytes, u32 numBytes); || Write size bytes of random data to data || 0 on success
 
|-
 
|-
| 74 || int init_random_key(int keyid) || Sets contents of keyid to random data
+
| 74 || IOSCError IOSC_GenerateKey(IOSCKeyHandle handle); || Sets contents of keyid to random data
 
|-
 
|-
| 75 || int make_ECC_sig(void *SHAhash, u32 hash_length, int keyid, void *ecc_sig) || || 0 on success
+
| 75 || IOSCError IOSC_GeneratePublicKeySign(u8 * hash, u32 hashLength, IOSCSecretKeyHandle signerHandle, u8 * eccSignature); || Makes an ECC signature || 0 on success
 
|-
 
|-
| 76 || int syscall_76(int ecc_keyid, void *in_64bytes, void *out_180bytes) || || 0 on success
+
| 76 || IOSCError IOSC_GenerateCertificate(IOSCSecretKeyHandle privateHandle, IOSCCertName certname, IOSCEccSignedCert * certificate); || || 0 on success
 
|-
 
|-
 
| 77 || syscall_77 || can only be called from DI || 0 on success, negative on error
 
| 77 || syscall_77 || can only be called from DI || 0 on success, negative on error
219

edits