LIBRESSL-RSA_SIGN_ASN1_OCTET_STRING(3)

πŸ“¦ version 4.4.0, in alpine 3.24, arch rolling

πŸ’… NAME πŸ’…

okay so bestie, welcome to the RSA_SIGN_ASN1_OCTET_STRING(3) page β€” it lives in section 3, the Library Functions Manual, and it's literally all about the two functions RSA_sign_ASN1_OCTET_STRING and RSA_verify_ASN1_OCTET_STRING, aka RSA signatures πŸŽ€


✨ SYNOPSIS ✨

like, here's the whole thing, character for character, no cap:

library β€œlibcrypto” #include <openssl/rsa.h>

int
RSA_sign_ASN1_OCTET_STRING(int dummy, unsigned char *m,
    unsigned int m_len, unsigned char *sigret, unsigned int *siglen,
    RSA *rsa);

int
RSA_verify_ASN1_OCTET_STRING(int dummy, unsigned char *m,
    unsigned int m_len, unsigned char *sigbuf, unsigned int siglen,
    RSA *rsa);

🌸 DESCRIPTION 🌸

So RSA_sign_ASN1_OCTET_STRING() signs the octet string m of size m_len using the private key rsa β€” and that key is represented in DER using PKCS #1 padding, periodt πŸ’… It drops the signature into sigret and the signature size into siglen.

⚠️ Important vibe check: sigret must point to RSA_size(rsa) bytes of memory. Like, don't skimp on the buffer, bestie, it will not end well 😭

And dummy? Completely ignored. Not even a little bit. It's giving decorative parameter energy 🫢

RSA_verify_ASN1_OCTET_STRING() is the other half of the duo β€” it verifies that the signature sigbuf of size siglen is the DER representation of a given octet string m of size m_len. dummy is ignored here too (iconic of it πŸ™ˆ), and rsa is the signer's public key.


πŸŽ€ RETURN VALUES πŸŽ€

  • RSA_sign_ASN1_OCTET_STRING() returns 1 on success, or 0 otherwise πŸ’–
  • RSA_verify_ASN1_OCTET_STRING() returns 1 on successful verification, or 0 otherwise πŸ’–

If you gotta know why something flopped, the error codes can be obtained by ERR_get_error(3) β€” go find out, queen πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ HISTORY πŸ‘‘

RSA_sign_ASN1_OCTET_STRING() and RSA_verify_ASN1_OCTET_STRING() first appeared in SSLeay 0.8.0, and they've been available since OpenBSD 2.4 β€” elder emoji status fr fr πŸ”₯


πŸ’€ BUGS πŸ’€

Screenshot this and send it to the group chat: these functions serve no recognizable purpose. That's it. That's the bug note. The manpage said what it said πŸ’€πŸ˜­


so yeah, that's the whole page 🧚 this one's from the Debian crew, dated June 8, 2025, and the page title is RSA_SIGN_ASN1_OCTET_STRING(3) β€” mwah, stan, bye πŸ’œπŸŒˆ

πŸ“¦ where this page comes from