1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

13 Commits

Author SHA1 Message Date
Joseph Sutton
a6c442acea third_party/heimdal_build: Remove semicolons
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-30 02:15:29 +00:00
Joseph Sutton
dfe25969f3 third_party/heimdal_build: Remove unused imports
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-08-30 02:15:29 +00:00
Łukasz Stelmach
bb46379845 Configure builtin heimdal to use KEYRING ccache
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2023-06-06 08:35:36 +00:00
Joseph Sutton
c0a2e8db67 third_party/heimdal_build: Remove MD2
This is to adapt to Heimdal:

commit 3a5e91eca26284661fd2294dfc485305e5d5cc3d
Author: Nicolas Williams <nico@twosigma.com>
Date:   Tue Oct 25 22:20:45 2022 -0500

    hcrypto: Remove MD2 with prejudice

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-03-31 01:48:30 +00:00
Joseph Sutton
ec456766d5 CVE-2022-3437 third_party/heimdal_build: Add gssapi-subsystem subsystem
This allows us to access (and so test) functions internal to GSSAPI by
depending on this subsystem.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15134

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-10-25 10:31:33 +00:00
Samuel Cabrero
971441ca52 third_party/heimdal: Fix build with gcc version 12.1
Split lib/krb5/crypto to its own subsystem to built with its own CFLAGS
and avoid the following error:

    [1510/4771] Compiling third_party/heimdal/lib/krb5/crypto.c
    ../../third_party/heimdal/lib/krb5/crypto.c: In function ‘_krb5_internal_hmac’:
    ../../third_party/heimdal/lib/krb5/crypto.c:302:24: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
      302 |     iov[0].data.data = (void *) data;
          |                        ^
    ../../third_party/heimdal/lib/krb5/crypto.c: In function ‘derive_key_sp800_hmac’:
    ../../third_party/heimdal/lib/krb5/crypto.c:2427:18: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
     2427 |     label.data = (void *)constant;
          |                  ^
    ../../third_party/heimdal/lib/krb5/crypto.c: In function ‘decrypt_internal_derived’:
    ../../third_party/heimdal/lib/krb5/crypto.c:1280:9: error: pointer ‘p’ may be used after ‘realloc’ [-Werror=use-after-free]
     1280 |         free(p);
          |         ^~~~~~~
    ../../third_party/heimdal/lib/krb5/crypto.c:1278:20: note: call to ‘realloc’ here
     1278 |     result->data = realloc(p, l);
          |                    ^~~~~~~~~~~~~
    ../../third_party/heimdal/lib/krb5/crypto.c: In function ‘decrypt_internal_enc_then_cksum’:
    ../../third_party/heimdal/lib/krb5/crypto.c:1365:9: error: pointer ‘p’ may be used after ‘realloc’ [-Werror=use-after-free]
     1365 |         free(p);
          |         ^~~~~~~
    ../../third_party/heimdal/lib/krb5/crypto.c:1363:20: note: call to ‘realloc’ here
     1363 |     result->data = realloc(p, l);
          |                    ^~~~~~~~~~~~~
    ../../third_party/heimdal/lib/krb5/crypto.c: In function ‘decrypt_internal’:
    ../../third_party/heimdal/lib/krb5/crypto.c:1431:9: error: pointer ‘p’ may be used after ‘realloc’ [-Werror=use-after-free]
     1431 |         free(p);
          |         ^~~~~~~
    ../../third_party/heimdal/lib/krb5/crypto.c:1429:20: note: call to ‘realloc’ here
     1429 |     result->data = realloc(p, l);
          |                    ^~~~~~~~~~~~~
    ../../third_party/heimdal/lib/krb5/crypto.c: In function ‘decrypt_internal_special’:
    ../../third_party/heimdal/lib/krb5/crypto.c:1478:9: error: pointer ‘p’ may be used after ‘realloc’ [-Werror=use-after-free]
     1478 |         free(p);
          |         ^~~~~~~
    ../../third_party/heimdal/lib/krb5/crypto.c:1476:20: note: call to ‘realloc’ here
     1476 |     result->data = realloc(p, sz);
          |                    ^~~~~~~~~~~~~~
    cc1: all warnings being treated as errors

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15095

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Samuel Cabrero <scabrero@samba.org>
Autobuild-Date(master): Tue Jun 14 10:16:18 UTC 2022 on sn-devel-184
2022-06-14 10:16:18 +00:00
Joseph Sutton
94d387abd5 s4:kdc: Adapt to hdb_entry_ex removal
Rather than having a 'free_entry' member that can be called to free an
hdb_entry, we now implement the free function in HDB. We perform the
free only if the context pointer is non-NULL.

We also remove the ZERO_STRUCTP() in sdb_entry_to_hdb_entry(), as the
context pointer is now part of the 'hdb_entry' structure itself, and
this would undesirably zero it out.

This is an adaptation to Heimdal commits:

