Added routines to write authdata structures
authorKen Raeburn <raeburn@mit.edu>
Thu, 8 Nov 1990 13:47:50 +0000 (13:47 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 8 Nov 1990 13:47:50 +0000 (13:47 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1423 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/stdio/scc_write.c

index 901fec5719845146ca03bd5ce7fc92c84792c77a..e180437cc6defb0714e41210d72940aff950e009 100644 (file)
@@ -223,3 +223,39 @@ krb5_scc_store_flags(id, f)
 {
      return krb5_scc_write(id, (char *) f, sizeof(krb5_flags));
 }
+
+krb5_error_code
+krb5_scc_store_authdata(id, a)
+    krb5_ccache id;
+    krb5_authdata **a;
+{
+    krb5_error_code ret;
+    krb5_authdata **temp;
+    krb5_int32 i, length=0;
+
+    if (a != NULL) {
+        for (temp=a; *temp; temp++)
+            length++;
+    }
+
+    ret = krb5_scc_store_int32(id, &length);
+    CHECK(ret);
+    for (i=0; i<length; i++) {
+        ret = krb5_scc_store_authdatum (id, a[i]);
+        CHECK(ret);
+    }
+    return KRB5_OK;
+}
+
+krb5_error_code
+krb5_scc_store_authdatum (id, a)
+    krb5_ccache id;
+    krb5_authdata *a;
+{
+    krb5_error_code ret;
+    ret = krb5_scc_store_ui_2(id, &a->ad_type);
+    CHECK(ret);
+    ret = krb5_scc_store_int32(id, &a->length);
+    CHECK(ret);
+    return krb5_scc_write(id, a->contents, a->length);
+}