#include "private.h"#include <ccrtp/queuebase.h>#include <ccrtp/ioqueue.h>#include <cstdio>#include <cstring>Go to the source code of this file.
Namespaces | |
| namespace | ccMD5 |
| namespace | std |
Classes | |
| class | Digest |
| base class for hashing services. More... | |
| class | MD5Digest |
| md5 hash accumulation. More... | |
Defines | |
| #define | S11 7 |
| #define | S12 12 |
| #define | S13 17 |
| #define | S14 22 |
| #define | S21 5 |
| #define | S22 9 |
| #define | S23 14 |
| #define | S24 20 |
| #define | S31 4 |
| #define | S32 11 |
| #define | S33 16 |
| #define | S34 23 |
| #define | S41 6 |
| #define | S42 10 |
| #define | S43 15 |
| #define | S44 21 |
Functions | |
| static unsigned long | ccMD5::rotate_left (unsigned long x, unsigned long n) |
| static unsigned long | ccMD5::F (unsigned long x, unsigned long y, unsigned long z) |
| static unsigned long | ccMD5::G (unsigned long x, unsigned long y, unsigned long z) |
| static unsigned long | ccMD5::H (unsigned long x, unsigned long y, unsigned long z) |
| static unsigned long | ccMD5::md5I (unsigned long x, unsigned long y, unsigned long z) |
| static void | ccMD5::FF (unsigned long &a, unsigned long b, unsigned long c, unsigned long d, unsigned long x, unsigned long s, unsigned long ac) |
| static void | ccMD5::GG (unsigned long &a, unsigned long b, unsigned long c, unsigned long d, unsigned long x, unsigned long s, unsigned long ac) |
| static void | ccMD5::HH (unsigned long &a, unsigned long b, unsigned long c, unsigned long d, unsigned long x, unsigned long s, unsigned long ac) |
| static void | ccMD5::II (unsigned long &a, unsigned long b, unsigned long c, unsigned long d, unsigned long x, unsigned long s, unsigned long ac) |
| static uint32 | MD5BasedRandom32 () |
| uint32 | random32 () |
| uint16 | random16 () |
|
|
Definition at line 163 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 164 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 165 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 166 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 167 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 168 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 169 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 170 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 171 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 172 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 173 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 174 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 175 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 176 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 177 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 178 of file queue.cpp. Referenced by MD5Digest::update(). |
|
|
Definition at line 454 of file queue.cpp. References defaultApplication(), MD5Digest::getDigest(), MD5Digest::putDigest(), and SDESItemTypeCNAME. Referenced by random32(). 00455 { 00456 // This is the input to the MD5 algorithm. 00457 union { 00458 uint8 array[1]; 00459 struct { 00460 timeval time; 00461 void *address; 00462 uint8 cname[10]; 00463 } data; 00464 } message; 00465 00466 // the output from the MD5 algorithm will be put here. 00467 union { 00468 uint32 buf32[4]; 00469 uint8 buf8[16]; 00470 } digest; 00471 00472 gettimeofday(&(message.data.time),NULL); 00473 message.array[0] = 00474 static_cast<uint8>(message.data.time.tv_sec * 00475 message.data.time.tv_usec); 00476 00477 message.data.address = &message; 00478 memcpy(message.data.cname, 00479 defaultApplication().getSDESItem(SDESItemTypeCNAME).c_str(),10); 00480 00481 // compute MD5. 00482 ccMD5::MD5Digest md5; 00483 md5.putDigest(reinterpret_cast<unsigned char*>(message.array), 00484 sizeof(message)); 00485 md5.getDigest(reinterpret_cast<unsigned char*>(digest.buf8)); 00486 00487 // Get result as xor of the four 32-bit words from the MD5 algorithm. 00488 uint32 result = 0; 00489 for ( int i = 0; i < 4; i ++ ) 00490 result ^= digest.buf32[i]; 00491 return result; 00492 }
|
|
|
Definition at line 516 of file queue.cpp. References random32(). Referenced by OutgoingDataQueue::OutgoingDataQueue(). 00517 { 00518 uint32 r32 = random32(); 00519 uint16 r16 = r32 & (r32 >> 16); 00520 return r16; 00521 }
|
|
|
Definition at line 494 of file queue.cpp. References MD5BasedRandom32(). Referenced by OutgoingDataQueue::OutgoingDataQueue(), random16(), IncomingDataQueue::renewLocalSSRC(), and RTPQueueBase::RTPQueueBase(). 00495 { 00496 // If /dev/urandom fails, default to the MD5 based algorithm 00497 // given in the RTP specification. 00498 uint32 number; 00499 #ifndef WIN32 00500 bool success = true; 00501 int fd = open("/dev/urandom",O_RDONLY); 00502 if (fd == -1) { 00503 success = false; 00504 } else { 00505 if ( read(fd,&number,sizeof(number)) != sizeof(number) ) { 00506 success = false; 00507 } 00508 } 00509 close(fd); 00510 if ( !success ) 00511 #endif 00512 number = MD5BasedRandom32(); 00513 return number; 00514 }
|