Skip to content

Commit 5a26692

Browse files
Merge pull request #9818 from julek-wolfssl/sssd-2.10.2
sssd 2.10.2 changes
2 parents b9838aa + fe85ca6 commit 5a26692

4 files changed

Lines changed: 52 additions & 2 deletions

File tree

.github/workflows/sssd.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
fail-fast: false
4545
matrix:
4646
# List of releases to test
47-
ref: [ 2.9.1 ]
47+
ref: [ 2.9.1, 2.10.2 ]
4848
name: ${{ matrix.ref }}
4949
if: github.repository_owner == 'wolfssl'
5050
runs-on: ubuntu-24.04
@@ -61,7 +61,8 @@ jobs:
6161
# Don't prompt for anything
6262
export DEBIAN_FRONTEND=noninteractive
6363
sudo apt-get update
64-
sudo apt-get install -y build-essential autoconf libldb-dev libldb2 python3-ldb bc
64+
sudo apt-get install -y build-essential autoconf libldb-dev \
65+
libldb2 python3-ldb bc libcap-dev
6566
6667
- name: Setup env
6768
run: |

src/pk_ec.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,6 +2824,37 @@ int wolfSSL_EC_POINT_copy(WOLFSSL_EC_POINT *dest, const WOLFSSL_EC_POINT *src)
28242824
return ret;
28252825
}
28262826

2827+
/* Duplicates an EC point.
2828+
*
2829+
* @param [in] src EC point to duplicate.
2830+
* @param [in] group EC group for the new point.
2831+
* @return New EC point on success.
2832+
* @return NULL on failure.
2833+
*/
2834+
WOLFSSL_EC_POINT *wolfSSL_EC_POINT_dup(const WOLFSSL_EC_POINT *src,
2835+
const WOLFSSL_EC_GROUP *group)
2836+
{
2837+
WOLFSSL_EC_POINT *dest;
2838+
2839+
WOLFSSL_ENTER("wolfSSL_EC_POINT_dup");
2840+
2841+
if ((src == NULL) || (group == NULL)) {
2842+
return NULL;
2843+
}
2844+
2845+
dest = wolfSSL_EC_POINT_new(group);
2846+
if (dest == NULL) {
2847+
return NULL;
2848+
}
2849+
2850+
if (wolfSSL_EC_POINT_copy(dest, src) != 1) {
2851+
wolfSSL_EC_POINT_free(dest);
2852+
return NULL;
2853+
}
2854+
2855+
return dest;
2856+
}
2857+
28272858
/* Checks whether point is at infinity.
28282859
*
28292860
* Return code compliant with OpenSSL.

tests/api/test_ossl_ec.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,7 @@ int test_wolfSSL_EC_POINT(void)
314314
EC_POINT* set_point = NULL;
315315
EC_POINT* get_point = NULL;
316316
EC_POINT* infinity = NULL;
317+
EC_POINT* dup_point = NULL;
317318
BIGNUM* k = NULL;
318319
BIGNUM* Gx = NULL;
319320
BIGNUM* Gy = NULL;
@@ -507,6 +508,12 @@ int test_wolfSSL_EC_POINT(void)
507508
ExpectIntEQ(EC_POINT_copy(new_point, NULL), 0);
508509
ExpectIntEQ(EC_POINT_copy(new_point, set_point), 1);
509510

511+
/* Test duplicating */
512+
ExpectNull(EC_POINT_dup(NULL, group));
513+
ExpectNull(EC_POINT_dup(set_point, NULL));
514+
ExpectNotNull(dup_point = EC_POINT_dup(set_point, group));
515+
ExpectIntEQ(EC_POINT_cmp(group, dup_point, set_point, ctx), 0);
516+
510517
/* Test inverting */
511518
ExpectIntEQ(EC_POINT_invert(NULL, NULL, ctx), 0);
512519
ExpectIntEQ(EC_POINT_invert(NULL, new_point, ctx), 0);
@@ -526,6 +533,12 @@ int test_wolfSSL_EC_POINT(void)
526533
ExpectIntEQ(EC_POINT_add(group, orig_point, orig_point, new_point,
527534
NULL), 1);
528535
ExpectIntEQ(EC_POINT_cmp(group, orig_point, set_point, NULL), 0);
536+
/* dup_point equals set_point so let's test with that too */
537+
ExpectIntEQ(EC_POINT_add(group, orig_point, dup_point, dup_point, NULL),
538+
1);
539+
ExpectIntEQ(EC_POINT_add(group, orig_point, orig_point, new_point,
540+
NULL), 1);
541+
ExpectIntEQ(EC_POINT_cmp(group, orig_point, set_point, NULL), 0);
529542
EC_POINT_free(orig_point);
530543
}
531544
#endif
@@ -769,6 +782,7 @@ int test_wolfSSL_EC_POINT(void)
769782
BN_free(k);
770783
BN_free(set_point_bn);
771784
EC_POINT_free(infinity);
785+
EC_POINT_free(dup_point);
772786
EC_POINT_free(new_point);
773787
EC_POINT_free(set_point);
774788
EC_POINT_clear_free(Gxy);

wolfssl/openssl/ec.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ int wolfSSL_EC_POINT_cmp(const WOLFSSL_EC_GROUP *group,
379379
WOLFSSL_API int wolfSSL_EC_POINT_copy(WOLFSSL_EC_POINT *dest,
380380
const WOLFSSL_EC_POINT *src);
381381
WOLFSSL_API
382+
WOLFSSL_EC_POINT *wolfSSL_EC_POINT_dup(const WOLFSSL_EC_POINT *src,
383+
const WOLFSSL_EC_GROUP *group);
384+
WOLFSSL_API
382385
void wolfSSL_EC_POINT_free(WOLFSSL_EC_POINT *point);
383386
WOLFSSL_API
384387
int wolfSSL_EC_POINT_is_at_infinity(const WOLFSSL_EC_GROUP *group,
@@ -479,6 +482,7 @@ typedef WOLFSSL_EC_KEY_METHOD EC_KEY_METHOD;
479482
#define EC_POINT_clear_free wolfSSL_EC_POINT_clear_free
480483
#define EC_POINT_cmp wolfSSL_EC_POINT_cmp
481484
#define EC_POINT_copy wolfSSL_EC_POINT_copy
485+
#define EC_POINT_dup wolfSSL_EC_POINT_dup
482486
#define EC_POINT_is_at_infinity wolfSSL_EC_POINT_is_at_infinity
483487

484488
#define EC_get_builtin_curves wolfSSL_EC_get_builtin_curves

0 commit comments

Comments
 (0)