HomeFreeBSD

heimdal: asn1: Use unsigned bitfields for named bitsets

Description

heimdal: asn1: Use unsigned bitfields for named bitsets

Import upstream 6747e1628:

asn1: Use unsigned bitfields for named bitsets

Signed 1-bit bitfields are undefined in C.

This should fix the following warnings, which for unknown reasons are
errors in CI:

/usr/src/crypto/heimdal/lib/hx509/ca.c:1020:22: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
 1020 |         ku.digitalSignature = 1;
      |                             ^ ~
/usr/src/crypto/heimdal/lib/hx509/ca.c:1021:21: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
 1021 |         ku.keyEncipherment = 1;
      |                            ^ ~
/usr/src/crypto/heimdal/lib/hx509/ca.c:1028:17: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
 1028 |         ku.keyCertSign = 1;
      |                        ^ ~
/usr/src/crypto/heimdal/lib/hx509/ca.c:1029:13: warning: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Wsingle-bit-bitfield-constant-conversion]
 1029 |         ku.cRLSign = 1;
      |                    ^ ~

PR: 276960
Fixes: 1b7487592987
MFC after: 1 week

Details

Provenance
dimAuthored on Apr 17 2024, 5:49 PM
Parents
rG1b7487592987: heimdal: Add 64-bit integer support to ASN.1 compiler
Branches
Unknown
Tags
Unknown