• Bug#1109207: bookworm-pu: package openssl/3.0.17-1~deb12u1 (2/7)

    From Sebastian Andrzej Siewior@21:1/5 to All on Sun Jul 13 15:00:01 2025
    [continued from previous message]

    -BN_get_flags(b, n) exist to enable or fetch flag(s) B<n> from B<BIGNUM> -structure B<b>.
    -
    -Various routines in this library require the use of temporary
    -B<BIGNUM> variables during their execution. Since dynamic memory
    -allocation to create B<BIGNUM>s is rather expensive when used in
    -conjunction with repeated subroutine calls, the B<BN_CTX> structure is
    -used. This structure contains B<BN_CTX_NUM> B<BIGNUM>s, see -L<BN_CTX_start(3)>.
    -
    -=head2 Low-level arithmetic operations
    -
    -These functions are implemented in C and for several platforms in
    -assembly language:
    -
    -bn_mul_words(B<rp>, B<ap>, B<num>, B<w>) operates on the B<num> word
    -arrays B<rp> and B<ap>. It computes B<ap> * B<w>, places the result
    -in B<rp>, and returns the high word (carry).
    -
    -bn_mul_add_words(B<rp>, B<ap>, B<num>, B<w>) operates on the B<num>
    -word arrays B<rp> and B<ap>. It computes B<ap> * B<w> + B<rp>, places
    -the result in B<rp>, and returns the high word (carry).
    -
    -bn_sqr_words(B<rp>, B<ap>, B<n>) operates on the B<num> word array
    -B<ap> and the 2*B<num> word array B<ap>. It computes B<ap> * B<ap> -word-wise, and places the low and high bytes of the result in B<rp>.
    -
    -bn_div_words(B<h>, B<l>, B<d>) divides the two word number (B<h>, B<l>)
    -by B<d> and returns the result.
    -
    -bn_add_words(B<rp>, B<ap>, B<bp>, B<num>) operates on the B<num> word
    -arrays B<ap>, B<bp> and B<rp>. It computes B<ap> + B<bp>, places the
    -result in B<rp>, and returns the high word (carry).
    -
    -bn_sub_words(B<rp>, B<ap>, B<bp>, B<num>) operates on the B<num> word
    -arrays B<ap>, B<bp> and B<rp>. It computes B<ap> - B<bp>, places the
    -result in B<rp>, and returns the carry (1 if B<bp> E<gt> B<ap>, 0
    -otherwise).
    -
    -bn_mul_comba4(B<r>, B<a>, B<b>) operates on the 4 word arrays B<a> and
    -B<b> and the 8 word array B<r>. It computes B<a>*B<b> and places the
    -result in B<r>.
    -
    -bn_mul_comba8(B<r>, B<a>, B<b>) operates on the 8 word arrays B<a> and
    -B<b> and the 16 word array B<r>. It computes B<a>*B<b> and places the
    -result in B<r>.
    -
    -bn_sqr_comba4(B<r>, B<a>, B<b>) operates on the 4 word arrays B<a> and
    -B<b> and the 8 word array B<r>.
    -
    -bn_sqr_comba8(B<r>, B<a>, B<b>) operates on the 8 word arrays B<a> and
    -B<b> and the 16 word array B<r>.
    -
    -The following functions are implemented in C:
    -
    -bn_cmp_words(B<a>, B<b>, B<n>) operates on the B<n> word arrays B<a>
    -and B<b>. It returns 1, 0 and -1 if B<a> is greater than, equal and
    -less than B<b>.
    -
    -bn_mul_normal(B<r>, B<a>, B<na>, B<b>, B<nb>) operates on the B<na>
    -word array B<a>, the B<nb> word array B<b> and the B<na>+B<nb> word
    -array B<r>. It computes B<a>*B<b> and places the result in B<r>.
    -
    -bn_mul_low_normal(B<r>, B<a>, B<b>, B<n>) operates on the B<n> word
    -arrays B<r>, B<a> and B<b>. It computes the B<n> low words of
    -B<a>*B<b> and places the result in B<r>.
    -
    -bn_mul_recursive(B<r>, B<a>, B<b>, B<n2>, B<dna>, B<dnb>, B<t>) operates
    -on the word arrays B<a> and B<b> of length B<n2>+B<dna> and B<n2>+B<dnb> -(B<dna> and B<dnb> are currently allowed to be 0 or negative) and the 2*B<n2> -word arrays B<r> and B<t>. B<n2> must be a power of 2. It computes -B<a>*B<b> and places the result in B<r>.
    -
    -bn_mul_part_recursive(B<r>, B<a>, B<b>, B<n>, B<tna>, B<tnb>, B<tmp>) -operates on the word arrays B<a> and B<b> of length B<n>+B<tna> and -B<n>+B<tnb> and the 4*B<n> word arrays B<r> and B<tmp>.
    -
    -bn_mul_low_recursive(B<r>, B<a>, B<b>, B<n2>, B<tmp>) operates on the
    -B<n2> word arrays B<r> and B<tmp> and the B<n2>/2 word arrays B<a>
    -and B<b>.
    -
    -BN_mul() calls bn_mul_normal(), or an optimized implementation if the
    -factors have the same size: bn_mul_comba8() is used if they are 8
    -words long, bn_mul_recursive() if they are larger than
    -B<BN_MULL_SIZE_NORMAL> and the size is an exact multiple of the word
    -size, and bn_mul_part_recursive() for others that are larger than -B<BN_MULL_SIZE_NORMAL>.
    -
    -bn_sqr_normal(B<r>, B<a>, B<n>, B<tmp>) operates on the B<n> word array
    -B<a> and the 2*B<n> word arrays B<tmp> and B<r>.
    -
    -The implementations use the following macros which, depending on the -architecture, may use "long long" C operations or inline assembler.
    -They are defined in C<bn_local.h>.
    -
    -mul(B<r>, B<a>, B<w>, B<c>) computes B<w>*B<a>+B<c> and places the
    -low word of the result in B<r> and the high word in B<c>.
    -
    -mul_add(B<r>, B<a>, B<w>, B<c>) computes B<w>*B<a>+B<r>+B<c> and
    -places the low word of the result in B<r> and the high word in B<c>.
    -
    -sqr(B<r0>, B<r1>, B<a>) computes B<a>*B<a> and places the low word
    -of the result in B<r0> and the high word in B<r1>.
    -
    -=head2 Size changes
    -
    -bn_expand() ensures that B<b> has enough space for a B<bits> bit
    -number. bn_wexpand() ensures that B<b> has enough space for an
    -B<n> word number. If the number has to be expanded, both macros
    -call bn_expand2(), which allocates a new B<d> array and copies the
    -data. They return B<NULL> on error, B<b> otherwise.
    -
    -The bn_fix_top() macro reduces B<a-E<gt>top> to point to the most
    -significant non-zero word plus one when B<a> has shrunk.
    -
    -=head2 Debugging
    -
    -bn_check_top() verifies that C<((a)-E<gt>top E<gt>= 0 && (a)-E<gt>top
    -E<lt>= (a)-E<gt>dmax)>. A violation will cause the program to abort.
    -
    -bn_print() prints B<a> to stderr. bn_dump() prints B<n> words at B<d>
    -(in reverse order, i.e. most significant word first) to stderr.
    -
    -bn_set_max() makes B<a> a static number with a B<dmax> of its current size. -This is used by bn_set_low() and bn_set_high() to make B<r> a read-only -B<BIGNUM> that contains the B<n> low or high words of B<a>.
    -
    -If B<BN_DEBUG> is not defined, bn_check_top(), bn_print(), bn_dump()
    -and bn_set_max() are defined as empty macros.
    -
    -=head1 SEE ALSO
    -
    -L<bn(3)>
    -
    -=head1 COPYRIGHT
    -
    -Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
    -
    -Licensed under the Apache License 2.0 (the "License"). You may not use
    -this file except in compliance with the License. You can obtain a copy
    -in the file LICENSE in the source distribution or at -L<https://www.openssl.org/source/license.html>.
    -
    -=cut
    diff -Nru -w openssl-3.0.16/crypto/cmp/cmp_client.c openssl-3.0.17/crypto/cmp/cmp_client.c
    --- openssl-3.0.16/crypto/cmp/cmp_client.c 2025-02-11 15:47:41.000000000 +0100
    +++ openssl-3.0.17/crypto/cmp/cmp_client.c 2025-07-01 14:11:11.000000000 +0200
    @@ -1,5 +1,5 @@
    /*
    - * Copyright 2007-2023 The OpenSSL Project Authors. All Rights Reserved.
    + * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
    * Copyright Nokia 2007-2019
    * Copyright Siemens AG 2015-2019
    *
    @@ -611,8 +611,10 @@
    ERR_add_error_data(1, "; cannot extract certificate from response");
    return 0;
    }
    - if (!ossl_cmp_ctx_set0_newCert(ctx, cert))
    + if (!ossl_cmp_ctx_set0_newCert(ctx, cert)) {
    + X509_free(cert);
    return 0;
    + }

    /*
    * if the CMP server returned certificates in the caPubs field, copy them diff -Nru -w openssl-3.0.16/crypto/cms/cms_pwri.c openssl-3.0.17/crypto/cms/cms_pwri.c
    --- openssl-3.0.16/crypto/cms/cms_pwri.c 2025-02-11 15:47:41.000000000 +0100
    +++ openssl-3.0.17/crypto/cms/cms_pwri.c 2025-07-01 14:11:11.000000000 +0200
    @