EVP Signing and Verifying

2020-04-27 Thread Thomas Dwyer III
The first signing example at https://wiki.openssl.org/index.php/EVP_Signing_and_Verifying explicitly calls both EVP_DigestInit_ex() and EVP_DigestSignInit(). Is the former really necessary? It appears that the implementation of EVP_DigestSignInit() in all versions of OpenSSL internally invokes EVP_

Re: OpenSSL version 3.0.0-alpha1 build failed

2020-04-30 Thread Thomas Dwyer III
For what it's worth, I also get similar perl crashes from the Configure script. All of my build servers (which I do not control) have perl 5.10.1 installed on Oracle Linux 6.5. I tested with 5.12.5 and that also crashed in the same way. 5.14.4 is the oldest version (stable branch) I could find that

Extracting the public modulus from an RSA public key?

2020-05-05 Thread Thomas Dwyer III
I'm porting some old legacy code from OpenSSL 1.0.2 to OpenSSL 3.0.0. A portion of this code reads X509 certificates, extracts the public key, and passes it to firmware that I cannot modify. Unfortunately, this legacy firmware API was very poorly designed such that the public key is passed in a way

Re: Extracting the public modulus from an RSA public key?

2020-05-05 Thread Thomas Dwyer III
unction you are wanting. > > > Pauli > -- > Dr Paul Dale | Distinguished Architect | Cryptographic Foundations > Phone +61 7 3031 7217 > Oracle Australia > > > > > On 6 May 2020, at 2:20 pm, Thomas Dwyer III wrote: > > I'm porting some old legacy co

Minimum gcc version required for openssl 3.x?

2020-05-12 Thread Thomas Dwyer III
I searched all the docs I could find but I was unable to locate any statements regarding gcc compatibility for openssl 3.x. I'm having a problem cross-compiling for arm using gcc-4.4.5: rm -f libssl.so && \ ln -s libssl.so.3 libssl.so arm-linux-gnueabi-gcc -Iinclude -fPIC -pthread -Wall

EVP_PKEY_new_raw_private_key() vs EVP_PKEY_new_mac_key() ?

2020-05-14 Thread Thomas Dwyer III
Are EVP_PKEY_new_raw_private_key() and EVP_PKEY_new_mac_key() functionally equivalent? They have very different implementations internally but appear to produce identical results when used with EVP_DigestSignInit() and key type EVP_PKEY_HMAC. The documentation says "works like" but it's not clear w

Re: OpenSSL shared library in FIPS mode

2020-07-07 Thread Thomas Dwyer III
On Tue, Jul 7, 2020 at 12:48 AM Dr Paul Dale wrote: > OpenSSL 1.0.2 ceased being supported at the beginning of this year. > > If you are deviating in any way from the prescribed build instructions > (you did read the security policy didn’t you?) you are not FIPS compliant. > Can you confirm whet

OpenSSL 3.0 hangs at exit with FIPS provider

2020-07-15 Thread Thomas Dwyer III
Platform: Linux x86_64 I understand this is still alpha but how complete is the FIPS provider right now? I'm following the documentation at https://wiki.openssl.org/index.php/OpenSSL_3.0 but I'm having a problem where my application hangs during exit() when I use the "fips" provider. I reduced my

[SOLVED] Re: OpenSSL 3.0 hangs at exit with FIPS provider

2020-07-17 Thread Thomas Dwyer III
vider() returns NULL for any EVP_MD obtained via EVP_get_digestbyname() (even after it's used successfully by EVP_DigestInit_ex()) but it returns a valid OSSL_PROVIDER for any EVP_MD obtained via EVP_MD_fetch(). Is this intentional? Tom.III On Wed, Jul 15, 2020 at 10:20 AM Thomas Dwyer III

Re: [SOLVED] Re: OpenSSL 3.0 hangs at exit with FIPS provider

2020-07-20 Thread Thomas Dwyer III
view, use, disclosure or distribution is > prohibited. If you are not the intended recipient, please immediately > contact the sender by reply e-mail and delete the original message and > destroy all copies thereof. > > <https://www.ncp-e.com/de/aktuelles/events/veranstaltungen> >

openssl fipsinstall

2020-07-27 Thread Thomas Dwyer III
Hi all, I'm replacing OpenSSL 1.0.2 with OpenSSL 3.0 in an embedded environment with very limited flash space. We need and use libcrypto and libssl but we have no need for the openssl binary. To date it was never necessary to ship this utility in our product. Now with OpenSSL 3.0 it appears the on

Re: openssl fipsinstall

2020-07-27 Thread Thomas Dwyer III
217 > Oracle Australia > > > > > On 28 Jul 2020, at 6:19 am, Thomas Dwyer III wrote: > > Hi all, > > I'm replacing OpenSSL 1.0.2 with OpenSSL 3.0 in an embedded environment > with very limited flash space. We need and use libcrypto and libssl but we > have no

FIPS and default properties

2020-07-30 Thread Thomas Dwyer III
I'm struggling to understand how EVP_default_properties_is_fips_enabled() works. I cannot get this function to return nonzero unless I first call either EVP_default_properties_enable_fips() or EVP_set_default_properties(), even when the config file sets default_properties to enable fips. Also, the

Re: A question about the “localhost.key” and “localhost.crt” files.

2020-09-04 Thread Thomas Dwyer III
The filenames themselves are insignificant. You can name them anything you want. The apache configuration file(s) contain key/value pairs where SSLCertificateFile specifies the path to the file containing your certificate and SSLCertificateKeyFile specifies the path to the file containing your priv

Re: 3 failures with Openssl 3 alpha

2020-10-07 Thread Thomas Dwyer III
On Wed, Oct 7, 2020 at 7:33 AM The Doctor wrote: > 1) The openssh project does not work openssh 8.4+ > This is a problem with the openssh codebase and not with openssl. You asked about this in openssh-unix-dev back in

