Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6969979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:39:05+00:00 2026-05-27T16:39:05+00:00

My code is: FILE * fp = fopen(inputdata, r); PKCS12 * p12 = d2i_PKCS12_fp(fp,

  • 0

My code is:

   FILE * fp = fopen(inputdata, "r");
   PKCS12 * p12 = d2i_PKCS12_fp(fp, NULL);

    if (p12 == NULL)
    {
         NSLog(@"Error loading PKCS12 file to p12 \n"); 
    }
    if ((ret = PKCS12_verify_mac(p12,"tcs",3))){
        lblmsg.text = @"password validated"; 
        NSLog(@"Password validated %s",ppvc_pfxPassPhrase);
    }
    NSLog(@"ret value %d",ret);

I’m able to load the file to p12, but unable to verify the PKCS12 file. I’m getting 0 as the return from PKCS12_verify_mac.

Why is it returning 0?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:39:05+00:00Added an answer on May 27, 2026 at 4:39 pm

    Try using ERR_print_errors to find out the cause. Example:

    ret = PKCS12_verify_mac(p12, "tcs", 3);
    if (ret == 0) {
        ERR_print_errors(stderr);
        // Abort?
    } else {
        lblmsg.text = @"password validated"; 
        NSLog(@"Password validated %s",ppvc_pfxPassPhrase);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Very simply put, I have the following code snippet: FILE* test = fopen(C:\\core.u, w);
This is the code: unsigned int number; FILE* urandom = fopen(/dev/urandom, r); if (urandom)
The code chokes at fopen(): <?php ini_set('display_errors',1); error_reporting(E_ALL); $fp = fopen(/path/to/file/some_file.txt,a) or die(can't open
The code I have is as follows: FILE *txt_file = fopen(data.txt, r); if (txt_file
I have this code: FILE *f = fopen(intPath, r); Node *n; if (f) {
consider the below code snippet. { .... FILE *fptr = fopen(file_that_does_not_exist,r); ... } here,
What it's the equivalent in Objective-C of this C code: FILE* file = fopen(
I wrote the following code: FILE *book; wchar_t bufferln[FILE_READ_BUFFER]; wchar_t buffer[FILE_READ_BUFFER]; book = fopen(file,
There is my source code loading text file and delimitting each line to single
Code: file('pinax/media/a.jpg', 'wb')

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.