krb5_storage(3)

πŸ“¦
version 7.8.0 Β· 3 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, epel 10, epel 9, fedora 43, fedora 44

πŸ’Ύ krb5_storage β€” Heimdal Kerberos 5 library, section 3

okay bestie, sit DOWN, because we're about to talk about storage β€” the Heimdal Kerberos 5 storage functions. this is the whole vibe of krb5_storage(3), and it's a lot, so buckle up. ✨


🌸 NAME 🌸

krb5_storage β€” Heimdal Kerberos 5 storage functions πŸ’–


✨ SYNOPSIS ✨

🫢 Functions

no cap, there are SO many of these. every single one of them, exactly as written, here we go:

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_set_flags
    (krb5_storage *sp, krb5_flags flags)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_clear_flags
    (krb5_storage *sp, krb5_flags flags)
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_storage_is_flags
    (krb5_storage *sp, krb5_flags flags)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_set_byteorder
    (krb5_storage *sp, krb5_flags byteorder)
KRB5_LIB_FUNCTION krb5_flags KRB5_LIB_CALL krb5_storage_get_byteorder
    (krb5_storage *sp)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_set_max_alloc
    (krb5_storage *sp, size_t size)
KRB5_LIB_FUNCTION off_t KRB5_LIB_CALL krb5_storage_seek (krb5_storage
    *sp, off_t offset, int whence)
KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_storage_truncate (krb5_storage
    *sp, off_t offset)
KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_storage_fsync (krb5_storage
    *sp)
KRB5_LIB_FUNCTION krb5_ssize_t KRB5_LIB_CALL krb5_storage_read
    (krb5_storage *sp, void *buf, size_t len)
KRB5_LIB_FUNCTION krb5_ssize_t KRB5_LIB_CALL krb5_storage_write
    (krb5_storage *sp, const void *buf, size_t len)
KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_set_eof_code
    (krb5_storage *sp, int code)
KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_storage_get_eof_code
    (krb5_storage *sp)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_storage_free
    (krb5_storage *sp)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_storage_to_data
    (krb5_storage *sp, krb5_data *data)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_int32
    (krb5_storage *sp, int32_t value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_int64
    (krb5_storage *sp, int64_t value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_uint32
    (krb5_storage *sp, uint32_t value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_uint64
    (krb5_storage *sp, uint64_t value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_int64
    (krb5_storage *sp, int64_t *value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_uint64
    (krb5_storage *sp, uint64_t *value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_int32
    (krb5_storage *sp, int32_t *value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_uint32
    (krb5_storage *sp, uint32_t *value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_int16
    (krb5_storage *sp, int16_t value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_uint16
    (krb5_storage *sp, uint16_t value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_int16
    (krb5_storage *sp, int16_t *value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_uint16
    (krb5_storage *sp, uint16_t *value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_int8
    (krb5_storage *sp, int8_t value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_uint8
    (krb5_storage *sp, uint8_t value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_int8
    (krb5_storage *sp, int8_t *value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_uint8
    (krb5_storage *sp, uint8_t *value)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_data
    (krb5_storage *sp, krb5_data data)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_data
    (krb5_storage *sp, krb5_data *data)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_string
    (krb5_storage *sp, const char *s)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_string
    (krb5_storage *sp, char **string)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_stringz
    (krb5_storage *sp, const char *s)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_stringz
    (krb5_storage *sp, char **string)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_principal
    (krb5_storage *sp, krb5_const_principal p)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_principal
    (krb5_storage *sp, krb5_principal *princ)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_keyblock
    (krb5_storage *sp, krb5_keyblock p)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_keyblock
    (krb5_storage *sp, krb5_keyblock *p)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_times
    (krb5_storage *sp, krb5_times times)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_times
    (krb5_storage *sp, krb5_times *times)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_address
    (krb5_storage *sp, krb5_address p)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_address
    (krb5_storage *sp, krb5_address *adr)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_addrs
    (krb5_storage *sp, krb5_addresses p)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_addrs
    (krb5_storage *sp, krb5_addresses *adr)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_authdata
    (krb5_storage *sp, krb5_authdata auth)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_authdata
    (krb5_storage *sp, krb5_authdata *auth)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_creds
    (krb5_storage *sp, krb5_creds *creds)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_creds
    (krb5_storage *sp, krb5_creds *creds)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_creds_tag
    (krb5_storage *sp, krb5_creds *creds)
KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_creds_tag
    (krb5_storage *sp, krb5_creds *creds)
KRB5_LIB_FUNCTION krb5_storage *KRB5_LIB_CALL krb5_storage_emem (void)
KRB5_LIB_FUNCTION krb5_storage *KRB5_LIB_CALL krb5_storage_from_fd (int
    fd_in)
KRB5_LIB_FUNCTION krb5_storage *KRB5_LIB_CALL krb5_storage_from_mem
    (void *buf, size_t len)
KRB5_LIB_FUNCTION krb5_storage *KRB5_LIB_CALL krb5_storage_from_data
    (krb5_data *data)
KRB5_LIB_FUNCTION krb5_storage *KRB5_LIB_CALL
    krb5_storage_from_readonly_mem (const void *buf, size_t len)
KRB5_LIB_FUNCTION krb5_storage *KRB5_LIB_CALL krb5_storage_from_socket
    (krb5_socket_t sock_in)

πŸ‘‘ Detailed Description

ngl, this is where it all lives. the detailed description is the big picture, and the function documentation below is the receipts. keep scrolling bestie, we got you. πŸ’…


πŸŽ€ Function Documentation πŸŽ€

🌈 krb5_ret_address

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_address
    (krb5_storage * sp, krb5_address * adr)

reads an address block out of the storage. it's giving "gimme that address." πŸ¦‹

Parameters

  • sp β€” the storage buffer to write to
  • adr β€” the address block read from storage

Returns

0 on success, a Kerberos 5 error code on failure. periodt. ✨


🌈 krb5_ret_addrs

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_addrs (krb5_storage
    * sp, krb5_addresses * adr)

reads an addresses block from the storage. plural. multiple addresses. the whole squad. 🫢

Parameters

  • sp β€” the storage buffer to write to
  • adr β€” the addresses block read from storage

Returns

0 on success, a Kerberos 5 error code on failure. πŸ’–


🌈 krb5_ret_authdata

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_authdata
    (krb5_storage * sp, krb5_authdata * auth)

reads the auth data from the storage. iconic. πŸ”₯

Parameters

  • sp β€” the storage buffer to write to
  • auth β€” the auth data block read from storage

Returns

0 on success, a Kerberos 5 error code on failure. πŸŽ€


🌈 krb5_ret_creds

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_creds (krb5_storage
    * sp, krb5_creds * creds)

reads a credentials block from the storage. credentials are the main character here, fr fr. πŸ‘‘

Parameters

  • sp β€” the storage buffer to write to
  • creds β€” the credentials block read from storage

Returns

0 on success, a Kerberos 5 error code on failure. πŸ’œ


🌈 krb5_ret_creds_tag

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_creds_tag
    (krb5_storage * sp, krb5_creds * creds)

reads a tagged credentials block from the storage. tagged, as in it came with a little label, and yes that's a serve. 🌸

Parameters

  • sp β€” the storage buffer to write to
  • creds β€” the credentials block read from storage

Returns

0 on success, a Kerberos 5 error code on failure. ✨


🌈 krb5_ret_data

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_data (krb5_storage
    * sp, krb5_data * data)

parses some data out of the storage. this one reads from the buffer, so pay attention to which direction you're going bestie. πŸ™ˆ

Parameters

  • sp β€” the storage buffer to read from
  • data β€” the parsed data

Returns

0 on success, a Kerberos 5 error code on failure. πŸ“


🌈 krb5_ret_int16

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_int16 (krb5_storage
    * sp, int16_t * value)

reads an int16 from storage. the byte order is controlled by the settings on the storage β€” see krb5_storage_set_byteorder(). iykyk. πŸ’…

Parameters

  • sp β€” the storage to write too
  • value β€” the value read from the buffer

Returns

0 for success, or a Kerberos 5 error code on failure. πŸ¦‹


🌈 krb5_ret_int32

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_int32 (krb5_storage
    * sp, int32_t * value)

reads an int32 from storage. same deal β€” byte order is controlled by the settings on the storage, see krb5_storage_set_byteorder(). 🌈

Parameters

  • sp β€” the storage to write too
  • value β€” the value read from the buffer

Returns

0 for success, or a Kerberos 5 error code on failure. πŸ’–


🌈 krb5_ret_int64

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_int64 (krb5_storage
    * sp, int64_t * value)

reads an int64 from storage. yes, still byte order-controlled by the storage settings, see krb5_storage_set_byteorder(). sixty-four whole bits of it. 😭

Parameters

  • sp β€” the storage to write too
  • value β€” the value read from the buffer

Returns

0 for success, or a Kerberos 5 error code on failure. ⭐


🌈 krb5_ret_int8

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_int8 (krb5_storage
    * sp, int8_t * value)

reads an int8 from storage. that's it. tiny. one byte. precious. πŸŽ€

Parameters

  • sp β€” the storage to write too
  • value β€” the value read from the buffer

Returns

0 for success, or a Kerberos 5 error code on failure. πŸ’œ


🌈 krb5_ret_keyblock

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_keyblock
    (krb5_storage * sp, krb5_keyblock * p)

reads a keyblock from the storage. ✨ heads up bestie: you free it using krb5_free_keyblock() when you're done with it. don't ghost your memory. 🧚

Parameters

  • sp β€” the storage buffer to write to
  • p β€” the keyblock read from storage, free using krb5_free_keyblock()

Returns

0 on success, a Kerberos 5 error code on failure. πŸ”₯


🌈 krb5_ret_principal

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_principal
    (krb5_storage * sp, krb5_principal * princ)

parses a principal from the storage. the literal main character of Kerberos, no exaggeration. πŸ‘‘

Parameters

  • sp β€” the storage buffer to read from
  • princ β€” the parsed principal

Returns

0 on success, a Kerberos 5 error code on failure. πŸ’–


🌈 krb5_ret_string

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_string
    (krb5_storage * sp, char ** string)

parses a string from the storage. a whole string. slay. 🌸

Parameters

  • sp β€” the storage buffer to read from
  • string β€” the parsed string

Returns

0 on success, a Kerberos 5 error code on failure. 🫢

krb5_ret_stringz()</p> β€” grab a lil string that knows when to stop ✨

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_stringz
    (krb5_storage * sp, char ** string)

Okay so this one parses a zero terminated string out of the storage. Cute, self-contained, knows its own boundaries. πŸ’…

  • Parameters
    • sp β€” the storage buffer to read from
    • string β€” the parsed string
  • Returns β€” 0 on success, a Kerberos 5 error code on failure.

krb5_ret_times()</p> β€” time block go brrr πŸ•°οΈ

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_times (krb5_storage
    * sp, krb5_times * times)

Reads a whole times block out of the storage. Not one time, a block of times. she's thorough. πŸ’–

  • Parameters
    • sp β€” the storage buffer to write to
    • times β€” the times block read from storage
  • Returns β€” 0 on success, a Kerberos 5 error code on failure.

krb5_ret_uint16()</p> β€” smol number, big vibes 🌸

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_uint16
    (krb5_storage * sp, uint16_t * value)

Reads a int16 from storage. The byte order is controlled by the settings on the storage, see krb5_storage_set_byteorder(). Don't fight it, bestie, the storage decides. 🫢

  • Parameters
    • sp β€” the storage to write too
    • value β€” the value read from the buffer
  • Returns β€” 0 for success, or a Kerberos 5 error code on failure.

krb5_ret_uint32()</p> β€” the classic ✨

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_uint32
    (krb5_storage * sp, uint32_t * value)

Reads a uint32 from storage. Byte order? Same deal, it's all up to the settings on the storage, peep krb5_storage_set_byteorder().

  • Parameters
    • sp β€” the storage to write too
    • value β€” the value read from the buffer
  • Returns β€” 0 for success, or a Kerberos 5 error code on failure.

krb5_ret_uint64()</p> β€” the big one πŸ’ͺ

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_uint64
    (krb5_storage * sp, uint64_t * value)

Reads a uint64 from storage. Yup, byte order is controlled by the settings on the storage, see krb5_storage_set_byteorder(). It's giving consistency, we love that for us. πŸ‘‘

  • Parameters
    • sp β€” the storage to write too
    • value β€” the value read from the buffer
  • Returns β€” 0 for success, or a Kerberos 5 error code on failure.

krb5_ret_uint8()</p> β€” baby byte energy πŸ“

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_ret_uint8 (krb5_storage
    * sp, uint8_t * value)

Reads a uint8 from storage. That's it. That's the whole job. iconic honestly.

  • Parameters
    • sp β€” the storage to write too
    • value β€” the value read from the buffer
  • Returns β€” 0 for success, or a Kerberos 5 error code on failure.

krb5_storage_clear_flags()</p> β€” un-set those flags, periodt πŸŽ€

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_clear_flags (krb5_storage
    * sp, krb5_flags flags)

Clears the flags on a storage buffer. Yes it returns void, it just does the thing, no receipts needed. πŸ’…

  • Parameters
    • sp β€” the storage buffer to clear the flags on
    • flags β€” the flags to clear

krb5_storage_emem()</p> β€” elastic memory backend, she stretches 🧚

KRB5_LIB_FUNCTION krb5_storage* KRB5_LIB_CALL krb5_storage_emem (void)

Creates an elastic (allocating) memory storage backend. Memory is allocated on demand β€” like, when it needs it, it gets it. No hoarding. 🌈

Free the returned krb5_storage with krb5_storage_free() or it will simply live with you forever, rent free. 😭
  • Returns β€” A krb5_storage on success, or NULL on out of memory error.
  • See also
    • krb5_storage_from_mem()
    • krb5_storage_from_readonly_mem()
    • krb5_storage_from_fd()
    • krb5_storage_from_data()
    • krb5_storage_from_socket()

krb5_storage_free()</p> β€” release her, let her go πŸ¦‹

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_storage_free
    (krb5_storage * sp)

Frees a krb5 storage. Closure! Growth! We love to see it. πŸ’–

  • Parameters
    • sp β€” the storage to free.
  • Returns β€” An Kerberos 5 error code.

krb5_storage_from_data()</p> β€” fixed size memory block, no notes πŸ’…

KRB5_LIB_FUNCTION krb5_storage* KRB5_LIB_CALL krb5_storage_from_data
    (krb5_data * data)

Creates a fixed size memory storage block. Fixed size, bestie. She's not growing, she's not shrinking, she's exactly what she is. main character energy.

  • Returns β€” A krb5_storage on success, or NULL on out of memory error.
  • See also
    • krb5_storage_mem()
    • krb5_storage_from_mem()
    • krb5_storage_from_readonly_mem()
    • krb5_storage_from_fd()

krb5_storage_from_fd()</p> β€” file descriptor, but make it storage πŸ—‚οΈ

KRB5_LIB_FUNCTION krb5_storage* KRB5_LIB_CALL krb5_storage_from_fd (int
    fd_in)
  • Returns β€” A krb5_storage on success, or NULL on out of memory error.
  • See also
    • krb5_storage_emem()
    • krb5_storage_from_mem()
    • krb5_storage_from_readonly_mem()
    • krb5_storage_from_data()
    • krb5_storage_from_socket()

krb5_storage_from_mem()</p> β€” memory block, fixed size, iconic ✨

KRB5_LIB_FUNCTION krb5_storage* KRB5_LIB_CALL krb5_storage_from_mem (void *
    buf, size_t len)

Creates a fixed size memory storage block.

  • Returns β€” A krb5_storage on success, or NULL on out of memory error.
  • See also
    • krb5_storage_mem()
    • krb5_storage_from_readonly_mem()
    • krb5_storage_from_data()
    • krb5_storage_from_fd()
    • krb5_storage_from_socket()

krb5_storage_from_readonly_mem()</p> β€” look, don't touch πŸ™ˆ

KRB5_LIB_FUNCTION krb5_storage* KRB5_LIB_CALL krb5_storage_from_readonly_mem
    (const void * buf, size_t len)

Creates a fixed size memory storage block that is read only. She's behind the velvet rope, bestie. Admire from a distance. πŸŽ€

  • Returns β€” A krb5_storage on success, or NULL on out of memory error.
  • See also
    • krb5_storage_mem()
    • krb5_storage_from_mem()
    • krb5_storage_from_data()
    • krb5_storage_from_fd()

krb5_storage_from_socket()</p> β€” socket storage, networking era πŸ”₯

KRB5_LIB_FUNCTION krb5_storage* KRB5_LIB_CALL krb5_storage_from_socket
    (krb5_socket_t sock_in)
  • Returns β€” A krb5_storage on success, or NULL on out of memory error.
  • See also
    • krb5_storage_emem()
    • krb5_storage_from_mem()
    • krb5_storage_from_readonly_mem()
    • krb5_storage_from_data()
    • krb5_storage_from_fd()

krb5_storage_fsync()</p> β€” push it to the backing store πŸ’Ύ

KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_storage_fsync (krb5_storage * sp)

Syncs the storage buffer to its backing store. And if there's, like, no backing store? This function will return success anyway. She's flexible like that. 🫢

  • Parameters
    • sp β€” the storage buffer to sync
  • Returns β€” A Kerberos 5 error code

krb5_storage_get_byteorder()</p> β€” which way do the bytes go πŸ€”

KRB5_LIB_FUNCTION krb5_flags KRB5_LIB_CALL krb5_storage_get_byteorder
    (krb5_storage * sp)

Returns the current byteorder for the buffer. For the actual list of byte order constants, go peep krb5_storage_set_byteorder().


krb5_storage_get_eof_code()</p> β€” what happens at the end of storage 😳

KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_storage_get_eof_code (krb5_storage
    * sp)

Gets the return code that will be used when the end of storage is reached.

  • Parameters
    • sp β€” the storage
  • Returns β€” storage error code

krb5_storage_is_flags()</p> β€” flag check, true or false, no in between 🌸

KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL krb5_storage_is_flags
    (krb5_storage * sp, krb5_flags flags)

Returns true or false depending on if the storage flags is set or not.

NB β€” testing for the flag 0 always returns true. Every time. No exceptions. Not me finding that out the hard way. πŸ’€
  • Parameters
    • sp β€” the storage buffer to check flags on
    • flags β€” The flags to test for
  • Returns β€” true if all the flags are set, false if not.

krb5_storage_read()</p> β€” read era, we're reading πŸ“–

KRB5_LIB_FUNCTION krb5_ssize_t KRB5_LIB_CALL krb5_storage_read (krb5_storage
    * sp, void * buf, size_t len)

Reads to the storage buffer.

  • Parameters
    • sp β€” the storage buffer to read from
    • buf β€” the buffer to store the data in
    • len β€” the length to read
  • Returns β€” The length of data read (can be shorter then len), or negative on error.
Heads up bestie: shorter-than-len is normal, it's not a bug, it's just how she reads. Don't come for her. πŸ™ˆ

krb5_storage_seek()</p> β€” slide to a new offset πŸ’…

KRB5_LIB_FUNCTION off_t KRB5_LIB_CALL krb5_storage_seek (krb5_storage * sp,
    off_t offset, int whence)

Seeks to a new offset. It's giving scroll bar but for storage.

  • Parameters
    • sp β€” the storage buffer to seek in.
    • offset β€” the offset to seek
    • whence β€” relateive searching, SEEK_CUR from the current position, SEEK_END from the end, SEEK_SET absolute from the start.
  • Returns β€” The new current offset

krb5_storage_set_byteorder()</p> β€” pick a lane, bytes πŸŽ€

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_set_byteorder
    (krb5_storage * sp, krb5_flags byteorder)

Sets the new byte order of the storage buffer.

  • Parameters
    • sp β€” the storage buffer to set the byte order for.
    • byteorder β€” the new byte order.

The byte order are: KRB5_STORAGE_BYTEORDER_BE, KRB5_STORAGE_BYTEORDER_LE and KRB5_STORAGE_BYTEORDER_HOST. Pick your fighter. πŸ‘‘


krb5_storage_set_eof_code()</p> β€” set the vibe for "we're done here" πŸ¦‹

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_set_eof_code (krb5_storage
    * sp, int code)

Sets the return code that will be used when the end of storage is reached.

  • Parameters
    • sp β€” the storage
    • code β€” the error code to return on end of storage

krb5_storage_set_flags()</p> β€” add flags by or-ing them in ✨

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_set_flags (krb5_storage *
    sp, krb5_flags flags)

Adds the flags on a storage buffer by or-ing in the flags to the buffer.

  • Parameters
    • sp β€” the storage buffer to set the flags on
    • flags β€” the flags to set

krb5_storage_set_max_alloc()</p> β€” set the limit, queen πŸ’œ

KRB5_LIB_FUNCTION void KRB5_LIB_CALL krb5_storage_set_max_alloc
    (krb5_storage * sp, size_t size)

Sets the max alloc value.

  • Parameters
    • sp β€” the storage buffer set the max allow for
    • size β€” maximum size to allocate, use 0 to remove limit
0 = no limit. She's unhinged and free. 😭

krb5_storage_to_data()</p> β€” copy the content out, free it after 🌈

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_storage_to_data
    (krb5_storage * sp, krb5_data * data)

Copies the contnent of storage.

  • Parameters
    • sp β€” the storage to copy to a data
    • data β€” the copied data, free with krb5_data_free()
  • Returns β€” 0 for success, or a Kerberos 5 error code on failure.
Bestie please krb5_data_free() that data when you're done. It's not optional, it's a lifestyle. 🫢

krb5_storage_truncate()</p> β€” chop it down to size πŸ’€

KRB5_LIB_FUNCTION int KRB5_LIB_CALL krb5_storage_truncate (krb5_storage *
    sp, off_t offset)

Truncates the storage buffer in sp to offset. Everything past that? Gone. poof. πŸŽ€

  • Parameters
    • sp β€” the storage buffer to truncate.
    • offset β€” the offset to truncate too.
  • Returns β€” An Kerberos 5 error code.

krb5_storage_write()</p> β€” writing era, we're putting it in πŸ“

KRB5_LIB_FUNCTION krb5_ssize_t KRB5_LIB_CALL krb5_storage_write
    (krb5_storage * sp, const void * buf, size_t len)

Writes to the storage buffer.

  • Parameters
    • sp β€” the storage buffer to write to
    • buf β€” the buffer to write to the storage buffer
    • len β€” the length to write
  • Returns β€” The length of data written (can be shorter then len), or negative on error.
Same deal as read: shorter than len is allowed and normal. It's not a personality flaw. πŸ¦‹

krb5_store_address()</p> β€” drop an address block in there 🏠

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_address
    (krb5_storage * sp, krb5_address p)

Writes a address block to storage.

  • Parameters
    • sp β€” the storage buffer to write to
    • p β€” the address block to write.
  • Returns β€” 0 on success, a Kerberos 5 error code on failure.

krb5_store_addrs()</p> β€” now a whole bunch of addresses 🏘️

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_addrs
    (krb5_storage * sp, krb5_addresses p)

Writes a addresses block to storage. Plural. She's bringing friends. ✨

  • Parameters
    • sp β€” the storage buffer to write to
    • p β€” the addresses block to write.
  • Returns β€” 0 on success, a Kerberos 5 error code on failure.

krb5_store_authdata()</p> β€” auth data, stored with care πŸ”

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_authdata
    (krb5_storage * sp, krb5_authdata auth)

Writes a auth data block to storage.

  • Parameters
    • sp β€” the storage buffer to write to
    • auth β€” the auth data block to write.
  • Returns β€” 0 on success, a Kerberos 5 error code on failure.

krb5_store_creds()</p> β€” credentials, stored, slay πŸ‘‘

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_creds
    (krb5_storage * sp, krb5_creds * creds)

Writes a credentials block to storage.

  • Parameters
    • sp β€” the storage buffer to write to
    • creds β€” the creds block to write.
  • Returns β€” 0 on success, a Kerberos 5 error code on failure.

krb5_store_creds_tag()</p> β€” same creds, but tagged 🏷️

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_creds_tag
    (krb5_storage * sp, krb5_creds * creds)

Writes a tagged credentials block to storage.

  • Parameters
    • sp β€” the storage buffer to write to
    • creds β€” the creds block to write.
  • Returns β€” 0 on success, a Kerberos 5 error code on failure.

krb5_store_data()</p> β€” data with a length prefix, not padded πŸ’Ύ

KRB5_LIB_FUNCTION krb5_error_code KRB5_LIB_CALL krb5_store_data
    (krb5_storage * sp, krb5_data data)

Stores a data to the storage. The data is stored with an int32 as lenght plus the data (not padded). So like, length first, then the actual goods. No filler, no padding, she's lean. πŸ”₯

  • Parameters
    • sp β€” the storage buffer to write to
    • data β€” the buffer to store.
  • Returns β€” 0 on success, a Kerberos 5 error code on failure.

πŸ’Ύ krb5_store_int16 ✨

krb5_error_code KRB5_LIB_CALL krb5_store_int16(krb5_storage * sp, int16_t value)

okay so this one drops an int16 into your storage bestie πŸ’– and the byte order? that's not its decision, that's whatever you set on the storage, see krb5_storage_set_byteorder() β€” the storage is the one with opinions here, fr fr.

Parameters

  • sp β€” the storage to write too
  • value β€” the value to store

Returns

0 for success, or a Kerberos 5 error code on failure. periodt.


πŸ’Ύ krb5_store_int32 ✨

krb5_error_code KRB5_LIB_CALL krb5_store_int32(krb5_storage * sp, int32_t value)

same vibe, bigger number 🫢 stores an int32, and once again the byte order is completely controlled by the settings on the storage β€” go check krb5_storage_set_byteorder() iykyk.

Parameters

  • sp β€” the storage to write too
  • value β€” the value to store

Returns

0 for success, or a Kerberos 5 error code on failure.


πŸ’Ύ krb5_store_int64 ✨

krb5_error_code KRB5_LIB_CALL krb5_store_int64(krb5_storage * sp, int64_t value)

the big one 😀 an int64 goes in, byte order still governed by the settings on the storage, see krb5_storage_set_byteorder(). she's consistent, she's iconic.

Parameters

  • sp β€” the storage to write too
  • value β€” the value to store

Returns

0 for success, or a Kerberos 5 error code on failure.


πŸ’Ύ krb5_store_int8 🌸

krb5_error_code KRB5_LIB_CALL krb5_store_int8(krb5_storage * sp, int8_t value)

tiny little int8, no byte order drama here β€” it just stores an int8 to storage, that's the whole post πŸŽ€.

Parameters

  • sp β€” the storage to write too
  • value β€” the value to store

Returns

0 for success, or a Kerberos 5 error code on failure.


πŸ”‘ krb5_store_keyblock πŸ‘‘

krb5_error_code KRB5_LIB_CALL krb5_store_keyblock(krb5_storage * sp, krb5_keyblock p)

storing a whole keyblock to the storage. main character energy honestly πŸ’….

Parameters

  • sp β€” the storage buffer to write to
  • p β€” the keyblock to write

Returns

0 on success, a Kerberos 5 error code on failure.


πŸͺͺ krb5_store_principal πŸ¦‹

krb5_error_code KRB5_LIB_CALL krb5_store_principal(krb5_storage * sp, krb5_const_principal p)

writes a principal block to storage πŸ’œ yes bestie, the whole principal block.

Parameters

  • sp β€” the storage buffer to write to
  • p β€” the principal block to write.

Returns

0 on success, a Kerberos 5 error code on failure.


🧡 krb5_store_string πŸ“

krb5_error_code KRB5_LIB_CALL krb5_store_string(krb5_storage * sp, const char * s)

stores a string to the buffer ✨ and the layout is very specific so listen up: the data is formated as an len:uint32 plus the string itself, not padded. that's it, that's the format, no extra padding hiding in there, no cap 🫢.

Parameters

  • sp β€” the storage buffer to write to
  • s β€” the string to store.

Returns

0 on success, a Kerberos 5 error code on failure.


🚫 krb5_store_stringz 🌈

krb5_error_code KRB5_LIB_CALL krb5_store_stringz(krb5_storage * sp, const char * s)

stores a zero terminated string to the buffer πŸ’– the data is stored one character at a time until a NUL is stored. one by one by one, she's thorough like that.

Parameters

  • sp β€” the storage buffer to write to
  • s β€” the string to store.

Returns

0 on success, a Kerberos 5 error code on failure.


⏰ krb5_store_times βŒ›

krb5_error_code KRB5_LIB_CALL krb5_store_times(krb5_storage * sp, krb5_times times)

writes a times block to storage ⭐ time really said "let me be stored" and we said yes.

Parameters

  • sp β€” the storage buffer to write to
  • times β€” the times block to write.

Returns

0 on success, a Kerberos 5 error code on failure.


πŸ’Ύ krb5_store_uint16 ✨

krb5_error_code KRB5_LIB_CALL krb5_store_uint16(krb5_storage * sp, uint16_t value)

an unsigned uint16 into storage, and you already know the drill: byte order is controlled by the settings on the storage, see krb5_storage_set_byteorder() πŸ’….

Parameters

  • sp β€” the storage to write too
  • value β€” the value to store

Returns

0 for success, or a Kerberos 5 error code on failure.


πŸ’Ύ krb5_store_uint32 ✨

krb5_error_code KRB5_LIB_CALL krb5_store_uint32(krb5_storage * sp, uint32_t value)

stores a uint32, byte order controlled by the storage settings again β€” krb5_storage_set_byteorder() is literally the girl running the whole show here 😭.

Parameters

  • sp β€” the storage to write too
  • value β€” the value to store

Returns

0 for success, or a Kerberos 5 error code on failure.


πŸ’Ύ krb5_store_uint64 ✨

krb5_error_code KRB5_LIB_CALL krb5_store_uint64(krb5_storage * sp, uint64_t value)

uint64 time 😀 byte order still comes from the settings on the storage, see krb5_storage_set_byteorder(). big number, big vibes.

Parameters

  • sp β€” the storage to write too
  • value β€” the value to store

Returns

0 for success, or a Kerberos 5 error code on failure.


πŸ’Ύ krb5_store_uint8 🌸

krb5_error_code KRB5_LIB_CALL krb5_store_uint8(krb5_storage * sp, uint8_t value)

just a lil uint8 going to storage, no byte order discourse, no complications, a peaceful queen πŸŽ€.

Parameters

  • sp β€” the storage to write too
  • value β€” the value to store

Returns

0 for success, or a Kerberos 5 error code on failure.


πŸ‘‘ AUTHOR πŸ‘‘

Generated automatically by Doxygen for Heimdal Kerberos 5 library from the source code. yes bestie the docs wrote themselves, that's the flex πŸ’…βœ¨


and that's the whole page!! this was Version 7.8.0, dated Tue Nov 15 2022, from the Heimdal Kerberos 5 library β€” mwah, slay, go store something πŸ«ΆπŸ’–

πŸ“¦ where this page comes from