|
45 | 45 | #ifndef Expat_INCLUDED |
46 | 46 | # define Expat_INCLUDED 1 |
47 | 47 |
|
| 48 | +# include <stdint.h> // for uint8_t |
48 | 49 | # include <stdlib.h> |
49 | 50 | # include "expat_external.h" |
50 | 51 |
|
@@ -917,10 +918,21 @@ XML_SetParamEntityParsing(XML_Parser parser, |
917 | 918 | function behavior. This must be called before parsing is started. |
918 | 919 | Returns 1 if successful, 0 when called after parsing has started. |
919 | 920 | Note: If parser == NULL, the function will do nothing and return 0. |
| 921 | + DEPRECATED since Expat 2.8.0. |
920 | 922 | */ |
921 | 923 | XMLPARSEAPI(int) |
922 | 924 | XML_SetHashSalt(XML_Parser parser, unsigned long hash_salt); |
923 | 925 |
|
| 926 | +/* Sets the hash salt to use for internal hash calculations. |
| 927 | + Helps in preventing DoS attacks based on predicting hash function behavior. |
| 928 | + This must be called before parsing is started. |
| 929 | + Returns XML_TRUE if successful, XML_FALSE when called after parsing has |
| 930 | + started or when parser is NULL. |
| 931 | + Added in Expat 2.8.0. |
| 932 | +*/ |
| 933 | +XMLPARSEAPI(XML_Bool) |
| 934 | +XML_SetHashSalt16Bytes(XML_Parser parser, const uint8_t entropy[16]); |
| 935 | + |
924 | 936 | /* If XML_Parse or XML_ParseBuffer have returned XML_STATUS_ERROR, then |
925 | 937 | XML_GetErrorCode returns information about the error. |
926 | 938 | */ |
@@ -1081,8 +1093,8 @@ XML_SetReparseDeferralEnabled(XML_Parser parser, XML_Bool enabled); |
1081 | 1093 | See https://semver.org |
1082 | 1094 | */ |
1083 | 1095 | # define XML_MAJOR_VERSION 2 |
1084 | | -# define XML_MINOR_VERSION 7 |
1085 | | -# define XML_MICRO_VERSION 5 |
| 1096 | +# define XML_MINOR_VERSION 8 |
| 1097 | +# define XML_MICRO_VERSION 0 |
1086 | 1098 |
|
1087 | 1099 | # ifdef __cplusplus |
1088 | 1100 | } |
|
0 commit comments