Tspi_K...onBlob(3)

✨ Tspi_Key_CreateMigrationBlob ✨

okay so bestie, welcome to the TCG Software Stack Developer's Reference πŸ’– this one is Tspi_Key_CreateMigrationBlob(3) and it's literally the glow-up-your-key-so-it-can-move-out page 🧳✨


🌸 NAME 🌸

Tspi_Key_CreateMigrationBlob β€” makes a key blob that's all dressed up and ready to migrate to another TPM πŸ’… no cap, that's the whole gig.


πŸŽ€ SYNOPSIS πŸŽ€

#include <tss/platform.h>
#include <tss/tcpa_defines.h>
#include <tss/tcpa_typedef.h>
#include <tss/tcpa_struct.h>
#include <tss/tss_typedef.h>
#include <tss/tss_structs.h>
#include <tss/tspi.h>

TSS_RESULT Tspi_Key_CreateMigrationBlob(TSS_HKEY hKeyToMigrate,          TSS_HKEY hParentKey,
                                        UINT32   ulMigTicketLength,      BYTE*    rgbMigTicket,
                                        UINT32*  pulRandomLength,        BYTE**   prgbRandom,
                                        UINT32*  pulMigrationBlobLength, BYTE**   prgbMigrationBlob);

like, look at those params. seven of them. the way she takes up two whole lines 😭 iconic honestly.


πŸ¦‹ DESCRIPTION πŸ¦‹

Tspi_Key_CreateMigrationBlob hands you back a key blob that's got an encrypted section inside it πŸ” β€” and that section will be different depending on the migration scheme that's indicated within the migration ticket. and where did that ticket come from, you ask? it was previously created by the method Tspi_TPM_AuthorizeMigrationTicket(). so it's giving "i got my paperwork sorted earlier, now i'm just packing" πŸ“¦βœ¨


πŸ’– PARAMETERS πŸ’–

hKeyToMigrate

Handle of the key object to migrate. that's the main character of this whole operation πŸ‘‘

hParentKey

Handle to the parent key related to the key addressed by hKeyToMigrate. yes, the key has a parental figure, we respect that 🫢

ulMigTicketLength

The length (in bytes) of the rgbMigTickey parameter. (that's their spelling, not mine, i'm just the messenger πŸ™ˆ)

rgbMigTicket

Pointer to memory containing the migration ticket β€” which is the migration public key and its authorization digest, two-for-one deal 🎟️

pulRandomLength

On successful completion this parameter returns the random data length returned at the parameter prgbRandom. length of the vibes, basically.

prgbRandom

On successful completion this parameter returns the random data. ✨

pulMigrationBlobLength

On successful completion this parameter returns the length of the migration blob data returned at the parameter prgbMigrationBlob.

prgbMigrationBlob

On successful completion this parameter returns the migration data blob. the moment we've all been waiting for πŸŽ‰

heads up bestie: all those "on successful completion" returns only happen if it actually succeeds. if it flops, see the next section, it's gonna be a whole thing πŸ’€

⭐ RETURN CODES ⭐

Tspi_Key_CreateMigrationBlob returns TSS_SUCCESS on success πŸ₯³ otherwise one of the following values gets returned:

  • TSS_E_INVALID_HANDLE β€” Either hKeyToMigrate, hParentKey or rgbMigTicket are invalid parameters. one of them is simply not that girl πŸ™…
  • TSS_E_BAD_PARAMETER β€” One of the passed parameters is wrong.
  • TSS_E_KEY_NO_MIGRATION_POLICY β€” No migration policy picked. you literally didn't choose, so the universe chose for you and it chose error 😭
  • TSS_E_INTERNAL_ERROR β€” An error occurred internal to the TSS. it's not you, it's them.

🌈 CONFORMING TO 🌈

Tspi_Key_CreateMigrationBlob conforms to the Trusted Computing Group Software Specification version 1.1 Golden πŸ‘‘ she's certified, she's spec-compliant, she's that girl.


πŸ’œ SEE ALSO πŸ’œ


and that's the page!! πŸŽ€ source is the TSS 1.1 release, dated 2004-05-26, so she's vintage and still serving πŸ’… iykyk. stay hydrated, read your return codes, and don't migrate without your ticket bestie πŸ¦‹πŸ’–