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

« back to all changes in this revision

Viewing changes to ntpd/refclock_mx4200.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:
80
80
};
81
81
#endif /* ! HAVE_STRUCT_PPSCLOCKEV */
82
82
 
83
 
#ifdef HAVE_TIMEPPS_H
84
 
#   include <timepps.h>
85
 
#else
86
 
# ifdef HAVE_SYS_TIMEPPS_H
87
 
#   include <sys/timepps.h>
88
 
# endif
89
 
#endif
 
83
#ifdef HAVE_PPSAPI
 
84
# include "ppsapi_timepps.h"
 
85
#endif /* HAVE_PPSAPI */
90
86
 
91
87
/*
92
88
 * This driver supports the Magnavox Model MX 4200 GPS Receiver
1524
1520
        if (time_pps_fetch(up->pps_h, PPS_TSFMT_TSPEC, &(up->pps_i),
1525
1521
                        &timeout) < 0) {
1526
1522
                mx4200_debug(peer,
1527
 
                  "mx4200_pps: time_pps_fetch: serial=%d, %s\n",
1528
 
                     up->pps_i.assert_sequence, strerror(errno));
 
1523
                  "mx4200_pps: time_pps_fetch: serial=%ul, %s\n",
 
1524
                     (unsigned long)up->pps_i.assert_sequence, strerror(errno));
1529
1525
                refclock_report(peer, CEVNT_FAULT);
1530
1526
                return(1);
1531
1527
        }
1532
1528
        if (temp_serial == up->pps_i.assert_sequence) {
1533
1529
                mx4200_debug(peer,
1534
 
                   "mx4200_pps: assert_sequence serial not incrementing: %d\n",
1535
 
                        up->pps_i.assert_sequence);
 
1530
                   "mx4200_pps: assert_sequence serial not incrementing: %ul\n",
 
1531
                        (unsigned long)up->pps_i.assert_sequence);
1536
1532
                refclock_report(peer, CEVNT_FAULT);
1537
1533
                return(1);
1538
1534
        }
1544
1540
                if (up->pps_i.assert_sequence == up->lastserial) {
1545
1541
                        mx4200_debug(peer, "mx4200_pps: no new pps event\n");
1546
1542
                } else {
1547
 
                        mx4200_debug(peer, "mx4200_pps: missed %d pps events\n",
1548
 
                            up->pps_i.assert_sequence - up->lastserial - 1);
 
1543
                        mx4200_debug(peer, "mx4200_pps: missed %ul pps events\n",
 
1544
                            up->pps_i.assert_sequence - up->lastserial - 1UL);
1549
1545
                }
1550
1546
                refclock_report(peer, CEVNT_FAULT);
1551
1547
        }
1576
1572
     char *fmt;
1577
1573
#endif /* __STDC__ */
1578
1574
{
 
1575
#ifdef DEBUG
1579
1576
        va_list ap;
1580
1577
        struct refclockproc *pp;
1581
1578
        struct mx4200unit *up;
1600
1597
 
1601
1598
                va_end(ap);
1602
1599
        }
 
1600
#endif
1603
1601
}
1604
1602
 
1605
1603
/*