Skip to content

Commit

Permalink
Merge pull request #40 from awslabs/platform
Browse files Browse the repository at this point in the history
Disabled ecdsa key generation on iOS
  • Loading branch information
Justin Boswell authored Aug 28, 2020
2 parents 6a5104a + f2d86a1 commit 2b9c589
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/aws/cal/ecc.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ AWS_CAL_API struct aws_ecc_key_pair *aws_ecc_key_pair_new_from_private_key(
enum aws_ecc_curve_name curve_name,
const struct aws_byte_cursor *priv_key);

#if !defined(AWS_OS_IOS)
/**
* Creates a Eliptic Curve public/private key pair that can be used for signing and verifying.
* Returns a new instance of aws_ecc_key_pair if the key was successfully built.
Expand All @@ -80,6 +81,7 @@ AWS_CAL_API struct aws_ecc_key_pair *aws_ecc_key_pair_new_from_private_key(
AWS_CAL_API struct aws_ecc_key_pair *aws_ecc_key_pair_new_generate_random(
struct aws_allocator *allocator,
enum aws_ecc_curve_name curve_name);
#endif /* !AWS_OS_IOS */

/**
* Creates a Eliptic Curve public key that can be used for verifying.
Expand Down
7 changes: 6 additions & 1 deletion source/darwin/securityframework_ecc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
* SPDX-License-Identifier: Apache-2.0.
*/
#include <Security/SecKey.h>
#include <Security/SecSignVerifyTransform.h>
#include <Security/Security.h>
#include <aws/cal/cal.h>
#include <aws/cal/ecc.h>
#include <aws/cal/private/der.h>
#include <aws/cal/private/ecc.h>

#if !defined(AWS_OS_IOS)
# include <Security/SecSignVerifyTransform.h>
#endif

struct commoncrypto_ecc_key_pair {
struct aws_ecc_key_pair key_pair;
SecKeyRef priv_key_ref;
Expand Down Expand Up @@ -332,6 +335,7 @@ struct aws_ecc_key_pair *aws_ecc_key_pair_new_from_public_key(
return NULL;
}

#if !defined(AWS_OS_IOS)
struct aws_ecc_key_pair *aws_ecc_key_pair_new_generate_random(
struct aws_allocator *allocator,
enum aws_ecc_curve_name curve_name) {
Expand Down Expand Up @@ -482,6 +486,7 @@ struct aws_ecc_key_pair *aws_ecc_key_pair_new_generate_random(
s_destroy_key(&cc_key_pair->key_pair);
return NULL;
}
#endif /* AWS_OS_IOS */

struct aws_ecc_key_pair *aws_ecc_key_pair_new_from_asn1(
struct aws_allocator *allocator,
Expand Down

0 comments on commit 2b9c589

Please sign in to comment.