Changeset 775 in openpam


Ignore:
Timestamp:
Mar 9, 2014, 12:04:56 PM (7 years ago)
Author:
Dag-Erling Smørgrav
Message:

Additional tests (which also fail) for unexpected padding.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/t/t_rfc4648.c

    r773 r775  
    7474
    7575/* decoding failure */
    76 #define T_DECODE_FAIL_N(N, i, e)                                        \
     76#define T_DECODE_FAIL_N(N, e, i)                                        \
    7777        { "base"#N"_dec("#i")", base##N##_dec, i, sizeof i - 1,         \
    7878          NULL, 0, 0, -1, e }
    7979#define T_DECODE_FAIL(e, b32, b64)                                      \
    80         T_DECODE_FAIL_N(32, b32, e), T_DECODE_FAIL_N(64, b64, e)
     80        T_DECODE_FAIL_N(32, e, b32), T_DECODE_FAIL_N(64, e, b64)
    8181
    8282/* input string shorter than input length */
     
    139139
    140140        /* padding in incorrect location */
    141         T_DECODE_FAIL(EINVAL,   "A=",                   "A="),
     141        T_DECODE_FAIL_N(32, EINVAL, "A======="),
     142        T_DECODE_FAIL_N(32, EINVAL, "AAA====="),
     143        T_DECODE_FAIL_N(32, EINVAL, "AAAAAA=="),
     144        T_DECODE_FAIL_N(64, EINVAL, "A==="),
    142145
    143146        /* various error conditions */
Note: See TracChangeset for help on using the changeset viewer.