unsigned short socksport;
unsigned short port;
-#ifdef CRYPTO
+#define RTMP_SWF_HASHLEN 32
void *dh; // for encryption
void *rc4keyIn;
void *rc4keyOut;
uint32_t SWFSize;
- char SWFHash[32];
- char SWFVerificationResponse[42];
-#endif
+ char SWFHash[RTMP_SWF_HASHLEN];
+ char SWFVerificationResponse[RTMP_SWF_HASHLEN+10];
} RTMP_LNK;
/* state for read() wrapper */
int RTMP_Read(RTMP *r, char *buf, int size);
int RTMP_Write(RTMP *r, char *buf, int size);
-#ifdef CRYPTO
/* hashswf.c */
-#define HASHLEN 32
-
int RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash,
int age);
-#endif
#ifdef __cplusplus
};
#ifdef CRYPTO
int swfAge = 30; /* 30 days for SWF cache by default */
int swfVfy = 0;
- unsigned char hash[HASHLEN];
+ unsigned char hash[RTMP_SWF_HASHLEN];
#endif
char *flvFile = 0;
case 'w':
{
int res = hex2bin(optarg, &swfHash.av_val);
- if (res != HASHLEN)
+ if (res != RTMP_SWF_HASHLEN)
{
swfHash.av_val = NULL;
RTMP_Log(RTMP_LOGWARNING,
- "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", HASHLEN);
+ "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", RTMP_SWF_HASHLEN);
}
- swfHash.av_len = HASHLEN;
+ swfHash.av_len = RTMP_SWF_HASHLEN;
break;
}
case 'x':
if (RTMP_HashSWF(swfUrl.av_val, &swfSize, hash, swfAge) == 0)
{
swfHash.av_val = (char *)hash;
- swfHash.av_len = HASHLEN;
+ swfHash.av_len = RTMP_SWF_HASHLEN;
}
}
uint32_t dStopOffset;
#ifdef CRYPTO
- unsigned char hash[HASHLEN];
+ unsigned char hash[RTMP_SWF_HASHLEN];
#endif
} RTMP_REQUEST;
if (RTMP_HashSWF(req.swfUrl.av_val, &req.swfSize, req.hash, req.swfAge) == 0)
{
req.swfHash.av_val = (char *)req.hash;
- req.swfHash.av_len = HASHLEN;
+ req.swfHash.av_len = RTMP_SWF_HASHLEN;
}
#endif
}
case 'w':
{
int res = hex2bin(arg, &req->swfHash.av_val);
- if (!res || res != HASHLEN)
+ if (!res || res != RTMP_SWF_HASHLEN)
{
req->swfHash.av_val = NULL;
RTMP_Log(RTMP_LOGWARNING,
- "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", HASHLEN);
+ "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", RTMP_SWF_HASHLEN);
}
- req->swfHash.av_len = HASHLEN;
+ req->swfHash.av_len = RTMP_SWF_HASHLEN;
break;
}
case 'x':