[vlc-devel] [PATCH 2/2] Add Apple AirTunes access output plugin

Rémi Denis-Courmont rdenis at simphalempin.com
Tue Dec 2 12:20:18 CET 2008


On Tue,  2 Dec 2008 01:06:01 +0100, Michael Hanselmann <public at hansmi.ch>
wrote:
> VLC uses libgcrypt for encryption. Unfortunately, libgcrypt doesn't
> support the OAEP standard as defined in RFC2437 and AirTunes demands
> OAEP padding for RSA encrypted data. OAEP has been reimplemented from
> scratch based on the specification for this plugin. Maybe these
> functions, MGF1 and AddOaepPadding, could be moved to libvlc at a
> later point.

To gcrypt rather than to libvlc.

(...)
> +    i_gcrypt_err = gcry_md_open( &md_handle, Hash, 0 );
> +    if ( CheckForGcryptError( p_access, i_gcrypt_err ) )
> +    {
> +        i_err = VLC_EGENERIC;
> +        goto error;
> +    }

You should not call gcry_md_close() if gcry_md_open() failed, I believe.
(...)
> +error:
> +    gcry_md_close( md_handle );
         ^^^^


> +error:
> +    gcry_sexp_release( sexp_rsa_params );
> +    gcry_sexp_release( sexp_input );
> +    gcry_sexp_release( sexp_encrypted );
> +    gcry_sexp_release( sexp_token_a );
> +    gcry_mpi_release( mpi_pubkey );
> +    gcry_mpi_release( mpi_exp );
> +    gcry_mpi_release( mpi_input );
> +    gcry_mpi_release( mpi_output );
> +
> +    return i_err;
> +}

I wonder if gcrypt allows releasing 'NULL'?

-- 
Rémi Denis-Courmont




More information about the vlc-devel mailing list