# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/minidisc-utils/hotfix-cbc-iv-boundary.patch # Copyright (C) 2025 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- Fix audible noise every ~47s, GH#39: NetMD SP Transfer results in audible 'pop' on packet boundary --- linux-minidisc/libnetmd/secure.c.vanilla 2025-02-22 18:33:21.819516328 +0100 +++ linux-minidisc/libnetmd/secure.c 2025-02-22 20:09:42.859406102 +0100 @@ -5,6 +5,7 @@ * * Copyright (C) 2004 Bertrik Sikken * Copyright (C) 2011 Alexander Sulfrian + * Copyright (C) 2015 René Rebe * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -485,7 +486,7 @@ gcry_cipher_setkey(data_handle, rand, sizeof(rand)); gcry_cipher_encrypt(data_handle, next->data, chunksize, data + position, packet_data_length); /* set last encrypted block as iv for the next packet */ - memcpy(iv, data + position + packet_data_length - 8, 8); + memcpy(iv, next->data + chunksize - 8, 8); /* next packet */ position = position + chunksize;