Changeset 11473 for trunk/oscam-aes.c
- Timestamp:
- 01/18/19 20:17:57 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/oscam-aes.c
r11470 r11473 8 8 void aes_set_key(struct aes_keys *aes, char *key) 9 9 { 10 AES_set_decrypt_key((const u nsigned char*)key, 128, &aes->aeskey_decrypt);11 AES_set_encrypt_key((const u nsigned char*)key, 128, &aes->aeskey_encrypt);10 AES_set_decrypt_key((const uint8_t *)key, 128, &aes->aeskey_decrypt); 11 AES_set_encrypt_key((const uint8_t *)key, 128, &aes->aeskey_encrypt); 12 12 } 13 13 … … 22 22 } 23 23 24 void aes_decrypt(struct aes_keys *aes, u char*buf, int32_t n)24 void aes_decrypt(struct aes_keys *aes, uint8_t *buf, int32_t n) 25 25 { 26 26 int32_t i; … … 31 31 } 32 32 33 void aes_encrypt_idx(struct aes_keys *aes, u char*buf, int32_t n)33 void aes_encrypt_idx(struct aes_keys *aes, uint8_t *buf, int32_t n) 34 34 { 35 35 int32_t i; … … 40 40 } 41 41 42 void aes_cbc_encrypt(struct aes_keys *aes, u char *buf, int32_t n, uchar*iv)42 void aes_cbc_encrypt(struct aes_keys *aes, uint8_t *buf, int32_t n, uint8_t *iv) 43 43 { 44 44 AES_cbc_encrypt(buf, buf, n, &aes->aeskey_encrypt, iv, AES_ENCRYPT); 45 45 } 46 46 47 void aes_cbc_decrypt(struct aes_keys *aes, u char *buf, int32_t n, uchar*iv)47 void aes_cbc_decrypt(struct aes_keys *aes, uint8_t *buf, int32_t n, uint8_t *iv) 48 48 { 49 49 AES_cbc_encrypt(buf, buf, n, &aes->aeskey_decrypt, iv, AES_DECRYPT); … … 51 51 52 52 /* Creates an AES_ENTRY and adds it to the given linked list. */ 53 void add_aes_entry(AES_ENTRY **list, uint16_t caid, uint32_t ident, int32_t keyid, u char*aesKey)53 void add_aes_entry(AES_ENTRY **list, uint16_t caid, uint32_t ident, int32_t keyid, uint8_t *aesKey) 54 54 { 55 55 AES_ENTRY *new_entry, *next, *current; … … 65 65 if(memcmp(aesKey, "\xFF\xFF", 2)) 66 66 { 67 AES_set_decrypt_key((const u nsigned char*)aesKey, 128, &(new_entry->key));67 AES_set_decrypt_key((const uint8_t *)aesKey, 128, &(new_entry->key)); 68 68 // cs_log("adding key : %s",cs_hexdump(1,aesKey,16, tmp, sizeof(tmp))); 69 69 } … … 102 102 char *tmp; 103 103 int32_t nb_keys, key_id; 104 u charaes_key[16];104 uint8_t aes_key[16]; 105 105 char *save = NULL; 106 106 … … 210 210 211 211 212 int32_t aes_decrypt_from_list(AES_ENTRY *list, uint16_t caid, uint32_t provid, int32_t keyid, u char*buf, int32_t n)212 int32_t aes_decrypt_from_list(AES_ENTRY *list, uint16_t caid, uint32_t provid, int32_t keyid, uint8_t *buf, int32_t n) 213 213 { 214 214 AES_ENTRY *current = aes_list_find(list, caid, provid, keyid);
Note:
See TracChangeset
for help on using the changeset viewer.