src/lib/crypto.c
SIGNATURE *crypto_sign_decode(JCR *jcr, const uint8_t *sigData, uint32_t length)
{
   SIGNATURE *sig;
   const unsigned char *p = (const unsigned char *) sigData;

   sig = (SIGNATURE *)malloc(sizeof(SIGNATURE));
   if (!sig) {
      return NULL;
   }
   sig->jcr = jcr;

   /* d2i_SignatureData modifies the supplied pointer */
   sig->sigData  = d2i_SignatureData(NULL, &p, length);

   if (!sig->sigData) {
      /* Allocation / Decoding failed in OpenSSL */
      openssl_post_errors(jcr, M_ERROR, _("Signature decoding failed"));
      free(sig);
      return NULL;
   }

   return sig;
}
/*
 * Decodes the SignatureData structure. The length argument is used to specify the
 * size of sigData.
 *
 * Returns: SIGNATURE instance on success.
 *          NULL on failure.

 */
Decodes the SignatureData structure. The length argument is used to specify the
size of sigData.

SIGNATURE instance on success.
NULL on failure.
Decodes the SignatureData structure . The length argument is used to specify the size of sigData . SIGNATURE instance on success . NULL on failure .
SIGNATURE *crypto_sign_decode(JCR *jcr, const uint8_t *sigData, uint32_t length)
{
   SIGNATURE *sig;
   const unsigned char *p = (const unsigned char *) sigData;
   sig = (SIGNATURE *)malloc(sizeof(SIGNATURE));
   if (!sig) {
      return NULL;
   }
   sig->jcr = jcr;
   sig->sigData  = d2i_SignatureData(NULL, &p, length);
   if (!sig->sigData) {
      openssl_post_errors(jcr, M_ERROR, _("Signature decoding failed"));
      free(sig);
      return NULL;
   }
   return sig;
}
SIGNATURE * crypto_sign_decode ( JCR * jcr , const uint8_t * sigData , uint32_t length ) { SIGNATURE * sig ; const unsigned char * p = ( const unsigned char * ) sigData ; sig = ( SIGNATURE * ) malloc ( sizeof ( SIGNATURE ) ) ; if ( ! sig ) { return NULL ; } sig -> jcr = jcr ; sig -> sigData = d2i_SignatureData ( NULL , & p , length ) ; if ( ! sig -> sigData ) { openssl_post_errors ( jcr , M_ERROR , _ ( " " ) ) ; free ( sig ) ; return NULL ; } return sig ; }
Decodes the SignatureData structure.
Decodes the SignatureData structure .
/* d2i_SignatureData modifies the supplied pointer */ /* Allocation / Decoding failed in OpenSSL */