PRNG not available when multiple providers are configured?

2020-11-02 Thread Thomas Dwyer III
I'm having trouble getting RAND_status() to return 1 when my openssl.cnf has both the default provider and the fips provider configured at the same time: openssl_conf = openssl_init [openssl_init] providers = provider_sect [provider_sect] default = default

Re: PRNG not available when multiple providers are configured?

2020-11-03 Thread Thomas Dwyer III
On Tue, Nov 3, 2020 at 7:13 AM Matt Caswell wrote: > > > On 03/11/2020 00:55, Thomas Dwyer III wrote: > > I'm having trouble getting RAND_status() to return 1 when my openssl.cnf > > has both the default provider and the fips provider configured at the > > same ti

Re: Format error in certificate´s notAfter field

2020-12-28 Thread Thomas Dwyer III
This certificate is not the same one causing the error message in your original email. The error message you provided earlier included "serial=17702460327850242852" (or f5:ab:c5:e0:63:f5:73:24 in hex) but the certificate you provided here has serial=16005263760024127372 (de:1e:1e:97:18:ab:c7:8c).

Is SSL_CTX_set_tmp_rsa_callback() only for small keys?

2021-03-15 Thread Thomas Dwyer III
I'm porting some very old code from 1.0.2 to 3.0 (but it still has to compile for both) and I'm trying to understand it's use of SSL_CTX_set_tmp_rsa_callback(). It looks like this was removed in 1.1.0 but it's not obvious to me why it was necessary in the first place. My read of the 1.0.2 man page

Re: EVP_MAC_init - specify the hash algorithm

2021-07-13 Thread Thomas Dwyer III
This seems to work for me in 3.0, passing the EVP_MD to EVP_DigestSignInit(): pkey = EVP_PKEY_new_mac_key() EVP_DigestSignInit() EVP_DigestSignUpdate() EVP_DigestSignUpdate() . . . EVP_DigestSignFinal() Regards, Tom.III On Tue, Jul 13, 2021 at 11:02 AM Ken Goldman wrote: > Porting to 3.0 ..

Re: EVP_MAC_init - specify the hash algorithm

2021-07-13 Thread Thomas Dwyer III
); > EVP_MAC_update(mac_ctx, data2, data2_len); > EVP_MAC_update(mac_ctx, data3, data3_len); > EVP_MAC_final(mac_ctx, out, &out_size, out_len); > EVP_MAC_CTX_free(mac_ctx); > > There are various other calls that tweak the flow but this is the basic > idea. > > > Pauli >

Re: Set X509 public key in 1.0.2

2021-08-20 Thread Thomas Dwyer III
1.0.2 has X509_PUBKEY_get() (without the zero) which I believe increases the reference count on the EVP_PKEY. Tom.III On Fri, Aug 20, 2021 at 3:31 PM Ken Goldman wrote: > I have an X509_PUBKEY structure holding the algorithm and public key. > I want to set it in the X509 structure. > > In 1.1

Re: OpenSSL 3.0 FIPS module configuration file

2022-02-14 Thread Thomas Dwyer III
I believe the relevant standard is described in the Implementation Guidance for FIPS 140-2: https://csrc.nist.gov/csrc/media/projects/cryptographic-module-validation-program/documents/fips140-2/fips1402ig.pdf (see IG 9.11 beginning on page 179). I searched briefly for similar text in FIPS 140-3 IG

OpenSSL FIPS certificate #4282

2022-11-22 Thread Thomas Dwyer III
The OpenSSL project has obtained certificate #4282 from NIST for the FIPS provider. Nice. However, the certificate and accompanying security policy specifically list version 3.0.0 while the current release is

Re: [External] : Re: BIO_read() crash

2022-12-05 Thread Thomas Dwyer III
Why does EVP_get_digestbyname("md4") return non-NULL if the legacy provider isn't loaded? Similarly, why does it return non-NULL for "md5" after doing EVP_set_default_properties(NULL, "fips=yes")? This seems unintuitive. Legacy code that does not know about EVP_MD_fetch() checks the return valu

Re: [External] : Why do I get the following error `wrong signature length` when I try to validate a signed file using the c++ OpenSSL 3.1 library?

2024-06-10 Thread Thomas Dwyer III via openssl-users
|if (EVP_PKEY_verify(ctx, licenseSignature, sizeof(licenseSignature), licenseContent, sizeof(licenseContent)) <= 0)| The sizeof operator is not doing what you think it's doing. It's computing the sizes of the pointers (typically 4 or 8 bytes depending on your architecture) and not the sizes of