Skip to content

Commit

Permalink
Merge pull request abrasive#123 from juhovh/master
Browse files Browse the repository at this point in the history
RSA and AES cleanup
  • Loading branch information
JH Laird committed Jan 8, 2012
2 parents 6ce7675 + 0fdae6f commit 4172b69
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
8 changes: 3 additions & 5 deletions hairtunes.c
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,10 @@ void alac_decode(short *dest, char *buf, int len) {
assert(len<=MAX_PACKET);

unsigned char iv[16];
int i;
int aeslen = len & ~0xf;
memcpy(iv, aesiv, sizeof(iv));
for (i=0; i+16<=len; i += 16)
AES_cbc_encrypt((unsigned char*)buf+i, packet+i, 0x10, &aes, iv, AES_DECRYPT);
if (len & 0xf)
memcpy(packet+i, buf+i, len & 0xf);
AES_cbc_encrypt((unsigned char*)buf, packet, aeslen, &aes, iv, AES_DECRYPT);
memcpy(packet+aeslen, buf+aeslen, len-aeslen);

int outsize;

Expand Down
2 changes: 1 addition & 1 deletion shairport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1146,7 +1146,7 @@ void setKeys(struct keyring *pKeys, char *pIV, char* pAESKey, char *pFmtp)
"17fegFPMwOII8MisYm9ZfT2Z0s5Ro3s5rkt+nvLAdfC/PYPKzTLalpGSwomSNYJcB9HNMlmhkGzc\n" \
"1JnLYT4iyUyx6pcZBmCd8bD0iwY/FzcgNDaUmbX9+XDvRA0CgYEAkE7pIPlE71qvfJQgoA9em0gI\n" \
"LAuE4Pu13aKiJnfft7hIjbK+5kyb3TysZvoyDnb3HOKvInK7vXbKuU4ISgxB2bB3HcYzQMGsz1qJ\n" \
"2gG0N5hvJpzwwhbhXqFKA4zaaSrw622wDniAK5MlIE0tIAKKP4yxNGjoD2QYjhBGuhvkWKaXTyY=\n" \
"2gG0N5hvJpzwwhbhXqFKA4zaaSrw622wDniAK5MlIE0tIAKKP4yxNGjoD2QYjhBGuhvkWKY=\n" \
"-----END RSA PRIVATE KEY-----"

RSA *loadKey()
Expand Down
2 changes: 1 addition & 1 deletion shairport.pl
Original file line number Diff line number Diff line change
Expand Up @@ -730,5 +730,5 @@ sub conn_handle_request {
17fegFPMwOII8MisYm9ZfT2Z0s5Ro3s5rkt+nvLAdfC/PYPKzTLalpGSwomSNYJcB9HNMlmhkGzc
1JnLYT4iyUyx6pcZBmCd8bD0iwY/FzcgNDaUmbX9+XDvRA0CgYEAkE7pIPlE71qvfJQgoA9em0gI
LAuE4Pu13aKiJnfft7hIjbK+5kyb3TysZvoyDnb3HOKvInK7vXbKuU4ISgxB2bB3HcYzQMGsz1qJ
2gG0N5hvJpzwwhbhXqFKA4zaaSrw622wDniAK5MlIE0tIAKKP4yxNGjoD2QYjhBGuhvkWKaXTyY=
2gG0N5hvJpzwwhbhXqFKA4zaaSrw622wDniAK5MlIE0tIAKKP4yxNGjoD2QYjhBGuhvkWKY=
-----END RSA PRIVATE KEY-----

0 comments on commit 4172b69

Please sign in to comment.