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

Enable TLS-only client authentication by default #117

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions example/client/README
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ To run the example:
5. Optionally, you can use a certificate to identify the EST client
to the server instead of specifying the HTTP user name/password.
Now that you've enrolled a certificate in step #3
above, you can use that certificate to enroll again. Note, your
EST server should be configured not to force HTTP authentication.
above, you can use that certificate to enroll again.

First, convert the pkcs7 cert from step 3 to a PEM cert:

Expand Down
20 changes: 7 additions & 13 deletions example/server/estserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ static int http_digest_auth = 0;
static int http_basic_auth = 0;
static int http_token_auth = 0;
static int http_auth_disable = 0;
static int disable_forced_http_auth = 0;
static int enable_enhcd_cert_auth = 0;
static int set_cert_auth_ah_pwd = 0;
static EST_ECA_CSR_CHECK_FLAG enhcd_cert_csr_check_on = ECA_CSR_CHECK_OFF;
Expand Down Expand Up @@ -232,7 +231,6 @@ static void show_usage_and_exit (void)
" -t Enable check for binding client PoP to the TLS UID\n"
" -m <seconds> Simulate manual CA enrollment\n"
" -n Disable HTTP authentication (TLS client auth required)\n"
" -o Disable HTTP authentication when TLS client auth succeeds\n"
" -h Use HTTP Digest auth instead of Basic auth\n"
" -b Use HTTP Basic auth. Causes explicit call to set Basic auth\n"
" -p <num> TCP port number to listen on\n"
Expand Down Expand Up @@ -2244,9 +2242,6 @@ int main (int argc, char **argv)
case 'n':
http_auth_disable = 1;
break;
case 'o':
disable_forced_http_auth = 1;
break;
case 'v':
verbose = 1;
break;
Expand Down Expand Up @@ -2509,14 +2504,13 @@ int main (int argc, char **argv)
exit(1);
}
}
if (disable_forced_http_auth) {
if (verbose)
printf(
"\nDisabling HTTP authentication when TLS client auth succeeds\n");
if (est_set_http_auth_required(ectx, HTTP_AUTH_NOT_REQUIRED)) {
printf("\nUnable to disable required HTTP auth. Aborting!!!\n");
exit(1);
}

if (verbose)
printf(
"\nDisabling HTTP authentication when TLS client auth succeeds\n");
if (est_set_http_auth_required(ectx, HTTP_AUTH_NOT_REQUIRED)) {
printf("\nUnable to disable required HTTP auth. Aborting!!!\n");
exit(1);
}

if (http_digest_auth) {
Expand Down
2 changes: 1 addition & 1 deletion java/src/com/cisco/c3m/est/test/DT/dt_start_estserver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ echo "Starting dt_start_estserver.sh ..."
cd $WORKSPACE/example/server

# this is the main estserver instance that should be used for simple enrolls
$WORKSPACE/install/bin/estserver -o -p $EST_DT0_PORT1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
$WORKSPACE/install/bin/estserver -p $EST_DT0_PORT1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
sleep 1
# the following estserver is set to reject the first attempted connection so we can test catching exceptions
$WORKSPACE/install/bin/estserver -p $EST_DT0_PORT2 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 -m 3600 &
Expand Down
2 changes: 1 addition & 1 deletion java/src/com/cisco/c3m/est/test/DT/dt_start_estserver1.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo There are $# arguments to $0: $*
echo first arguement will be used as the port number = $1

# this is the main estserver instance that should be used for simple enrolls
$WORKSPACE/install/bin/estserver -o -p $1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
$WORKSPACE/install/bin/estserver -p $1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
sleep 1
# the following estserver is set to reject the first attempted connection so we can test catching exceptions
$WORKSPACE/install/bin/estserver -p $2 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 -m 3600 &
Expand Down
2 changes: 1 addition & 1 deletion java/src/com/cisco/c3m/est/test/DT/dt_start_estserver2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ echo first arguement will be used as the port number = $1
cd $WORKSPACE/example/server

# this is the main estserver instance that should be used for simple reenrolls
$WORKSPACE/install/bin/estserver -o -p $1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
$WORKSPACE/install/bin/estserver -p $1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
sleep 3

echo "dt_start_estserver2.sh is complete..."
Expand Down
2 changes: 1 addition & 1 deletion java/src/com/cisco/c3m/est/test/DT/dt_start_estserver3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "Starting dt_start_estserver3.sh ..."
cd $WORKSPACE/example/server

# this is the main estserver instance that should be used for simple enrolls
$WORKSPACE/install/bin/estserver -o -p $EST_CACERTS_PORT_NF --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
$WORKSPACE/install/bin/estserver -p $EST_CACERTS_PORT_NF --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
sleep 3

echo "dt_start_estserver3.sh is complete..."
Expand Down
2 changes: 1 addition & 1 deletion java/src/com/cisco/c3m/est/test/DT/dt_start_estserver4.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ echo first arguement will be used as the port number = $1
cd $WORKSPACE/example/server

# this is the main estserver instance that should be used for simple reenrolls
$WORKSPACE/install/bin/estserver -o -p $1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
$WORKSPACE/install/bin/estserver -p $1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
sleep 3

echo "dt_start_estserver4.sh is complete..."
Expand Down
2 changes: 1 addition & 1 deletion java/src/com/cisco/c3m/est/test/DT/dt_start_estserver5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ echo "Starting dt_start_estserver5.sh ..."
cd $WORKSPACE/example/server

# this is the main estserver instance that should be used for simple reenrolls
$WORKSPACE/install/bin/estserver -o -p $EST_DT5_PORT1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
$WORKSPACE/install/bin/estserver -p $EST_DT5_PORT1 --srp passwd.srpv -c estCA/private/estservercertandkey.pem -k estCA/private/estservercertandkey.pem -r estrealm -v -6 -d 60 &
sleep 3

echo "dt_start_estserver5.sh is complete..."
Expand Down