Skip to content

Commit

Permalink
digest: add auts parameter parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea authored and bogdan-iancu committed Apr 18, 2024
1 parent 46355f3 commit 639a4f1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions parser/digest/digest_keys.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,6 @@
#define _opaq_ 0x7161706f /* "opaq" */
#define _algo_ 0x6f676c61 /* "algo" */
#define _rith_ 0x68746972 /* "rith" */
#define _auts_ 0x73747561 /* "auts" */

#endif /* DIGEST_KEYS_H */
1 change: 1 addition & 0 deletions parser/digest/digest_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ static inline int parse_digest_param(str* _s, dig_cred_t* _c)
case PAR_QOP: ptr = &_c->qop.qop_str; break;
case PAR_NC: ptr = &_c->nc; break;
case PAR_ALGORITHM: ptr = &_c->alg.alg_str; break;
case PAR_AUTS: ptr = &_c->auts; break;
case PAR_OTHER: ptr = &dummy; break;
default: ptr = &dummy; break;
}
Expand Down
1 change: 1 addition & 0 deletions parser/digest/digest_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ typedef struct dig_cred {
str opaque; /* Opaque data string */
struct qp qop; /* Quality Of Protection */
str nc; /* Nonce count parameter */
str auts; /* Auts parameter */
} dig_cred_t;


Expand Down
9 changes: 8 additions & 1 deletion parser/digest/param_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,14 +172,21 @@
goto other


#define auts_CASE \
*_type = PAR_AUTS;\
p += 4; \
goto end; \


#define FIRST_QUATERNIONS \
case _user_: user_CASE; \
case _real_: real_CASE; \
case _nonc_: nonc_CASE; \
case _resp_: resp_CASE; \
case _cnon_: cnon_CASE; \
case _opaq_: opaq_CASE; \
case _algo_: algo_CASE;
case _algo_: algo_CASE; \
case _auts_: auts_CASE;



Expand Down
1 change: 1 addition & 0 deletions parser/digest/param_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ typedef enum dig_par {
PAR_QOP, /* qop parameter */
PAR_NC, /* nonce-count parameter */
PAR_ALGORITHM, /* algorithm parameter */
PAR_AUTS, /* auts parameter */
PAR_OTHER /* unknown parameter */
} dig_par_t;

Expand Down

0 comments on commit 639a4f1

Please sign in to comment.