Skip to content

Comment on Schneier on Security: Software Problems with a Breath Alcohol Detectorparent

Comments

> The exponentially weighted mean ... may be what was intended, or maybe not

I can't think of any reason this would be intended. Proper method would be computing the mean and variance, to check if the sensor is behaving erratically.

While turning off the watchdog isn't a bona fide error, it definitely shows a lack of robustness in checking design assumptions.

> Just because the A/D reads 12 bits doesn't mean you have 12 bits of data

If 8 LSBs are junk, I'd say the analog system was also negligently designed.

There are some nice things about the filter in question. It's very memory efficient--you just need to keep an accumulator with the weighted sum of samples. You get an output with each input sample, so it's a good fit for continuous signals. You can pick the coefficients so that the math is shift and add, something handy with old and slow CPUs.

I don't know why they throw away so much of the ADC resolution. I suspect that the sensors are the weak link, not the analog conditioning circuitry or the ADC. Still, 4 bits is a pretty crummy sensor.

I see some irony in that if they'd written it in assembly language instead of C, the outside analysis probably wouldn't have found nearly as many of the bugs and other issues to complain about.

A simple digital low pass filter certainly has uses, I just don't think any of them are applicable here. Averaging several values per reading certainly wouldn't tax the resources of even the smallest micros.

I was including the sensor in the 'analog system'. If full range is 0.2% BAC (optimistic), thats a step of over 0.01%! I'd expect more from a sensor that's supposed to perform "beyond a reasonable doubt".

I don't know if ASM would have really hindered analysis. Certainly it's easier to deliberately hide malicious code with ASM, but naive code is generally readable and I doubt the audit firm would have given up. Chances are an ASM programmer would have paid better attention to detail, too ;).

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.