Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypto migration to Openssl 3.0.15 #99

Draft
wants to merge 22 commits into
base: release/202311
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
8eba191
change to howto.txt
DorLevi95 Jul 9, 2024
833f0dc
update submodule to openssl-3.0.9
DorLevi95 Jul 9, 2024
2a4fcac
add openssl3 configure scripts
DorLevi95 Jul 9, 2024
3cce3d0
cleanup openssl1.1.1 generated files and code
DorLevi95 Jul 9, 2024
2c1e028
update openssl*.inf files for openssl 3.0
DorLevi95 Jul 9, 2024
799874c
update uefiasm.conf
DorLevi95 Jul 9, 2024
39e4fd3
adapt CryptSm3 to openssl 3.0
DorLevi95 Jul 9, 2024
57c368e
remove openssl deprecation warnings
DorLevi95 Jul 9, 2024
5566108
remove BIO_* dummy functions
DorLevi95 Jul 9, 2024
415d547
ERR_GET_FUNC is gone
DorLevi95 Jul 9, 2024
5edc545
more openssl 3.0 adaptation + add stub folder
DorLevi95 Jul 9, 2024
0db8ea2
add implemention of _ftol2_sse() to avoid build error
DorLevi95 Jul 9, 2024
4d460f7
add more dummy implementation of openssl
DorLevi95 Jul 9, 2024
785c441
add UEFI provider
DorLevi95 Jul 9, 2024
5d8512a
run configure.py to update generated files -> X64 STANDARD build succ…
Jul 9, 2024
245220e
Add instrinsics to support building openssl3 on IA32 windows -> IA32 …
Jul 9, 2024
99eec06
add missing gcc instructions for IA32 build
Jul 16, 2024
3f3f26b
Enable memcpy sys call in RISCV64 build
DorLevi95 Aug 22, 2024
ca7ef02
add define of maximum unsigned size_t
DorLevi95 Aug 22, 2024
04235d2
remove BN and EC accel for size optimization
DorLevi95 Aug 22, 2024
208f68f
update openssl submodule 3.0.9 -> 3.0.15
DorLevi95 Jan 6, 2025
e9bc1e2
Update generated files based on OpenSSL 3.0.15
DorLevi95 Jan 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions OpensslPkg/Library/BaseCryptLib/Hash/CryptSm3.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include "InternalCryptLib.h"
#include "crypto/sm3.h"
#include "internal/sm3.h"

/**
Retrieves the size, in bytes, of the context buffer required for SM3 hash operations.
Expand Down Expand Up @@ -55,7 +55,7 @@ Sm3Init (
//
// Openssl SM3 Context Initialization
//
sm3_init ((SM3_CTX *)Sm3Context);
ossl_sm3_init ((SM3_CTX *)Sm3Context);
return TRUE;
}

Expand Down Expand Up @@ -136,7 +136,7 @@ Sm3Update (
//
// Openssl SM3 Hash Update
//
sm3_update ((SM3_CTX *)Sm3Context, Data, DataSize);
ossl_sm3_update ((SM3_CTX *)Sm3Context, Data, DataSize);

return TRUE;
}
Expand Down Expand Up @@ -178,7 +178,7 @@ Sm3Final (
//
// Openssl SM3 Hash Finalization
//
sm3_final (HashValue, (SM3_CTX *)Sm3Context);
ossl_sm3_final (HashValue, (SM3_CTX *)Sm3Context);

return TRUE;
}
Expand Down Expand Up @@ -225,11 +225,11 @@ Sm3HashAll (
//
// SM3 Hash Computation.
//
sm3_init (&Ctx);
ossl_sm3_init (&Ctx);

sm3_update (&Ctx, Data, DataSize);
ossl_sm3_update (&Ctx, Data, DataSize);

sm3_final (HashValue, &Ctx);
ossl_sm3_final (HashValue, &Ctx);

return TRUE;
}
3 changes: 3 additions & 0 deletions OpensslPkg/Library/BaseCryptLib/InternalCryptLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ SPDX-License-Identifier: BSD-2-Clause-Patent

#include "CrtLibSupport.h"

// TODO: remove in near future to stop using deprecated OpenSSL APIs
#define OPENSSL_NO_DEPRECATED 0

#include <openssl/opensslv.h>

#if OPENSSL_VERSION_NUMBER < 0x10100000L
Expand Down
26 changes: 0 additions & 26 deletions OpensslPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,32 +484,6 @@ fwrite (
return 0;
}

//
// -- Dummy OpenSSL Support Routines --
//

int
BIO_printf (
void *bio,
const char *format,
...
)
{
return 0;
}

int
BIO_snprintf (
char *buf,
size_t n,
const char *format,
...
)
{
// Because the function does not actually print anything to buf, it returns -1 as error.
// Otherwise, the consumer may think that the buf is valid and parse the buffer.
return -1;
}

#ifdef __GNUC__

Expand Down
25 changes: 0 additions & 25 deletions OpensslPkg/Library/BaseCryptLib/SysCall/UnitTestHostCrtWrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,31 +72,6 @@ sscanf (
return 0;
}

//
// -- Dummy OpenSSL Support Routines --
//

int
BIO_printf (
void *bio,
const char *format,
...
)
{
return 0;
}

int
BIO_snprintf (
char *buf,
size_t n,
const char *format,
...
)
{
return 0;
}

uid_t
getuid (
void
Expand Down
1 change: 1 addition & 0 deletions OpensslPkg/Library/Include/CrtLibSupport.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#define UINT_MAX 0xFFFFFFFF /* Maximum unsigned int value */
#define ULONG_MAX 0xFFFFFFFF /* Maximum unsigned long value */
#define CHAR_BIT 8 /* Number of bits in a char */
#define SIZE_MAX 0xFFFFFFFF /* Maximum unsigned size_t */

//
// Address families.
Expand Down
Loading
Loading