]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix parameter names for RSA private key example
authorJoakim Antman <antmanj@gmail.com>
Wed, 19 Oct 2022 16:12:39 +0000 (19:12 +0300)
committerTomas Mraz <tomas@openssl.org>
Thu, 27 Oct 2022 12:01:56 +0000 (14:01 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19443)

doc/man3/OSSL_PARAM_BLD.pod

index 36182be0474f3a8b136ab3d389264c9b47272172..639f7bb59537e5c7f8bf144a5809c2a6ee89a04d 100644 (file)
@@ -147,10 +147,12 @@ To pass signed B<BIGNUM>s, use OSSL_PARAM_BLD_push_signed_BN().
 Both examples creating an OSSL_PARAM array that contains an RSA key.
 For both, the predefined key variables are:
 
-    BIGNUM *p, *q;  /* both prime */
-    BIGNUM *n;      /* = p * q */
-    unsigned int e; /* exponent, usually 65537 */
-    BIGNUM *d;      /* e^-1 */
+    BIGNUM *n;           /* modulus */
+    unsigned int e;      /* public exponent */
+    BIGNUM *d;           /* private exponent */
+    BIGNUM *p, *q;       /* first two prime factors */
+    BIGNUM *dmp1, *dmq1; /* first two CRT exponents */
+    BIGNUM *iqmp;        /* first CRT coefficient */
 
 =head2 Example 1
 
@@ -161,11 +163,14 @@ private key.
     OSSL_PARAM *params = NULL;
 
     if (bld == NULL
-        || !OSSL_PARAM_BLD_push_BN(bld, "p", p)
-        || !OSSL_PARAM_BLD_push_BN(bld, "q", q)
-        || !OSSL_PARAM_BLD_push_uint(bld, "e", e)
         || !OSSL_PARAM_BLD_push_BN(bld, "n", n)
+        || !OSSL_PARAM_BLD_push_uint(bld, "e", e)
         || !OSSL_PARAM_BLD_push_BN(bld, "d", d)
+        || !OSSL_PARAM_BLD_push_BN(bld, "rsa-factor1", p)
+        || !OSSL_PARAM_BLD_push_BN(bld, "rsa-factor2", q)
+        || !OSSL_PARAM_BLD_push_BN(bld, "rsa-exponent1", dmp1)
+        || !OSSL_PARAM_BLD_push_BN(bld, "rsa-exponent2", dmq1)
+        || !OSSL_PARAM_BLD_push_BN(bld, "rsa-coefficient1", iqmp)
         || (params = OSSL_PARAM_BLD_to_param(bld)) == NULL)
         goto err;
     OSSL_PARAM_BLD_free(bld);
@@ -183,7 +188,7 @@ public key.
 
     if (nld == NULL
         || !OSSL_PARAM_BLD_push_BN(bld, "n", n)
-        || !OSSL_PARAM_BLD_push_BN(bld, "e", e)
+        || !OSSL_PARAM_BLD_push_uint(bld, "e", e)
         || (params = OSSL_PARAM_BLD_to_param(bld)) == NULL)
         goto err;
     OSSL_PARAM_BLD_free(bld);