# HG changeset patch # User reimar # Date 1280928439 0 # Node ID 678884af8ade848743bcf145a6cb2ed620e4bc3d # Parent 22f2eb79536f7750b2e52ba899f12346b6edf5f0 Use the "key" type also for the IV constant. diff -r 22f2eb79536f -r 678884af8ade stream/stream_bd.c --- a/stream/stream_bd.c Wed Aug 04 12:38:52 2010 +0000 +++ b/stream/stream_bd.c Wed Aug 04 13:27:19 2010 +0000 @@ -36,11 +36,6 @@ static const char *DEFAULT_BD_DEVICE = "/mnt/bd"; -static const uint8_t BD_CBC_IV[] = { - 0x0b, 0xa0, 0xf8, 0xdd, 0xfe, 0xa6, 0x1f, 0xb3, - 0xd8, 0xdf, 0x9f, 0x56, 0x6a, 0x05, 0x0f, 0x78 -}; - static const struct stream_priv_s { int title; char *device; @@ -72,6 +67,13 @@ uint8_t u8[16]; } key; +static const key BD_CBC_IV = { + .u8 = { + 0x0b, 0xa0, 0xf8, 0xdd, 0xfe, 0xa6, 0x1f, 0xb3, + 0xd8, 0xdf, 0x9f, 0x56, 0x6a, 0x05, 0x0f, 0x78 + } +}; + struct uks { int count; key *keys; @@ -267,7 +269,7 @@ // reset aes context as at start of unit key enc_seed; int i; - memcpy(bd->iv.u8, BD_CBC_IV, sizeof(bd->iv.u8)); + bd->iv = BD_CBC_IV; // set up AES key from uk and seed av_aes_init(bd->aeseed, bd->uks.keys[0].u8, 128, 0);