@ -39,12 +39,12 @@ def client_post_cert (client, clVars, show_info = False):
result_post_cert = _result_post_cert [ 1 ] . integer
result_sid = _result_sid [ 1 ] . integer
print _ ( ' client uses certificate %s ' ) % client . CERT_FILE
print _ ( " the client uses certificate %s " ) % client . CERT_FILE
print result_post_cert [ 0 ]
if result_post_cert [ 0 ] == - 4 :
print _ ( " Certificate not found on the server " )
print _ ( ' client uses certificate %s ' ) % client . CERT_FILE
print _ ( ' You can generate a new certificate using --gen-cert-by and ' \
print _ ( " the client uses certificate %s " ) % client . CERT_FILE
print _ ( ' You can generate a new certificate using options --gen-cert-by and ' \
' --get-cert-from ' )
raise Exception ( 3 )
@ -52,7 +52,7 @@ def client_post_cert (client, clVars, show_info = False):
if result_post_cert [ 0 ] == - 3 :
print _ ( " Certificate not sent! " )
elif result_post_cert [ 0 ] == - 2 :
print _ ( " Using upstreamer cert" )
print _ ( " Using the upstream certificate " )
else :
if show_info :
print _ ( " Your certifitate ID = %d " ) % ( result_post_cert [ 0 ] )
@ -122,7 +122,7 @@ def delete_old_cert(client):
def client_post_request ( cert_path , args ) :
if os . path . exists ( cert_path + ' req_id ' ) :
print \
_ ( " You have already sent a signature request for the certificate ." )
_ ( " You already sent a certificate signature request." )
_print ( _ ( " Request ID = %s " ) % open ( cert_path + ' req_id ' , ' r ' ) . read ( ) )
ans = raw_input ( _ ( " Send a new request? y/[n]: " ) )
if not ans . lower ( ) in [ ' y ' , ' yes ' ] :
@ -145,7 +145,7 @@ def client_post_request (cert_path, args):
key = os . path . join ( cert_path , server_host_name + ' .key ' )
csr_file = os . path . join ( cert_path , server_host_name + ' .csr ' )
if os . path . exists ( key ) and os . path . exists ( csr_file ) :
print _ ( ' private key and request now exist ' )
print _ ( " the private key and request now exist " )
ask = raw_input ( _ ( " Create a new private key and request? y/[n]: " ) )
if ask . lower ( ) in [ ' y ' , ' yes ' ] :
passwd = get_password ( )
@ -161,13 +161,13 @@ def client_post_request (cert_path, args):
res = client . service . post_client_request ( request = data , ip = ip , \
mac = mac , client_type = client_type )
if int ( res ) < 0 :
print _ ( " Th is server has not signed the certificate!" )
print _ ( " Th e server has not signed the certificate!" )
return 1
fc = open ( os . path . join ( cert_path , ' req_id ' ) , ' w ' )
fc . write ( res )
fc . close ( )
_print ( _ ( " Your request ID = %s " ) % res + ' . \n ' ,
_ ( " To s ign the certificate i n the server use command" ) + \
_ ( " To s ubmit the certificate request o n the server use command" ) + \
' \n ' + ' cl-core --sign-client ID_CLIENT_REQUEST ' )
return 0
@ -209,16 +209,16 @@ def client_get_cert(cert_path, args):
except IndexError :
ca_root = None
if cert == ' 1 ' :
print _ ( ' Request to sign is rejected! ' )
print _ ( " Signature request rejected! " )
return 1
elif cert == ' 2 ' :
print _ ( " Signature request not review ed yet." )
print _ ( " Signature request not examin ed yet." )
print _ ( " Your request ID = %s " ) % req_id + ' . \n ' , \
_ ( " To s ign the certificate i n the server use command" ) + \
_ ( " To s ubmit the certificate request o n the server use command" ) + \
' \n ' + ' cl-core --sign-client ID_CLIENT_REQUEST '
return 1
elif cert == ' 3 ' :
print _ ( " Signature request not matching earlier data." )
print _ ( " Request or signature not matching earlier data." )
return 1
elif cert == ' 4 ' :
print _ ( " The request was sent from another IP. " )
@ -304,7 +304,7 @@ def client_get_cert(cert_path, args):
print _ ( " filename = " ) , filename
print _ ( " Certificate added " )
else :
print _ ( " A file with CA certificates now exists" )
print _ ( " The file containing the CA certificate now exists" )
return 0
def client_post_auth ( client ) :
@ -316,9 +316,7 @@ def client_post_auth(client):
pass #client_post_cert(client)
else :
#client_post_request(client)
print _ ( " You do not have a certificate. Use --gen-cert-by HOST "
" to generate a new request or --get-cert-from HOST to "
" get a new certificate from the server. " )
print _ ( " You do not have a certificate. Use option --gen-cert-by HOST to generate a new request or --get-cert-from HOST to get a new certificate from the server. " )
raise Exception ( 1 )
# print client.service.versions(sid, VERSION)
except VerifyError , e :