Skip to content

ASN.1 OIDs and sum: Change algorithm for sum #8655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SparkiDev
Copy link
Contributor

@SparkiDev SparkiDev commented Apr 10, 2025

Description

New sum algorithm has no clashes at this time.
Old algorithm enabled by defining: WOLFSSL_OLD_OID_SUM.
New oid_sum.h file generated with scripts/asn1_oid_sum.pl.

Added bunch of OID names into asn1 example.

Testing

./configure '--disable-shared' '--enable-all' '--enable-opensslall'
./configure '--disable-shared' '--enable-all' '--enable-opensslall' --enable-asn=original

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@SparkiDev SparkiDev self-assigned this Apr 10, 2025
@SparkiDev SparkiDev force-pushed the asn1_oid_update branch 9 times, most recently from 225fe37 to 1ad5748 Compare April 10, 2025 09:07
@SparkiDev SparkiDev force-pushed the asn1_oid_update branch 5 times, most recently from 4b469ed to c377b7e Compare May 2, 2025 00:50
@SparkiDev
Copy link
Contributor Author

retest this please

@SparkiDev SparkiDev assigned wolfSSL-Bot and unassigned SparkiDev May 5, 2025
@SparkiDev SparkiDev requested a review from wolfSSL-Bot May 5, 2025 01:22
@dgarske dgarske requested a review from Copilot May 5, 2025 19:45
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new algorithm for calculating OID sums and cleans up several related declarations and test expectations. Key changes include:

  • Replacing the legacy OID sum algorithm with a new bitwise‐based approach in wc_oid_sum.
  • Removing deprecated enums and updating related test and API code to use new macros and callbacks.
  • Integrating an OID name callback in the ASN.1 example code and updating ancillary tooling (e.g. the Ruby generator and codespell config).

Reviewed Changes

Copilot reviewed 18 out of 21 changed files in this pull request and generated no comments.

Show a summary per file
File Description
wolfssl/wolfcrypt/types.h Added include for the new oid_sum header
wolfssl/wolfcrypt/settings.h Modified WOLFSSL_PYTHON section to force the old algorithm via macro redefine
wolfssl/wolfcrypt/pkcs7.h Removed deprecated PKCS#7 types enum
wolfssl/wolfcrypt/asn_public.h Removed obsolete OID-related enums and added the OID callback typedef
wolfcrypt/test/test.c Updated test expectations to use macro (SUBJ_KEY_OID) rather than magic number
wolfcrypt/src/pkcs12.c Removed unused PKCS12 enumeration values
wolfcrypt/src/hash.c Removed obsolete hash sum enum
wolfcrypt/src/asn.c Revised wc_oid_sum implementation and added OID callback support
tests/api.c Updated expected value for X509 extension object
src/ssl.c Replaced manual summation with wc_oid_sum, and updated object info array entries
examples/asn1/gen_oid_names.rb Added Ruby script for generating OID name definitions
examples/asn1/asn1.c Integrated OID name callback and file format detection improvements
.github/workflows/codespell.yml Updated ignore and skip lists
Files not reviewed (3)
  • examples/asn1/include.am: Language not supported
  • scripts/include.am: Language not supported
  • wolfssl/wolfcrypt/include.am: Language not supported

Copy link
Contributor

@dgarske dgarske left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please rebase to resolve the libssh test issue.
  2. Please add CI tests in os-check.yml config matrix:
'--enable-all --enable-asn=template CPPFLAGS=-DWOLFSSL_OLD_OID_SUM',
'--enable-all --enable-asn=original CPPFLAGS=-DWOLFSSL_OLD_OID_SUM',

@dgarske dgarske removed the request for review from wolfSSL-Bot May 6, 2025 18:18
New sum algorithm has no clashes at this time.
Old algorithm enabled by defining: WOLFSSL_OLD_OID_SUM.
New oid_sum.h file generated with scripts/asn1_oid_sum.pl.

Added bunch of OID names into asn1 example.
@dgarske dgarske assigned dgarske and unassigned SparkiDev May 6, 2025
@dgarske
Copy link
Contributor

dgarske commented May 6, 2025

Retest this please:

Cloning into 'fips'...
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants