KNET_GET_CRYPTO_LIST(3)

πŸ’– KNET_GET_CRYPTO_LIST(3) β€” the Kronosnet Programmer's Manual one, bestie πŸ’–

okay so. hi. welcome to knet_get_crypto_list(3), a page from the Kronosnet Programmer's Manual, and honestly? she's a whole vibe. let's get into it 🫢


✨ NAME ✨

knet_get_crypto_list β€” Get a list of supported crypto libraries.

like, all of them. the roster. the lineup. the crypto girlies πŸ’…


🌸 SYNOPSIS 🌸

#include <libknet.h>

int knet_get_crypto_list(
    struct knet_crypto_info   *crypto_list,
    size_t                    *crypto_list_entries
);

look at her. two args. no drama. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

knet_get_crypto_list

  • crypto_list β€” array of struct knet_crypto_info *. If it's NULL then only the number of structs is returned in crypto_list_entries, which lets you allocate sufficient space yourself first. bestie, this is the "let me peek at the menu before I order" move πŸ“ libknet does not allow more than 256 crypto methods at the moment. it is safe to allocate 256 structs to avoid calling knet_get_crypto_list twice.
  • crypto_list_entries β€” returns the number of structs in crypto_list.

so like, you either ask twice (once for the count, once for the goods) or you just send it with 256 and call it once. main character efficiency, no cap 😌


πŸŽ€ STRUCTURES πŸŽ€

Structure returned from get_crypto_list() containing information about the installed cryptographic systems.

struct knet_crypto_info {
    const char   *name;        /* Name of the crypto library/ openssl, nss,etc .. */
    uint8_t       properties;  /* Properties - currently unused */
    char          pad[256];    /* Currently unused padding */
};

so name is the actual tea β€” openssl, nss, etc. properties is currently unused (she's just there, being cute, contributing nothing πŸ™ˆ) and pad[256] is currently unused padding, also just vibing. iconic honestly.


πŸ‘‘ RETURN VALUE πŸ‘‘

knet_get_crypto_list returns 0 on success, -1 on error and errno is set.

not to be dramatic but if you see that -1, check errno. she's always trying to tell you something πŸ’€

🌈 SEE ALSO 🌈

the group chat. the whole extended family. fr fr, every single one:


Copyright (C) 2010-2026 Red Hat, Inc. All rights reserved.


kronosnet Β· 2026-07-20 Β· KNET_GET_CRYPTO_LIST(3)

and that's the page bestie πŸ’– go get your crypto list, allocate your 256 structs like the icon you are, and remember: errno never lies. slay πŸ¦‹βœ¨πŸ‘‘

πŸ“¦ where this page comes from