[Home]

Summary:ASTERISK-09963: main/utils.c:ast_random() sometimes returns negative values which is illegal in SIP session ID
Reporter:Yehavi Bourvine (yehavi)Labels:
Date Opened:2007-07-26 04:34:52Date Closed:2007-07-26 08:04:24
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:In recent version the above function has been changed to read from dev_random when it is available. This read sometimes returns negative values. One of the usages for this function is to generate SIP session ID. Some SIP devices reject negative sessions IDs.
Comments:By: Digium Subversion (svnbot) 2007-07-26 08:01:54

Repository: asterisk
Revision: 77267

------------------------------------------------------------------------
r77267 | tilghman | 2007-07-26 08:01:53 -0500 (Thu, 26 Jul 2007) | 2 lines

Things expecting a positive result from ast_random() should not be surprised (closes ASTERISK-9963)

------------------------------------------------------------------------

By: Digium Subversion (svnbot) 2007-07-26 08:03:22

Repository: asterisk
Revision: 77268

------------------------------------------------------------------------
r77268 | russell | 2007-07-26 08:03:22 -0500 (Thu, 26 Jul 2007) | 3 lines

Ensure that the read from /dev/urandom returns a positive result
(closes issue ASTERISK-9963, reported by yehavi, patched by me)

------------------------------------------------------------------------

By: Russell Bryant (russell) 2007-07-26 08:04:24

haha ...

However, they *should* be surprised, as random() is defined to return a positive result.