HP Open Source Security for OpenVMS Volume 3: Kerberos > Chapter 6 KRB5 (Kerberos V5) Application Programming Interface

krb5_set_password — Implements set password per RFC 3244

  Table of Contents



C Prototype

krb5_error_code krb5_set_password (
krb5_context context,
krb5_creds *creds,
char *newpw,
krb5_principal change_password_for,
int *result_code,
krb5_data *result_code_string,
krb5_data *result_string );


context (input/output) 

The context structure.

creds (input) 

The Kerberos credentials.

newpw (input) 

The new password to be set.

change_password_for (input) 

The principal for which the password change is to be performed. If NULL, then the change is to be done on the current principal. If nonNULL, the change is preformed on the principal name passed in change_password_for.

result_code (output) 

A pointer to the result code returned from the remote system.

result_code_string (output) 

A pointer to the result code translated into a readable message.

result_string (output) 

A pointer to the result data returned from the remote system.


This routine allows a new password to be set in a manner that is interoperable with Windows implementations, per RFC 3244.

Return Values

This routine returns the following KRB5 status codes:


Successful completion.

INVALID_SOCKETInvalid socket.
ECONNREFUSEDConnection refused.


Host unreachable.


Connection aborted.


Connection timed out.


Insufficient memory.