]> git.saurik.com Git - apple/security.git/blobdiff - AppleCSP/CryptKitCSP/FEEKeys.cpp
Security-54.1.tar.gz
[apple/security.git] / AppleCSP / CryptKitCSP / FEEKeys.cpp
index 317e3e814a0e85dd84c82c99802a574ca30e57e5..14f5d435eced82a968e8e1f05657600fe0ab49b5 100644 (file)
@@ -251,12 +251,16 @@ void CryptKit::FEEKeyPairGenContext::generate(
 CryptKit::FEEKeyInfoProvider::FEEKeyInfoProvider(
        const CssmKey &cssmKey) :
                CSPKeyInfoProvider(cssmKey)
 CryptKit::FEEKeyInfoProvider::FEEKeyInfoProvider(
        const CssmKey &cssmKey) :
                CSPKeyInfoProvider(cssmKey)
+{
+}
+CSPKeyInfoProvider *FEEKeyInfoProvider::provider(
+               const CssmKey &cssmKey)
 {
        switch(cssmKey.algorithm()) {
                case CSSM_ALGID_FEE:
                        break;
                default:
 {
        switch(cssmKey.algorithm()) {
                case CSSM_ALGID_FEE:
                        break;
                default:
-                       CssmError::throwMe(CSSMERR_CSP_INVALID_ALGORITHM);
+                       return NULL;
        }
        switch(cssmKey.keyClass()) {
                case CSSM_KEYCLASS_PUBLIC_KEY:
        }
        switch(cssmKey.keyClass()) {
                case CSSM_KEYCLASS_PUBLIC_KEY:
@@ -264,10 +268,10 @@ CryptKit::FEEKeyInfoProvider::FEEKeyInfoProvider(
                        /* FIXME - verify proper CSSM_KEYBLOB_RAW_FORMAT_xx */
                        break;
                default:
                        /* FIXME - verify proper CSSM_KEYBLOB_RAW_FORMAT_xx */
                        break;
                default:
-                       CssmError::throwMe(CSSMERR_CSP_INVALID_KEY_CLASS);
+                       return NULL;
        }
        /* OK, we'll handle this one */
        }
        /* OK, we'll handle this one */
-       return;
+       return new FEEKeyInfoProvider(cssmKey);
 }
 
 /* Given a raw key, cook up a Binary key */
 }
 
 /* Given a raw key, cook up a Binary key */