Cryptography Reference
In-Depth Information
&proxy_user, &proxy_password ) )
{
fprintf( stderr, “Error - malformed proxy parameter '%s'.\n”, argv[ 2 ] );
return 2;
}
}
else if ( !strcmp( “-s”, argv[ ind ] ) )
{
session_id_length = hex_decode( argv[ ++ind ], &session_id );
}
else if ( !strcmp( “-m”, argv[ ind ] ) )
{
master_secret_length = hex_decode( argv[ ++ind ], &master_secret );
}
}
if ( ( ( master_secret_length > 0 ) && ( session_id_length == 0 ) ) ||
( ( master_secret_length == 0 ) && ( session_id_length > 0 ) ) )
{
fprintf( stderr, “session id and master secret must both be provided.\n” );
return 3;
}
if ( session_id != NULL )
{
if ( tls_resume( client_connection, session_id_length,
session_id, master_secret, &tls_context ) )
{
fprintf( stderr, “Error: unable to negotiate SSL connection.\n” );
if ( close( client_connection ) == -1 )
{
perror( “Error closing client connection” );
return 2;
}
return 3;
}
}
else
{
if ( tls_connect( client_connection, &tls_context ) )
{
if ( session_id != NULL )
{
free( session_id );
}
Search WWH ::




Custom Search