beautifications

This commit is contained in:
van Hauser 2015-05-07 14:14:19 +02:00
parent e6b376293c
commit 2246030c21

View file

@ -67,6 +67,7 @@ void create_core_packet(int control,char* ip, int port){
char buffer[500];
char *target = hydra_address2string(ip);
if (control == 0) {
if (strlen(packet) <= 0) {
sprintf(packet, "DESCRIBE rtsp://%.260s:%i RTSP/1.0\r\nCSeq: 2\r\n\r\n", target, port);
@ -77,8 +78,7 @@ void create_core_packet(int control,char* ip, int port){
}
}
}
int start_rtsp(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp)
{
int start_rtsp(int s, char *ip, int port, unsigned char options, char *miscptr, FILE * fp) {
char *empty = "";
char *login, *pass, buffer[500], buffer2[500];
@ -129,11 +129,12 @@ int start_rtsp(int s, char *ip, int port, unsigned char options, char *miscptr,
char aux[500] = "";
char *pbuffer = hydra_strcasestr(lresp, "WWW-Authenticate: Digest ");
strncpy(aux, pbuffer + strlen("WWW-Authenticate: Digest "), sizeof(buffer));
aux[sizeof(aux) - 1] = '\0';
#ifdef LIBOPENSSL
sasl_digest_md5(dbuf, login, pass, aux, miscptr, "rtsp", hydra_address2string(ip), port, "");
#endif
#else
printf("[ERROR] Digest auth required but compiled without OpenSSL/MD5 support\n");
return 3;
#endif
@ -239,4 +240,3 @@ int service_rtsp_init(char *ip, int sp, unsigned char options, char *miscptr, FI
// -1 error, hydra will exit, so print a good error message here
return 0;
}