Skip to content

Conversation

@gasbytes
Copy link
Contributor

  • add lenient DER parser for ECDSA signatures when we fail with -171, so
    that we extract the r and s parameters, when the der is malformed when the integer
    values are raw bytes without proper sign-bit handling (those ders are
    used when signing/veriffing in the xmlsec1's testsuite);
  • handle 0-byte cipher finalization in aes-cbc, we return -173 when data
    size = 0 when decrypting, this gets called by xmlsec1 to flush the
    buffer after decryption is done (not needed for wolfssl, but we return 0 in that case);
  • Added v1.21.4 to the wget workflow;
  • Added v2.6.7 to the openldap workflow;

  that we extract the r and s parameters, when the der is malformed when the integer
  values are raw bytes without proper sign-bit handling (those ders are
  used when signing/veriffing in the xmlsec1's testsuite);
- handle 0-byte cipher finalization in aes-cbc, we return -173 when data
  size = 0 when decrypting, this gets called by xmlsec1 to flush the
  buffer after decryption is done (not needed for wolfssl, but we return 0 in that case);
- Added v2.6.7 to the openldap workflow
@gasbytes gasbytes self-assigned this Nov 14, 2025
@gasbytes gasbytes force-pushed the xmlsec1 branch 3 times, most recently from 45546b4 to 96c8dd6 Compare November 17, 2025 16:13
}

/* Handle 0-byte finalization call, common in cipher APIs for flushing/padding */
if (src_size == 0) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't use TABs for indenting.

if (len & 0x80) {
/* Long form length */
word32 num_bytes = len & 0x7F;
if (num_bytes > 4 || idx + num_bytes > sig_len) return -1;
Copy link
Contributor

Choose a reason for hiding this comment

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

When len is 0x80 then this is indefinite length encoded meaning go look for EOC.
Don't want to support that here.

/* Parse r length */
if (idx >= sig_len) return -1;
len = sig_data[idx++];
if (len & 0x80) {
Copy link
Contributor

@SparkiDev SparkiDev Nov 18, 2025

Choose a reason for hiding this comment

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

Extract into a function as this code is required in multiple places.

}

/* Skip leading zero byte if present (sign byte) */
if (len > 0 && idx < sig_len && sig_data[idx] == 0x00) {
Copy link
Contributor

Choose a reason for hiding this comment

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

len must be greater than 0.

- removed accidental Tab in the wolfssl-gnutls-wrapper/src/cipher.c
  file;
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.

2 participants