commit c5551775e204d00c7ee8055ab6ddbba7e0590584
Author: Luke Howard <lukeh@padl.com>
Date:   Fri Jan 7 12:15:55 2022 +1100

    hdb: decorate HDB_entry with context member

    Decorate HDB_entry with context and move free_entry callback into HDB structure
    itself. Requires updating hdb_free_entry() signature to include HDB parameter.
    A follow-up commit will consolidate hdb_entry_ex (which has a single hdb_entry
    member) into hdb_entry.

commit 0e8c4ccc6ee0123ea39e53e8917fc3f6bb74e8c8
Author: Luke Howard <lukeh@padl.com>
Date:   Fri Jan 7 12:54:40 2022 +1100

    hdb: eliminate hdb_entry_ex

    Remove hdb_entry_ex and revert to the original design of hdb_entry (except with
    an additional context member in hdb_entry which is managed by the free_entry
    method in HDB).

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-01 22:34:35 +00:00
Joseph Sutton
7cb68fdba7 third_party/heimdal_build: Don't generate .x source files
This is an adaptation to Heimdal:

commit 9427796f1a65906f12768b28abdb5a928222f3c6
Author: Jeffrey Altman <jaltman@secure-endpoints.com>
Date:   Wed Jan 5 15:45:23 2022 -0500

    Generate .x source files as .c source files

    The generated .x source and .hx header files are plain C source files.
    Generate them as .c source files and avoid unnecessary file copying
    and special makefile rules.

    Change-Id: Ifc4bbe3c46dd357fdd642040ad964c7cfe1d395c

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-01 22:34:35 +00:00
Joseph Sutton
b9f4ea8bdb third_party/heimdal_build: Add SFU source file
This is an adaptation to Heimdal:

commit 0287558838de79313e38026d2f0905ffc987d0b8
Author: Luke Howard <lukeh@padl.com>
Date:   Fri Dec 24 13:49:55 2021 +1100

    kdc: move Services for User implementation out of krb5tgs.c

    Move the Services for User (SFU/S4U) implementation -- protocol transition and
    constrained delegation -- into its own compilation unit, with an interface that
    only takes an astgs_request_t, so it can be easily factored out into a plugin
    module in the future.

    This refactoring is also careful to update all client names in the request
    structure after the SFU/S4U validation has successfully completed.

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-01 22:34:35 +00:00
Joseph Sutton
83586e8f58 s4:kdc: Rename windc to kdc plugin
This is an adaptation to Heimdal:

commit fcff5933ade652343d7c169659da92fac0e6e0d4
Author: Luke Howard <lukeh@padl.com>
Date:   Mon Jan 3 11:10:18 2022 +1100

    kdc: rename windc to kdc plugin

    Rename the "windc" plugin API to the more general "kdc" plugin API, for two
    reasons: the Heimdal KDC uses the Windows PAC even when not emulating a domain
    controller, and the plugin API has accreted methods that are not specific to
    emulating a domain controller (such as referral_policy and finalize_reply).

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-01 22:34:34 +00:00
Joseph Sutton
f2ca9c5db7 third_party/heimdal_build: Add source files to build
This is an adaptation to Heimdal:

commit be708ca3cf98900c61919f8ff7ced4428b5d1f32
Author: Nicolas Williams <nico@twosigma.com>
Date:   Wed Dec 22 17:01:12 2021 -0600

    gsskrb5: Add simple name attributes support

    This adds Kerberos mechanism support for:

     - composite principal name export/import
     - getting rudimentary name attributes from GSS names using
       gss_get_name_attribute():
        - all (raw) authorization data from the Ticket
        - all (raw) authorization data from the Authenticator
        - transit path
        - realm
        - component count
        - each component
     - gss_inquire_name()
     - gss_display_name_ext() (just for the hostbased service name type
                               though)

    The test exercises almost all of the functionality, except for:

     - getting the PAC
     - getting authz-data from the Authenticator
     - getting the transit path

    TBD (much) later:

     - amend test_context to do minimal name attribute checks as well
     - gss_set_name_attribute() (to request authz-data)
     - gss_delete_name_attribute()
     - getting specific authorization data elements via URN fragments (as
       opposed to all of them)
     - parsing the PAC, extracting SIDs (each one as a separate value)
     - some configurable local policy (?)
     - plugin interface for additional local policy

NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN!

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-03-01 22:34:34 +00:00
Joseph Sutton
6d8fec7006 third_party/heimdal_build: Add KDC_LIB macro definitions
This is an adaptation to Heimdal:

commit 7bb00a40eabbed2bc1c268f5244bfb9736d9bebe
Author: Luke Howard <lukeh@padl.com>
Date:   Tue Jan 4 13:08:35 2022 +1100

    kdc: fix Windows build

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-03-01 17:11:35 +00:00
Stefan Metzmacher
7055827b8f HEIMDAL: move code from source4/heimdal* to third_party/heimdal*
This makes it clearer that we always want to do heimdal changes
via the lorikeet-heimdal repository.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>

Autobuild-User(master): Joseph Sutton <jsutton@samba.org>
Autobuild-Date(master): Wed Jan 19 21:41:59 UTC 2022 on sn-devel-184
2022-01-19 21:41:59 +00:00