diff options
author | Nathaniel McCallum <npmccallum@redhat.com> | 2015-05-01 22:52:47 -0400 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2015-08-26 10:32:29 -0400 |
commit | 312b3bc29a0c52a0a82055f566241964532c2128 (patch) | |
tree | 8e0cab7f29166390aa69f88a399d4a9ceb773f16 /src/tests/asn.1/krb5_decode_test.c | |
parent | c8e9758db1d8a536a1404187b5911a96f7cdbea3 (diff) | |
download | krb5-312b3bc29a0c52a0a82055f566241964532c2128.zip krb5-312b3bc29a0c52a0a82055f566241964532c2128.tar.gz krb5-312b3bc29a0c52a0a82055f566241964532c2128.tar.bz2 |
Add ASN.1 encoder and decoder for secure cookie
Add an internal type declaration, ASN.1 encoder and decoder functions,
an internal free function, and ASN.1 tests for krb5_secure_cookie.
The reference DER encoding was constructed by hand.
To save on space, we don't use context tags, and use an integer rather
than a KerberosTime for the timestamp. The timestamp is stored in a
time_t; this requires a bugfix to the 64-bit case in
asn1_encode.c:store_int().
[ghudson@mit.edu: reference encoding; decode test; minor adustments to
free functions; added comments; alterations for space savings; commit
message]
Diffstat (limited to 'src/tests/asn.1/krb5_decode_test.c')
-rw-r--r-- | src/tests/asn.1/krb5_decode_test.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/tests/asn.1/krb5_decode_test.c b/src/tests/asn.1/krb5_decode_test.c index 1a99b0e..e017739 100644 --- a/src/tests/asn.1/krb5_decode_test.c +++ b/src/tests/asn.1/krb5_decode_test.c @@ -1098,6 +1098,14 @@ int main(argc, argv) ktest_empty_cammac(&ref); } + /****************************************************************/ + /* decode_krb5_secure_cookie */ + { + setup(krb5_secure_cookie,ktest_make_sample_secure_cookie); + decode_run("secure_cookie","","30 2C 02 04 2D F8 02 25 30 24 30 10 A1 03 02 01 0D A2 09 04 07 70 61 2D 64 61 74 61 30 10 A1 03 02 01 0D A2 09 04 07 70 61 2D 64 61 74 61",decode_krb5_secure_cookie,ktest_equal_secure_cookie,k5_free_secure_cookie); + ktest_empty_secure_cookie(&ref); + } + #ifndef DISABLE_PKINIT /****************************************************************/ |