Re: openssl-users Digest, Vol 98, Issue 7

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Richard,

Thanks for providing the information.
I have one more query, please help.

I have to compile an NTP application with below mentioned CFLAG to suppress the deprecated compilation errors, but still I see a couple of compilation issues.
CFLAGSEXTRA += \
        -DOPENSSL_API_COMPAT=0x010101000L

For below EVP api's, const qualifier is added in openSSL3.0 code. To fix these errors, I have to do type casting in many places. 
We can't use "-Wdiscarded-qualifiers" FLAG in our environment, it is not supported.
Is there any other way that I can avoid this?  

Checking 'open'
../../../../vendor/ntp/util/ntp-keygen.c: In function 'main':
../../../../vendor/ntp/util/ntp-keygen.c:644:7: error: assignment discards 'const' qualifier from pointer target type [-Werror]
   rsa = EVP_PKEY_get0_RSA(pkey_gqkey);
       ^
../../../../vendor/ntp/util/ntp-keygen.c:665:7: error: assignment discards 'const' qualifier from pointer target type [-Werror]
   rsa = EVP_PKEY_get0_RSA(pkey_gqkey);
       ^
../../../../vendor/ntp/util/ntp-keygen.c:688:7: error: assignment discards 'const' qualifier from pointer target type [-Werror]
   rsa = EVP_PKEY_get0_RSA(pkey_gqkey);
       ^
../../../../vendor/ntp/util/ntp-keygen.c:731:7: error: assignment discards 'const' qualifier from pointer target type [-Werror]
   dsa = EVP_PKEY_get0_DSA(pkey_iffkey);
       ^
../../../../vendor/ntp/util/ntp-keygen.c:754:7: error: assignment discards 'const' qualifier from pointer target type [-Werror]
   dsa = EVP_PKEY_get0_DSA(pkey_iffkey);


Thanks & Regards,
Samiya khanum


On Fri, Jan 6, 2023 at 5:30 PM <openssl-users-request@xxxxxxxxxxx> wrote:
Send openssl-users mailing list submissions to
        openssl-users@xxxxxxxxxxx

To subscribe or unsubscribe via the World Wide Web, visit
        https://mta.openssl.org/mailman/listinfo/openssl-users
or, via email, send a message with subject or body 'help' to
        openssl-users-request@xxxxxxxxxxx

You can reach the person managing the list at
        openssl-users-owner@xxxxxxxxxxx

When replying, please edit your Subject line so it is more specific
than "Re: Contents of openssl-users digest..."


Today's Topics:

   1. Replacement for AES_encrypt (Samiya Khanum)
   2. Re: Replacement for AES_encrypt (Richard Levitte)


----------------------------------------------------------------------

Message: 1
Date: Thu, 5 Jan 2023 17:42:57 +0530
From: Samiya Khanum <samiya.khanum@xxxxxxxxxxxx>
To: openssl-users@xxxxxxxxxxx
Cc: Kamlesh Agrawal <kamlesh.agrawal@xxxxxxxxxxxx>
Subject: Replacement for AES_encrypt
Message-ID:
        <CADmX34oWPfjyP5j2q2xtgqr3d3TQQtfLGME4Fk5-rLr444EJsg@xxxxxxxxxxxxxx>
Content-Type: text/plain; charset="utf-8"

Hi All,

We are upgrading our code to openSSL 3.0.

I have replaced  AES_set_encrypt_key  and AES_encrypt
with EVP_CipherInit_ex, EVP_CipherUpdate and EVP_CipherFinal_ex.
In the below function what should be the cipher parameter(second argument).
Because in AES_encryt api, we don't mention any block cipher.
Is it EVP_aes_128_cbc() algorithm that we should use?

int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,
                                 *const EVP_CIPHER *cipher,* ENGINE *impl,
                                 const unsigned char *key,
                                 const unsigned char *iv, int enc);

Thanks & Regards,
Samiya khanum

