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

Bug1794213 server keygen enroll input output #1

Conversation

SilleBille
Copy link

This patch carries the following changes:

  • Uses javascript to fill up the web UI request for ServerSide Keygen request profile

  • Provides 2 drop down boxes: KeyType and Keysize. KeySize autoupdates based on
    the KeyType selected. Example: RSA -> 1024, 2048,.. ; ECC -> nistp521, nistp256

  • The keyType and keySize are read from the profile's attr:
    policyset.userCertSet.3.constraint.params.keyParameters

File wise changes:

  • ServerKeygenUserKeyDefault.java can now generate Key pair based on the user's
    selection. (NOTE: This logic was added as a place holder. This might need some review)

  • ServerKeygenInput.java sends 2 new fields (keyType and keyRequest) to the request, to be
    displayed on the webUI

  • ProfileSelect.template carries the javascript changes. Note that there are 2 new if
    conditions included: "server_side_keygen_key_type" and "server_side_keygen_key_size".
    This ensures that it doesn't meddle with other profile web UIs

  • IDescriptor.java and UserMessages.properties carry the appropriate String values to
    be displayed/requested from user.

Testing procedure:

Following are the steps I personally used to test my changes:

  1. Do a pkispawn of CA
  2. Modify the CS.cfg to match the following values:
policyset.userCertSet.3.constraint.params.keyType=-
policyset.userCertSet.3.constraint.params.keyParameters=1024,2048,3072,4096,nistp256,nistp384,nistp521
  1. Visit the webUI and choose "Certificate Profile - Manual User Dual-Use Certificate Enrollment using server-side Key generation"

  2. Choose the appropriate inputs. (I also chose different set of KeyType and KeySize and verified that it gets logged in debug log)

~ snip from debug log~
[27/Mar/2020:18:16:37][http-bio-8443-exec-13]: EnrollDefault: populate: ServerKeygenUserKeyDefault: start
[27/Mar/2020:18:16:37][http-bio-8443-exec-13]: ServerKeygenUserKeyDefault: populate: in here
[27/Mar/2020:18:16:37][http-bio-8443-exec-13]: ServerKeygenUserKeyDefault: populate: keyType in request: EC
[27/Mar/2020:18:16:37][http-bio-8443-exec-13]: ServerKeygenUserKeyDefault: populate: keyCurve in request: nistp384
[27/Mar/2020:18:16:37][http-bio-8443-exec-13]: EnrollDefault: populate: ServerKeygenUserKeyDefault: end
~ snip~
  1. Approve cert as caadmin

  2. Certificate is generated:

-----BEGIN CERTIFICATE-----
MIIDBDCCAmagAwIBAgIBCDAKBggqhkjOPQQDBDBIMRAwDgYDVQQKDAdFWEFNUExF
MRMwEQYDVQQLDApwa2ktdG9tY2F0MR8wHQYDVQQDDBZDQSBTaWduaW5nIENlcnRp
ZmljYXRlMB4XDTIwMDMyNzIyMTYzN1oXDTIwMDkyMzIyMTYzN1owgbAxCzAJBgNV
BAYTAklOMQwwCgYDVQQKDANvcmcxETAPBgNVBAsMCG9yZyB1bml0MQ4wDAYDVQQL
DAVvcmcgMTEOMAwGA1UECwwFb3JnIDIxDjAMBgNVBAsMBU9yZyAzMRQwEgYDVQQD
DAtDb21tb24gbmFtZTEeMBwGCSqGSIb3DQEJARYPZW1haWxAZW1haWwuY29tMRow
GAYKCZImiZPyLGQBAQwKdGVzdHVzZXIxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IA
BHX1bgVjm946e7Guk/N0GqyyIMCmgDKzAuZxRsRAX6SfY/tB/8bCh9z5FptnPjX4
s+Uv5W0QVBn2eIXOMyHIirmmnYUGzEJE3/l9R/gzg9hvPggvcPOjvfoVXU+TSrPx
lqOBujCBtzAfBgNVHSMEGDAWgBQJpYljQDZeN9FSw/MD7jy4cCCx+zBFBggrBgEF
BQcBAQQ5MDcwNQYIKwYBBQUHMAGGKWh0dHA6Ly9sb2NhbGhvc3QubG9jYWxkb21h
aW46ODA4MC9jYS9vY3NwMA4GA1UdDwEB/wQEAwIF4DAdBgNVHSUEFjAUBggrBgEF
BQcDAgYIKwYBBQUHAwQwHgYDVR0RBBcwFYETZW1haWxAcmVxdWVzdG9yLmNvbTAK
BggqhkjOPQQDBAOBiwAwgYcCQWAHPhKTuVQI20wnIJPCxZ/k5WXyf/hr5wRCM9Xw
vRaEfjhIbWSqRXvSQONm4qMvomXs+rxo1k/a/vAj0DcZ5k0XAkIBh8KuHsELdZ0r
yyR/8AHjqSltymYwmRAVczjoOehN8QA7AJA3kDveGtXMFFwGN3W5TyUnkJdGRp8Y
py2g6uSLC8c=
-----END CERTIFICATE-----

This patch:

- Uses javascript to fill up the web UI request for ServerSide Keygen request profile

- Provides 2 drop down boxes: KeyType and Keysize. KeySize autoupdates based on
  the KeyType selected. Example: RSA -> 1024, 2048,.. ; ECC -> nistp521, nistp256

- The keyType and keySize are read from the profile's attr:
  policyset.userCertSet.3.constraint.params.keyParameters

File wise changes:

- ServerKeygenUserKeyDefault.java can now generate Key pair based on the user's
  selection. (NOTE: This logic was added as a place holder. This might need some review)

- ServerKeygenInput.java sends 2 new fields (keyType and keyRequest) to the request, to be
  displayed on the webUI

- ProfileSelect.template carries the javascript changes. Note that there are 2 new if
  conditions included: "server_side_keygen_key_type" and "server_side_keygen_key_size".
  This ensures that it doesn't meddle with other profile web UIs

- IDescriptor.java and UserMessages.properties carry the appropriate String values to
  be displayed/requested from user.

Signed-off-by: Dinesh Prasanth M K <[email protected]>
@SilleBille
Copy link
Author

This patch is overridden by #2 Closing this

@SilleBille SilleBille closed this Apr 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant