This repository was archived by the owner on Jan 6, 2023. It is now read-only.
Commit b0426e6
Sergey Popovich
update: Compare computed vs expected sha256 digit string ignoring case
We produce sha256 digest string using %x snprintf()
qualifier for each byte of digest which uses alphabetic
characters from "a" to "f" in lower case to represent
integer values from 10 to 15.
Previously all of the NVD META files supply sha256
digest string for corresponding XML file in lower case.
However due to some reason this changed recently to
provide digest digits in upper case causing fetched
data consistency checks to fail. This prevents database
from being updated periodically.
While commit c4f6e94 (update: Do not treat sha256 failure
as fatal if requested) adds useful option to skip
digest validation at all and thus provides workaround for
this situation, it might be unacceptable for some
deployments where we need to ensure that downloaded
data is consistent before start parsing it and update
SQLite database.
Use strcasecmp() to compare two digest strings case
insensitively and addressing this case.
Signed-off-by: Sergey Popovich <[email protected]>1 parent c4f6e94 commit b0426e6
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
0 commit comments