Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-57111

NSS 3.101 ABI break (NSSCMSKeyAgreeRecipientInfoStr.ukm / D204654)

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • rhel-10.0.beta
    • rhel-8.8.0.z, rhel-9.2.0.z, rhel-10.0.beta
    • nss
    • nss-3.101.0-7.el10
    • Yes
    • None
    • 1
    • rhel-sst-security-crypto
    • ssg_security
    • 29
    • 30
    • 3
    • False
    • Hide

      None

      Show
      None
    • No
    • Crypto24Q3
    • Approved Exception
    • Hide

      NSSCMSKeyAgreeRecipientInfoStr field sizes and offsets are the same as in the shipped 3.90 NSS

      Show
      NSSCMSKeyAgreeRecipientInfoStr field sizes and offsets are the same as in the shipped 3.90 NSS
    • Pass
    • None
    • Unspecified Release Note Type - Unknown
    • None

      There seems to be an ABI breakage between NSS 3.90 and NSS 3.101:

      Abridged description:

      NSSCMSKeyAgreeRecipientInfo's .ukm has changed types from SECItem* to SECItem;
      size change propagates to NSSCMSRecipientInfo, referenced by pointer in NSSCMSEnvelopedData.
      All of these structs are public.

      Detailed description:

      NSSCMSKeyAgreeRecipientInfoStr was defined as

      struct NSSCMSKeyAgreeRecipientInfoStr {
          SECItem version;
          NSSCMSOriginatorIdentifierOrKey originatorIdentifierOrKey;
          SECItem *ukm; /* optional */  // <- a pointer
          SECAlgorithmID keyEncAlg;
          NSSCMSRecipientEncryptedKey **recipientEncryptedKeys;
      };
      

      but https://phabricator.services.mozilla.com/D204654 changed it to

      struct NSSCMSKeyAgreeRecipientInfoStr {
          SECItem version;
          NSSCMSOriginatorIdentifierOrKey originatorIdentifierOrKey;
          SECItem ukm; /* optional */  // <- it's a value now, growing in size
          SECAlgorithmID keyEncAlg;
          NSSCMSRecipientEncryptedKey **recipientEncryptedKeys;
      };
      typedef struct NSSCMSKeyAgreeRecipientInfoStr NSSCMSKeyAgreeRecipientInfo;
      

      Not only this happens in a public header (nss3/cmst.h),
      now the grown NSSCMSKeyAgreeRecipientInfo is used inside a union inside a NSSCMSRecipientInfo

      struct NSSCMSRecipientInfoStr {  // <- changes size as well
          NSSCMSRecipientInfoIDSelector recipientInfoType;
          union {  // <- could've dampened the size change, but no, the growing member is the largest one
              NSSCMSKeyTransRecipientInfo keyTransRecipientInfo;
              NSSCMSKeyAgreeRecipientInfo keyAgreeRecipientInfo;  // <- here's the growing struct
              NSSCMSKEKRecipientInfo kekRecipientInfo;
              NSSCMSKeyTransRecipientInfoEx keyTransRecipientInfoEx;
          } ri;
          /* --------- local; not part of encoding --------- */
          NSSCMSMessage *cmsg;   /* back pointer to message */  // <- offset changes
          CERTCertificate *cert; /* recipient's certificate */  // <- offset changes
      };
      typedef struct NSSCMSRecipientInfoStr NSSCMSRecipientInfo;
      

      NSSCMSRecipientInfo, in turn, is accessible from NSSCMSEnvelopedData through a pointer:

      struct NSSCMSEnvelopedDataStr { ... NSSCMSRecipientInfo **recipientInfos;  ... };
      typedef struct NSSCMSEnvelopedDataStr NSSCMSEnvelopedData;
      

      and NSSCMSEnvelopedData is exposed in nss3/cms.h

              rrelyea@redhat.com Robert Relyea
              asosedki@redhat.com Alexander Sosedkin
              Robert Relyea Robert Relyea
              Alexander Sosedkin Alexander Sosedkin
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: