@@ -81,7 +81,7 @@ kmgr_wrap_key(PgCipherCtx *ctx, CryptoKey *in, CryptoKey *out)
81
81
& enclen , /* Resulting length, must match input for us */
82
82
iv , /* Generated IV from above */
83
83
sizeof (iv ), /* Length of the IV */
84
- ( unsigned char * ) & out -> tag , /* Resulting tag */
84
+ out -> tag , /* Resulting tag */
85
85
sizeof (out -> tag ))) /* Length of our tag */
86
86
return false;
87
87
@@ -106,7 +106,7 @@ kmgr_unwrap_key(PgCipherCtx *ctx, CryptoKey *in, CryptoKey *out)
106
106
107
107
out -> pgkey_id = in -> pgkey_id ;
108
108
out -> counter = in -> counter ;
109
- out -> tag = in -> tag ;
109
+ memcpy ( out -> tag , in -> tag , sizeof ( in -> tag )) ;
110
110
111
111
/* Construct the IV we are going to use, see kmgr_utils.h */
112
112
memcpy (iv , & out -> pgkey_id , sizeof (out -> pgkey_id ));
@@ -120,7 +120,7 @@ kmgr_unwrap_key(PgCipherCtx *ctx, CryptoKey *in, CryptoKey *out)
120
120
& declen , /* Length of plaintext */
121
121
iv , /* IV we constructed above */
122
122
sizeof (iv ), /* Size of our IV */
123
- ( unsigned char * ) & in -> tag , /* Tag which will be verified */
123
+ in -> tag , /* Tag which will be verified */
124
124
sizeof (in -> tag ))) /* Size of our tag */
125
125
return false;
126
126
0 commit comments