<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 12/07/2015 22:01, Thomas Herchek
      wrote:<br>
    </div>
    <blockquote cite="mid:D1C83FDB.36A98%25therchek@fiberlink.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <div>Hi,</div>
      <div><br>
      </div>
      <div>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">Sometimes, during the processing of an HTTP cert
          response from the Symantec PKI Manager SCEP server, our
          application encounters an error condition while validating the
          certs attributes.  The error that we see is "Transaction not
          permitted or supported".<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">It appears that this error is detected either in the
          ASN1_TYPE_get() function or the OBJ_nid2obj() function.<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">Can you tell me, what conditions might cause this type
          of failure when unwrapping and validating a cert response?<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">Here is a snippet of our code that detects this
          condition:<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                /* Get signed attributes */<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                attribs =
          PKCS7_get_signed_attributes(si);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                if (attribs == NULL)<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                {<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                               
          ReportAPIError("[PKCS7_UnWrap] No attributes found in PKCS#7
          data", szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                goto cleanup;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                }<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">               <o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                ...<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">               <o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                /* Get pkiStatus */<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                if ((i = get_signed_attribute(attribs,
          nid_pkiStatus, V_ASN1_PRINTABLESTRING, &p)) == 1)<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                {<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                               
          ReportAPIError("[PKCS7_UnWrap] Failed to get the signer
          pkiStatus attributes", szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                goto cleanup;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                }<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;"><o:p> </o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                /* Get failInfo */<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                if (atoi(p)!= SCEP_PKISTATUS_SUCCESS)<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                {<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                if (atoi(p) ==
          SCEP_PKISTATUS_FAILURE)<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                {<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                if ((i
          = get_signed_attribute(attribs, nid_failInfo,
          V_ASN1_PRINTABLESTRING, &p)) == 1)<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                {<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          ReportError("[PKCS7_UnWrap] Cannot find failInfo", szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          goto cleanup;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                }<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                switch
          (atoi(p))<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                {<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                case
          SCEP_FAILINFO_BADALG:<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          ReportError("[PKCS7_UnWrap] Unrecognized or unsupported
          algorithm ident", szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          break;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                case
          SCEP_FAILINFO_BADMSGCHK:<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          ReportError("[PKCS7_UnWrap] Integrity check failed", szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          break;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                <span
            style="background-color: yellow; background-position:
            initial initial; background-repeat: initial initial;">case
            SCEP_FAILINFO_BADREQ:<o:p></o:p></span></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;"><span style="background-color: yellow;
            background-position: initial initial; background-repeat:
            initial initial;">                                                               
            ReportError("[PKCS7_UnWrap] Transaction not permitted or
            supported", szErr);</span><o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          break;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                case
          SCEP_FAILINFO_BADTIME:<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          ReportError("[PKCS7_UnWrap] Message time field was not
          sufficiently close to the system time", szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          break;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                case
          SCEP_FAILINFO_BADCERTID:<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          ReportError("[PKCS7_UnWrap] No certificate could be identified
          matching", szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          break;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                               
          default:<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                               
          ReportError("[PKCS7_UnWrap] Wrong failInfo in reply", szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                                }<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                }<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                else<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                {<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                               
          ReportAPIError("[PKCS7_UnWrap] PKI Status: Not success",
          szErr);<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                }<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;">                                goto cleanup;<o:p></o:p></p>
        <p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size:
          11pt;"><o:p> </o:p></p>
      </div>
    </blockquote>
    <br>
    As I read the code you quoted above, all values of pkiStatus come
    from whomever signed the PKCS#7 message (Symantec?).  Specifically,
    the message contained inside it a digitally signed extension
    attribute of type "pkiStatus" with a value of SCEP_FAILINFO_BADREQ .<br>
    <br>
    If my interpretation is right, this means you need to look at why
    the SCEP server (or whatever else returns that PKCS#7 message)
    returned SCEP_FAILINFO_BADREQ.<br>
    <br>
    I don't know much about SCEP specifically, so I cannot dig deeper
    into this myself.<br>
    <pre class="moz-signature" cols="72">Enjoy

Jakob
-- 
Jakob Bohm, CIO, Partner, WiseMo A/S.  <a class="moz-txt-link-freetext" href="http://www.wisemo.com">http://www.wisemo.com</a>
Transformervej 29, 2860 Søborg, Denmark.  Direct +45 31 13 16 10
This public discussion message is non-binding and may contain errors.
WiseMo - Remote Service Management for PCs, Phones and Embedded </pre>
  </body>
</html>