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

« back to all changes in this revision

Viewing changes to ntpd/refclock_chu.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:
208
208
#define BAUD            300     /* modulation rate (bps) */
209
209
#define OFFSET          128     /* companded sample offset */
210
210
#define SIZE            256     /* decompanding table size */
211
 
#define MAXSIG          6000.   /* maximum signal level */
 
211
#define MAXAMP          6000.   /* maximum signal level */
212
212
#define MAXCLP          100     /* max clips above reference per s */
213
213
#define LIMIT           1000.   /* soft limiter threshold */
214
214
#define AGAIN           6.      /* baseband gain */
215
215
#define LAG             10      /* discriminator lag */
216
 
#define DEVICE_AUDIO    "/dev/chu_audio" /* device name */
 
216
#define DEVICE_AUDIO    "/dev/audio" /* device name */
217
217
#define DESCRIPTION     "CHU Audio/Modem Receiver" /* WRU */
218
218
#define AUDIO_BUFSIZ    240     /* audio buffer size (30 ms) */
219
219
#else
655
655
                sample = up->comp[~*dpt++ & 0xff];
656
656
 
657
657
                /*
658
 
                 * Clip noise spikes greater than MAXSIG. If no clips,
 
658
                 * Clip noise spikes greater than MAXAMP. If no clips,
659
659
                 * increase the gain a tad; if the clips are too high, 
660
660
                 * decrease a tad.
661
661
                 */
662
 
                if (sample > MAXSIG) {
663
 
                        sample = MAXSIG;
 
662
                if (sample > MAXAMP) {
 
663
                        sample = MAXAMP;
664
664
                        up->clipcnt++;
665
 
                } else if (sample < -MAXSIG) {
666
 
                        sample = -MAXSIG;
 
665
                } else if (sample < -MAXAMP) {
 
666
                        sample = -MAXAMP;
667
667
                        up->clipcnt++;
668
668
                }
669
669
                chu_rf(peer, sample);
1112
1112
                up->tstamp[up->ntstamp] = up->cstamp[i];
1113
1113
                L_SUB(&up->tstamp[up->ntstamp], &offset);
1114
1114
                L_ADD(&offset, &up->charstamp);
1115
 
                if (up->ntstamp < MAXSTAGE) 
 
1115
                if (up->ntstamp < MAXSTAGE - 1) 
1116
1116
                        up->ntstamp++;
1117
1117
        }
1118
1118
}
1216
1216
                        up->tstamp[up->ntstamp] = up->cstamp[i];
1217
1217
                        L_SUB(&up->tstamp[up->ntstamp], &offset);
1218
1218
                        L_ADD(&offset, &up->charstamp);
1219
 
                        if (up->ntstamp < MAXSTAGE) 
 
1219
                        if (up->ntstamp < MAXSTAGE - 1) 
1220
1220
                                up->ntstamp++;
1221
1221
                }
1222
1222
                while (temp > up->prevsec) {
1231
1231
        }
1232
1232
        i = -(2 * k);
1233
1233
        for (j = 0; j < nchar; j++) {
1234
 
                if (i < 0 || i > 19) {
 
1234
                if (i < 0 || i > 18) {
1235
1235
                        i += 2;
1236
1236
                        continue;
1237
1237
                }