Solved

Lsa secrets

Posted on 2002-03-23
2
764 Views
Last Modified: 2013-12-03
I am storing a password as a LSA secret using LsaStorePrivateData using a hardcoded key string. I am able to get the password using LsaRetrievePrivateData. The point is I have a feature in my app that can be optionally password protected. So if the user removes the password protection I want to delete the password from the LSA database. The next time when I query the LSA database with the same key string I will get an error and I know it is not password protected. I can store another secret to check whether it is password protected but it is a kludge.

P.S. My app has admin privileges. It is a COM server launched under Administrator identity
0
Comment
Question by:vbk_bgm
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
Comment Utility
Did you read the SDK docs?

Under the PARAMETERS section for LasStorePrivateData see:

PrivateData
Pointer to an LSA_UNICODE_STRING structure containing the private data to store. The function encrypts this data before storing it.
If this parameter is NULL, the function deletes any private data stored under the key and deletes the key. Subsequent attempts to retrieve data from the key will return the STATUS_OBJECT_NAME_NOT_FOUND error code.


As it says, to DELETE the data (as I think you are asking... your question is somewhat unclear) you store it with a NULL in the PrivateData parameter.
0
 
LVL 2

Author Comment

by:vbk_bgm
Comment Utility
Yeah that works! I will read the SDK docs carefully hereon.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now