~ubuntu-branches/debian/squeeze/ntp/squeeze-201010051545

« back to all changes in this revision

Viewing changes to ntpd/refclock_hpgps.c

  • Committer: Bazaar Package Importer
  • Author(s): Kurt Roeckx
  • Date: 2009-01-05 21:10:03 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090105211003-mh6zc3um4k1uhsj7
Tags: 1:4.2.4p4+dfsg-8
It did not properly check the return value of EVP_VerifyFinal
which results in an malformed DSA signature being treated as
a good signature rather than as an error.  (CVE-2009-0021)

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 * than 1 usec. The accuracy when operating in holdover is typically better
42
42
 * than 10 usec. per day.
43
43
 *
 
44
 * The same driver also handles the HP Z3801A which is available surplus
 
45
 * from the cell phone industry.  It's popular with hams.
 
46
 * It needs a different line setup: 19200 baud, 7 data bits, odd parity
 
47
 * That is selected by adding "mode 1" to the server line in ntp.conf
 
48
 * HP Z3801A code from Jeff Mock added by Hal Murray, Sep 2005
 
49
 *
 
50
 *
44
51
 * The receiver should be operated with factory default settings.
45
52
 * Initial driver operation: expects the receiver to be already locked
46
53
 * to GPS, configured and able to output timecode format 2 messages.
85
92
 */
86
93
#define DEVICE          "/dev/hpgps%d" /* device name and unit */
87
94
#define SPEED232        B9600   /* uart speed (9600 baud) */
 
95
#define SPEED232Z       B19200  /* uart speed (19200 baud) */
88
96
#define PRECISION       (-10)   /* precision assumed (about 1 ms) */
89
97
#define REFID           "GPS\0" /*  reference ID */
90
98
#define DESCRIPTION     "HP 58503A GPS Time and Frequency Reference Receiver" 
152
160
 
153
161
        /*
154
162
         * Open serial port. Use CLK line discipline, if available.
 
163
         * Default is HP 58503A, mode arg selects HP Z3801A
155
164
         */
156
165
        (void)sprintf(device, DEVICE, unit);
157
 
        if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
158
 
                return (0);
159
 
 
 
166
        /* mode parameter to server config line shares ttl slot */
 
167
        if ((peer->ttl == 1)) {
 
168
                if (!(fd = refclock_open(device, SPEED232Z,
 
169
                                LDISC_CLK | LDISC_7O1)))
 
170
                        return (0);
 
171
        } else {
 
172
                if (!(fd = refclock_open(device, SPEED232, LDISC_CLK)))
 
173
                        return (0);
 
174
        }
160
175
        /*
161
176
         * Allocate and initialize unit structure
162
177
         */