* krb5_decode_test.c (main): Add tests for decode_krb5_enc_data
authorTheodore Tso <tytso@mit.edu>
Wed, 8 Nov 1995 07:43:46 +0000 (07:43 +0000)
committerTheodore Tso <tytso@mit.edu>
Wed, 8 Nov 1995 07:43:46 +0000 (07:43 +0000)
and decode_krb5_pa_enc_ts.

* krb5_encode_test.c (main): Add tests for encode_krb5_enc_data
and encode_krb5_pa_enc_ts.

* ktest.c (ktest_make_sample_pa_enc_ts): New functions to test
{encode,decode}_krb5_pa_enc_ts().

* ktest_equal.c (ktest_equal_krb5_pa_enc_ts): New functions to test
{encode,decode}_krb5_pa_enc_ts().

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7052 dc483132-0cff-0310-8789-dd5450dbe970

src/tests/asn.1/ChangeLog
src/tests/asn.1/krb5_decode_test.c
src/tests/asn.1/krb5_encode_test.c
src/tests/asn.1/ktest.c
src/tests/asn.1/ktest.h
src/tests/asn.1/ktest_equal.c
src/tests/asn.1/ktest_equal.h

index 62f4e6151c93bd25acfab33f5fc8d2249ba3a1cb..837279e3b2aaf10afcec61b5336642f18a6841ec 100644 (file)
@@ -1,8 +1,22 @@
+Tue Oct 31 21:30:28 1995  Theodore Y. Ts'o  <tytso@dcl>
+
+       * krb5_decode_test.c (main): Add tests for
+               decode_krb5_enc_data and decode_krb5_pa_enc_ts.
+
+       * krb5_encode_test.c (main): Add tests for
+               encode_krb5_enc_data and encode_krb5_pa_enc_ts.
+
+       * ktest.c (ktest_make_sample_pa_enc_ts): New functions to
+               test {encode,decode}_krb5_pa_enc_ts().
+
+       * ktest_equal.c (ktest_equal_krb5_pa_enc_ts): New functions to test
+               {encode,decode}_krb5_pa_enc_ts().
+
 Sun Oct 15 10:51:22 1995    <tytso@rsts-11.mit.edu>
 
        * ktest.c (ktest_make_sample_alt_method,
-               ktest_make_sample_etype_info):  Fixed signed/unsinged
-               -Wall flame.
+               ktest_make_sample_etype_info): Fixed signed/unsinged -Wall
+               flame.
 
 Fri Sep 29 14:23:47 1995  Theodore Y. Ts'o  <tytso@dcl>
 
index f33b242d7fc6f6e876bdcc8550e739a8705da033..10b4b606e9cbb646dc1dd9c79f6550f0768d7a6b 100644 (file)
@@ -459,6 +459,21 @@ void main()
       ktest_destroy_etype_info(ref);
   }
 
+  /****************************************************************/
+  /* decode_pa_enc_ts */
+  {
+    setup(krb5_pa_enc_ts,"krb5_pa_enc_ts",ktest_make_sample_pa_enc_ts);
+    decode_run("pa_enc_ts","","30 1A A0 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A A1 05 02 03 01 E2 40",decode_krb5_pa_enc_ts,ktest_equal_krb5_pa_enc_ts);
+    ref.pausec = 0;
+    decode_run("pa_enc_ts (no usec)","","30 13 A0 11 18 0F 31 39 39 34 30 36 31 30 30 36 30 33 31 37 5A",decode_krb5_pa_enc_ts,ktest_equal_krb5_pa_enc_ts);
+  }
+  
+  /****************************************************************/
+  /* decode_enc_data */
+  {
+    setup(krb5_enc_data,"krb5_enc_data",ktest_make_sample_enc_data);
+    decode_run("enc_data","","30 23 A0 03 02 01 00 A1 03 02 01 05 A2 17 04 15 6B 72 62 41 53 4E 2E 31 20 74 65 73 74 20 6D 65 73 73 61 67 65",decode_krb5_enc_data,ktest_equal_enc_data);
+  }
   
   exit(error_count);
 }
