Skip to content

Commit

Permalink
Merge pull request #8811 from gilles-peskine-arm/pk_import_into_psa-b…
Browse files Browse the repository at this point in the history
…ackports-2.28

Backport 2.28: bugs fixed in "Implement mbedtls_pk_import_into_psa"
  • Loading branch information
gilles-peskine-arm authored Feb 21, 2024
2 parents 53e5adf + 049ea32 commit 36e6bd6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion include/psa/crypto_values.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@
((type) | PSA_KEY_TYPE_CATEGORY_FLAG_PAIR)
/** The public key type corresponding to a key pair type.
*
* You may also pass a key pair type as \p type, it will be left unchanged.
* You may also pass a public key type as \p type, it will be left unchanged.
*
* \param type A public key type or key pair type.
*
Expand Down
5 changes: 4 additions & 1 deletion tests/scripts/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,10 @@ def test(self, options):
success = True
for command in self.commands:
log_command(command)
ret = subprocess.call(command)
env = os.environ.copy()
if 'MBEDTLS_TEST_CONFIGURATION' in env:
env['MBEDTLS_TEST_CONFIGURATION'] += '-' + self.name
ret = subprocess.call(command, env=env)
if ret != 0:
if command[0] not in ['make', options.make_command]:
log_line('*** [{}] Error {}'.format(' '.join(command), ret))
Expand Down
9 changes: 8 additions & 1 deletion tests/suites/test_suite_pk.function
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@
#define RSA_KEY_SIZE 512
#define RSA_KEY_LEN 64

#if defined(MBEDTLS_RSA_C) || \
defined(MBEDTLS_PK_RSA_ALT_SUPPORT) || \
defined(MBEDTLS_ECDSA_C) || \
defined(MBEDTLS_USE_PSA_CRYPTO)
#define PK_CAN_SIGN_SOME
#endif

/** Generate a key of the desired type.
*
* \param pk The PK object to fill. It must have been initialized
Expand Down Expand Up @@ -894,7 +901,7 @@ exit:
}
/* END_CASE */

/* BEGIN_CASE depends_on:MBEDTLS_SHA256_C */
/* BEGIN_CASE depends_on:MBEDTLS_SHA256_C:PK_CAN_SIGN_SOME */
void pk_sign_verify(int type, int parameter, int sign_ret, int verify_ret)
{
mbedtls_pk_context pk;
Expand Down

0 comments on commit 36e6bd6

Please sign in to comment.