Petri Hintukainen pushed to branch master at VideoLAN / libaacs


Commits:
1ac09798 by Petri Hintukainen at 2021-04-23T19:29:56+03:00
Simplify (use existing helper)

- - - - -
b9d3bfcd by Petri Hintukainen at 2021-04-23T22:07:22+03:00
CI: Fix macos

- - - - -


2 changed files:

- .gitlab-ci.yml
- src/libaacs/aacs.c


Changes:

=====================================
.gitlab-ci.yml
=====================================
@@ -23,8 +23,8 @@ build-macos:
         - catalina
         - amd64
     script:
-        - curl -sS -O 
https://artifacts.videolan.org/vlc/macos/vlc-contrib-x86_64-apple-darwin19-45c21cd73727ddcd1af843a34dc4ca8648cc872c.tar.bz2
-        - tar xf 
vlc-contrib-x86_64-apple-darwin19-45c21cd73727ddcd1af843a34dc4ca8648cc872c.tar.bz2
+        - curl -sS -O 
https://artifacts.videolan.org/vlc/macos-x86_64/vlc-contrib-x86_64-apple-darwin19-58c8b6aba888c666612e91d1cbb012aea630c853.tar.bz2
+        - tar xf 
vlc-contrib-x86_64-apple-darwin19-58c8b6aba888c666612e91d1cbb012aea630c853.tar.bz2
         - cd x86_64-apple-darwin19
         - curl -sS -o ./change_prefix.sh 
'https://git.videolan.org/?p=vlc.git;a=blob_plain;f=contrib/src/change_prefix.sh;hb=HEAD'
         - chmod +x ./change_prefix.sh


=====================================
src/libaacs/aacs.c
=====================================
@@ -105,7 +105,6 @@ static int _validate_pk(const uint8_t *pk,
                         const uint8_t *cvalue, const uint8_t *uv, const 
uint8_t *vd,
                         uint8_t *mk)
 {
-    gcry_cipher_hd_t gcry_h;
     int a;
     uint8_t dec_vd[16];
     char str[40];
@@ -116,17 +115,13 @@ static int _validate_pk(const uint8_t *pk,
     BD_DEBUG(DBG_AACS, "   cvalue: %s\n", str_print_hex(str, cvalue, 16));
     BD_DEBUG(DBG_AACS, "   Verification data: %s\n", str_print_hex(str, vd, 
16));
 
-    gcry_cipher_open(&gcry_h, GCRY_CIPHER_AES, GCRY_CIPHER_MODE_ECB, 0);
-    gcry_cipher_setkey(gcry_h, pk, 16);
-    gcry_cipher_decrypt(gcry_h, mk, 16, cvalue, 16);
+    crypto_aes128d(pk, cvalue, mk);
 
     for (a = 0; a < 4; a++) {
         mk[a + 12] ^= uv[a];
     }
 
-    gcry_cipher_setkey(gcry_h, mk, 16);
-    gcry_cipher_decrypt (gcry_h, dec_vd, 16, vd, 16);
-    gcry_cipher_close(gcry_h);
+    crypto_aes128d(mk, vd, dec_vd);
 
     if (!memcmp(dec_vd, "\x01\x23\x45\x67\x89\xAB\xCD\xEF", 8)) {
         BD_DEBUG(DBG_AACS, "Processing key %s is valid!\n", str_print_hex(str, 
pk, 16));



View it on GitLab: 
https://code.videolan.org/videolan/libaacs/-/compare/320dddd3637bb4743f9141c2199cf564e59835ec...b9d3bfcdf240b19a9fc6212dec7a9b6c50b5fb8d

-- 
View it on GitLab: 
https://code.videolan.org/videolan/libaacs/-/compare/320dddd3637bb4743f9141c2199cf564e59835ec...b9d3bfcdf240b19a9fc6212dec7a9b6c50b5fb8d
You're receiving this email because of your account on code.videolan.org.


_______________________________________________
libaacs-devel mailing list
libaacs-devel@videolan.org
https://mailman.videolan.org/listinfo/libaacs-devel

Reply via email to