index 9262a5742ac38d275e952bfe57423dd1ffb93470..ca18a8812239547655b1826a7715958b6284b35f 100644 (file)
@@ -496,6 +496,25 @@ void main(argc, argv)
 
     free(info);
   }
+
+  /****************************************************************/
+  /* encode_pa_enc_ts */
+  {
+    krb5_pa_enc_ts pa_enc;
+    setup(pa_enc,krb5_pa_enc_ts,"pa_enc_ts",ktest_make_sample_pa_enc_ts);
+    encode_run(pa_enc,krb5_pa_enc_ts,"pa_enc_ts","",encode_krb5_pa_enc_ts);
+    pa_enc.pausec = 0;
+    encode_run(pa_enc,krb5_pa_enc_ts,"pa_enc_ts (no usec)","",encode_krb5_pa_enc_ts);
+  }
+
+  /****************************************************************/
+  /* encode_enc_data */
+  {
+    krb5_enc_data enc_data;
+    setup(enc_data,krb5_enc_data,"enc_data",ktest_make_sample_enc_data);
+    encode_run(enc_data,krb5_enc_data,"enc_data","",encode_krb5_enc_data);
+  }
+
   exit(error_count);
 }
 
index 666d0d35a3e9582d6ad7e37e1f5b3433ca112d1e..a995d1d99154e4328f4e42f1cfd2fb5c31ae51a6 100644 (file)
@@ -689,6 +689,15 @@ memfail:
     return ENOMEM;
 }
 
+krb5_error_code ktest_make_sample_pa_enc_ts(pa_enc)
+     krb5_pa_enc_ts * pa_enc;
+{
+  pa_enc->patimestamp = SAMPLE_TIME;
+  pa_enc->pausec = SAMPLE_USEC;
+
+  return 0;
+}
+
 /****************************************************************/
 /* destructors */
 
index 59c07ccfb1bfe16a4cbe9d960743b499b0e7990c..87ba0db628e43bd0b3dea8ac3d2f9f85aff3058f 100644 (file)
@@ -89,6 +89,8 @@ krb5_error_code ktest_make_sample_alt_method
 
 krb5_error_code ktest_make_sample_etype_info
     KRB5_PROTOTYPE((krb5_etype_info_entry *** p));
+krb5_error_code ktest_make_sample_pa_enc_ts
+       KRB5_PROTOTYPE((krb5_pa_enc_ts *am));
 
 /*----------------------------------------------------------------------*/
 
index 25e139f1acdc9601ccd6bab6a1b47f8f2f6f0823..d6bf622017c9178a224c65eadac39fb51b423ce1 100644 (file)
@@ -491,6 +491,18 @@ int ktest_equal_krb5_etype_info_entry(ref, var)
     return TRUE;
 }
 
+int ktest_equal_krb5_pa_enc_ts(ref, var)
+    krb5_pa_enc_ts *ref;
+    krb5_pa_enc_ts *var;
+{
+  int p=TRUE;
+  if(ref==var) return TRUE;
+  else if(ref == NULL || var == NULL) return FALSE;
+  p=p&&scalar_equal(patimestamp);
+  p=p&&scalar_equal(pausec);
+  return p;
+}
+
 /**** arrays ****************************************************************/
 
 int ktest_equal_array_of_data(length, ref, var)
index 375cc546df896abefcdceea9ca5d46dfe04fb943..9f9d5cb90355a827388ee8b293e2c8b1c5d50287 100644 (file)
@@ -53,6 +53,7 @@ generic(ktest_equal_encryption_key,krb5_keyblock);
 generic(ktest_equal_passwd_phrase_element,passwd_phrase_element);
 generic(ktest_equal_krb5_pwd_data,krb5_pwd_data);
 generic(ktest_equal_krb5_alt_method,krb5_alt_method);
+generic(ktest_equal_krb5_pa_enc_ts,krb5_pa_enc_ts);
 
 int ktest_equal_last_req
        KRB5_PROTOTYPE((krb5_last_req_entry **ref, krb5_last_req_entry **var));