]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
lib/mpi.c: extract flag correctly
authorAvinash Sonawane <rootkea@gmail.com>
Tue, 13 Feb 2024 09:37:32 +0000 (15:07 +0530)
committerAvinash Sonawane <rootkea@gmail.com>
Tue, 13 Feb 2024 09:37:32 +0000 (15:07 +0530)
Signed-off-by: Avinash Sonawane <rootkea@gmail.com>
lib/mpi.c

index de07b1559f48eb6c4c8f991c8012da44b86692ad..e910dc2770299a9e56618c0dc403621b3c1c0b11 100644 (file)
--- a/lib/mpi.c
+++ b/lib/mpi.c
@@ -400,7 +400,7 @@ static int __gnutls_x509_write_int(asn1_node node, const char *value,
        s_len = 0;
        if (flags & GNUTLS_X509_INT_LZ)
                result = _gnutls_mpi_print_lz(mpi, NULL, &s_len);
-       else if (GNUTLS_X509_INT_LE)
+       else if (flags & GNUTLS_X509_INT_LE)
                result = _gnutls_mpi_print_le(mpi, NULL, &s_len);
        else
                result = _gnutls_mpi_print(mpi, NULL, &s_len);
@@ -418,7 +418,7 @@ static int __gnutls_x509_write_int(asn1_node node, const char *value,
 
        if (flags & GNUTLS_X509_INT_LZ)
                result = _gnutls_mpi_print_lz(mpi, tmpstr, &s_len);
-       else if (GNUTLS_X509_INT_LE)
+       else if (flags & GNUTLS_X509_INT_LE)
                result = _gnutls_mpi_print_le(mpi, tmpstr, &s_len);
        else
                result = _gnutls_mpi_print(mpi, tmpstr, &s_len);