From: Theodore Tso Date: Thu, 29 Sep 1994 19:29:34 +0000 (+0000) Subject: Added realm compare function X-Git-Tag: krb5-1.0-beta4.3~75 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=d12913aa23d9e1f0321b9cc1a9f7da4b706850b1;p=krb5.git Added realm compare function git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4377 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/krb5/ChangeLog b/src/include/krb5/ChangeLog index c24eb4065..cc7b695a3 100644 --- a/src/include/krb5/ChangeLog +++ b/src/include/krb5/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 29 15:07:30 1994 Theodore Y. Ts'o (tytso@dcl) + + * func_proto.h (krb5_realm_compare): Added prototype for functin + donated by OpenVision. (Compares two realms). + Wed Sep 21 18:10:55 1994 Theodore Y. Ts'o (tytso@dcl) * func_proto.h (krb5_check_transited_list): Added prototype for diff --git a/src/include/krb5/func-proto.h b/src/include/krb5/func-proto.h index f341a429d..faf9db40c 100644 --- a/src/include/krb5/func-proto.h +++ b/src/include/krb5/func-proto.h @@ -128,6 +128,9 @@ krb5_boolean krb5_address_compare int krb5_address_order PROTOTYPE((const krb5_address *, const krb5_address *)); +krb5_boolean krb5_realm_compare + PROTOTYPE((krb5_const_principal, + krb5_const_principal)); krb5_boolean krb5_principal_compare PROTOTYPE((krb5_const_principal, krb5_const_principal)); diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog index 665d800e2..720529402 100644 --- a/src/lib/krb5/krb/ChangeLog +++ b/src/lib/krb5/krb/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 29 15:10:42 1994 Theodore Y. Ts'o (tytso@dcl) + + * princ_comp.c (krb5_realm_compare): Added new function from + OpenVision. + Wed Sep 21 17:57:35 1994 Theodore Y. Ts'o (tytso@dcl) * rd_req_dec.c (krb5_rd_req_decoded): Added Changes from Cybersafe diff --git a/src/lib/krb5/krb/princ_comp.c b/src/lib/krb5/krb/princ_comp.c index 118bd769d..f1eedad14 100644 --- a/src/lib/krb5/krb/princ_comp.c +++ b/src/lib/krb5/krb/princ_comp.c @@ -29,6 +29,19 @@ #include #include +krb5_boolean +krb5_realm_compare(princ1, princ2) +krb5_const_principal princ1; +krb5_const_principal princ2; +{ + if (krb5_princ_realm(princ1)->length != krb5_princ_realm(princ2)->length || + memcmp (krb5_princ_realm(princ1)->data, krb5_princ_realm(princ2)->data, + krb5_princ_realm(princ2)->length)) + return FALSE; + + return TRUE; +} + krb5_boolean krb5_principal_compare(princ1, princ2) krb5_const_principal princ1; @@ -40,9 +53,7 @@ krb5_const_principal princ2; if (nelem != krb5_princ_size(princ2)) return FALSE; - if (krb5_princ_realm(princ1)->length != krb5_princ_realm(princ2)->length || - memcmp (krb5_princ_realm(princ1)->data, krb5_princ_realm(princ2)->data, - krb5_princ_realm(princ2)->length)) + if (! krb5_realm_compare(princ1, princ2)) return FALSE; for (i = 0; i < nelem; i++) {