]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
hpke: add "const" qualifier to gnutls_pubkey_t/gnutls_privkey_t
authorDaiki Ueno <ueno@gnu.org>
Mon, 20 Apr 2026 05:30:21 +0000 (14:30 +0900)
committerDaiki Ueno <ueno@gnu.org>
Sat, 25 Apr 2026 01:31:03 +0000 (10:31 +0900)
Signed-off-by: Daiki Ueno <ueno@gnu.org>
lib/hpke/hpke.c
lib/includes/gnutls/hpke.h

index 23ee871206bdda769b6c18690960cde25aa0f1ff..a182cec2f5847eff9eb10b4d27cabd22a6cf3666 100644 (file)
@@ -961,7 +961,8 @@ size_t gnutls_hpke_get_enc_size(const gnutls_hpke_context_t ctx)
  * It returns 0 on success, or a negative error code on failure.
  */
 int gnutls_hpke_encap(gnutls_hpke_context_t ctx, const gnutls_datum_t *info,
-                     gnutls_datum_t *enc, gnutls_pubkey_t receiver_pubkey)
+                     gnutls_datum_t *enc,
+                     const gnutls_pubkey_t receiver_pubkey)
 {
        int ret;
        if (ctx == NULL || enc == NULL || receiver_pubkey == NULL) {
@@ -1180,7 +1181,7 @@ cleanup:
  */
 int gnutls_hpke_decap(gnutls_hpke_context_t ctx, const gnutls_datum_t *info,
                      const gnutls_datum_t *enc,
-                     gnutls_privkey_t receiver_privkey)
+                     const gnutls_privkey_t receiver_privkey)
 {
        int ret;
        if (ctx == NULL || enc == NULL || receiver_privkey == NULL) {
index 3d4daa0862d3c2fb60d6d76bccac6400d4e6abe4..b59cc51c0cb910cd8ea5b97053620fa98c20dfd6 100644 (file)
@@ -114,15 +114,16 @@ int gnutls_hpke_set_psk(gnutls_hpke_context_t ctx, const gnutls_datum_t *psk,
                        const gnutls_datum_t *psk_id);
 
 int gnutls_hpke_set_sender_privkey(gnutls_hpke_context_t ctx,
-                                  gnutls_privkey_t sender_privkey);
+                                  const gnutls_privkey_t sender_privkey);
 
 int gnutls_hpke_set_sender_pubkey(gnutls_hpke_context_t ctx,
-                                 gnutls_pubkey_t sender_pubkey);
+                                 const gnutls_pubkey_t sender_pubkey);
 
 size_t gnutls_hpke_get_enc_size(const gnutls_hpke_context_t ctx);
 
 int gnutls_hpke_encap(gnutls_hpke_context_t ctx, const gnutls_datum_t *info,
-                     gnutls_datum_t *enc, gnutls_pubkey_t receiver_pubkey);
+                     gnutls_datum_t *enc,
+                     const gnutls_pubkey_t receiver_pubkey);
 
 int gnutls_hpke_seal(gnutls_hpke_context_t ctx, const gnutls_datum_t *aad,
                     const gnutls_datum_t *plaintext,
@@ -130,7 +131,7 @@ int gnutls_hpke_seal(gnutls_hpke_context_t ctx, const gnutls_datum_t *aad,
 
 int gnutls_hpke_decap(gnutls_hpke_context_t ctx, const gnutls_datum_t *info,
                      const gnutls_datum_t *enc,
-                     gnutls_privkey_t receiver_privkey);
+                     const gnutls_privkey_t receiver_privkey);
 
 int gnutls_hpke_open(gnutls_hpke_context_t ctx, const gnutls_datum_t *aad,
                     const gnutls_datum_t *ciphertext,