--
This electronic communication and the information and any files transmitted
with it, or attached to it, are confidential and are intended solely for
the use of the individual or entity to whom it is addressed and may contain
information that is confidential, legally privileged, protected by privacy
laws, or otherwise restricted from disclosure to anyone else. If you are
not the intended recipient or the person responsible for delivering the
e-mail to the intended recipient, you are hereby notified that any use,
copying, distributing, dissemination, forwarding, printing, or copying of
this e-mail is strictly prohibited. If you received this e-mail in error,
please return the e-mail to the sender, delete it from your computer, and
destroy any printed copy of it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20230105/d2dd2a2f/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4212 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://mta.openssl.org/pipermail/openssl-users/attachments/20230105/d2dd2a2f/attachment-0001.p7s>

------------------------------

Message: 2
Date: Fri, 06 Jan 2023 08:19:33 +0100
From: Richard Levitte <levitte@xxxxxxxxxxx>
To: openssl-users@xxxxxxxxxxx, Kamlesh Agrawal
        <kamlesh.agrawal@xxxxxxxxxxxx>
Subject: Re: Replacement for AES_encrypt
Message-ID: <871qo8ruyi.wl-levitte@xxxxxxxxxxx>
Content-Type: text/plain; charset=ISO-8859-1

EVP_aes_128_cbc() is still usable to get the appropriate EVP_CIPHER
reference, but is regarded legacy.

With OpenSSL 3.0 and providers, the new method to get the algorithm
you want is by fetching, in this case using EVP_CIPHER_fetch().

In https://www.openssl.org/docs/man3.0/man7/crypto.html#FETCHING-EXAMPLES,
there is an example that demonstrates fetching exactly the algorithm
your asking for, "AES-128-CBC".

If you want to know exactly what algorithms are available to you (by name),
'openssl list' is your friend.  For example, this command shows all
the default cipher algorithms:

    openssl list -cipher-algorithms

You will notice that the output is divided into two sections,
"Legacy:" and "Provided:".  The latter is more future proof set of
names.

Cheers,
Richard

On Thu, 05 Jan 2023 13:12:57 +0100,
Samiya Khanum via openssl-users wrote:
>
> Hi All,
>
> We are?upgrading our code to openSSL 3.0.
>
> I have?replaced? AES_set_encrypt_key? and?AES_encrypt with?EVP_CipherInit_ex, EVP_CipherUpdate
> and?EVP_CipherFinal_ex.
> In the below function what should be the cipher parameter(second argument). Because in AES_encryt
> api, we don't?mention any block cipher.?
> Is it?EVP_aes_128_cbc() algorithm that?we should use?
>
> int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const EVP_CIPHER *cipher, ENGINE *impl,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const unsigned char *key,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?const unsigned char *iv, int enc);
> ?
> Thanks & Regards,
> Samiya khanum
>
> This electronic communication and the information and any files transmitted with it, or attached
> to it, are confidential and are intended solely for the use of the individual or entity to whom it
> is addressed and may contain information that is confidential, legally privileged, protected by
> privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended
> recipient or the person responsible for delivering the e-mail to the intended recipient, you are
> hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or
> copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return
> the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.
>
> [2 S/MIME Cryptographic Signature <application/pkcs7-signature (base64)>]
> Good signature from 1E45BABBADAD646C644FE256D55EFC9561AABBFF /CN=Samiya Khanum/O=Broadcom Inc./L=Bangalore/ST=Karnataka/C=IN/EMail=samiya.khanum@xxxxxxxxxxxx (trust full)
--
Richard Levitte         levitte@xxxxxxxxxxx
OpenSSL Project         http://www.openssl.org/~levitte/


------------------------------

Subject: Digest Footer

_______________________________________________
openssl-users mailing list
openssl-users@xxxxxxxxxxx
https://mta.openssl.org/mailman/listinfo/openssl-users


------------------------------

End of openssl-users Digest, Vol 98, Issue 7
********************************************

This electronic communication and the information and any files transmitted with it, or attached to it, are confidential and are intended solely for the use of the individual or entity to whom it is addressed and may contain information that is confidential, legally privileged, protected by privacy laws, or otherwise restricted from disclosure to anyone else. If you are not the intended recipient or the person responsible for delivering the e-mail to the intended recipient, you are hereby notified that any use, copying, distributing, dissemination, forwarding, printing, or copying of this e-mail is strictly prohibited. If you received this e-mail in error, please return the e-mail to the sender, delete it from your computer, and destroy any printed copy of it.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux