01.07.2016 Views

SEI CERT C Coding Standard

tqcylJ

tqcylJ

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Miscellaneous (MSC) - MSC32-C. Properly seed pseudorandom number generators<br />

}<br />

}<br />

The output is as follows:<br />

1st run: -1597837311, 906130682, -1308031886, 1048837407, -<br />

931041900, -658114613, -1709220953, -1019697289,<br />

1802206541,406505841,<br />

2nd run: 885904119, -687379556, -1782296854, 1443701916, -<br />

624291047, 2049692692, -990451563, -142307804,<br />

1257079211,897185104,<br />

3rd run: 190598304, -1537409464, 1594174739, -424401916, -<br />

1975153474, 826912927, 1705549595, -1515331215,<br />

474951399, 1982500583,<br />

15.2.4 Risk Assessment<br />

Rule Severity Likelihood Remediation Cost Priority Level<br />

MSC32-C Medium Likely Low P18 L1<br />

15.2.5 Related Guidelines<br />

<strong>CERT</strong> C Secure <strong>Coding</strong> <strong>Standard</strong><br />

<strong>SEI</strong> <strong>CERT</strong> C++ <strong>Coding</strong> <strong>Standard</strong><br />

MITRE CWE<br />

MSC30-C. Do not use the rand() function for<br />

generating pseudorandom numbers<br />

MSC51-CPP. Ensure your random number<br />

generator is properly seeded<br />

CWE-327, Use of a Broken or Risky Cryptographic<br />

Algorithm<br />

CWE-330, Use of Insufficiently Random Values<br />

CWE-331, Insufficient Entropy<br />

CWE-338, Use of Cryptographically Weak<br />

Pseudo-Random Number Generator (PRNG)<br />

15.2.6 Bibliography<br />

[MSDN]<br />

“CryptGenRandom Function“<br />

<strong>SEI</strong> <strong>CERT</strong> C <strong>Coding</strong> <strong>Standard</strong>: Rules for Developing Safe, Reliable, and Secure Systems 462<br />

Software Engineering Institute | Carnegie Mellon University<br />

[DISTRIBUTION STATEMENT A] Approved for public release and unlimited distribution.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!