| Function report | 
| Source Code: security\keys\encrypted-keys\encrypted.c | Create Date:2022-07-28 18:33:33 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:Allocate memory for decrypted key and datablob.
Proto:static struct encrypted_key_payload *encrypted_key_alloc(struct key *key, const char *format, const char *master_desc, const char *datalen)
Type:struct encrypted_key_payload
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct key * | key | |
| const char * | format | |
| const char * | master_desc | |
| const char * | datalen | 
| 612 | struct encrypted_key_payload * epayload = NULL | 
| 622 | If ret < 0 || dlen < MIN_DATA_SIZE || dlen > MAX_DATA_SIZE Then Return ERR_PTR( - EINVAL) | 
| 625 | format_len = If Not format Then strlen - Find the length of a string*@s: The string to be sized Else strlen - Find the length of a string*@s: The string to be sized | 
| 626 | decrypted_datalen = dlen | 
| 628 | If format Then | 
| 629 | If Not strcmp(format, key_format_ecryptfs) Then | 
| 630 | If dlen != ECRYPTFS_MAX_KEY_BYTES Then | 
| 631 | pr_err("encrypted_key: keylen for the ecryptfs format must be equal to %d bytes\n", ECRYPTFS_MAX_KEY_BYTES) | 
| 636 | payload_datalen = sizeof(structecryptfs_auth_tok) | 
| 637 | Else if Not strcmp(format, key_format_enc32) Then | 
| 638 | If decrypted_datalen != KEY_ENC32_PAYLOAD_LEN Then | 
| 639 | pr_err("encrypted_key: enc32 key payload incorrect length: %d\n", decrypted_datalen) | 
| 651 | ret = key_payload_reserve - Adjust data quota reservation for the key's payload*@key: The key to make the reservation for | 
| 656 | epayload = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). | 
| 664 | Return epayload | 
| Name | Describe | 
|---|---|
| encrypted_instantiate | rypted_instantiate - instantiate an encrypted key* Decrypt an existing encrypted datablob or create a new encrypted key* based on a kernel random number.* On success, return 0. Otherwise return errno. | 
| encrypted_update | rypted_update - update the master key description* Change the master key description for an existing encrypted key.* The next read will return an encrypted datablob using the new* master key description.* On success, return 0. Otherwise return errno. | 
| Source code conversion tool public plug-in interface | X | 
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |